npm package: @scaffit/cli
Description: Scaffit CLI - Command-line interface for adding modular scaffolds to Next.js, React, Vue, Angular, Svelte, Express, Fastify, Node.js projects
Author: Santosh Hanumaiah Ranganatha
Latest version: 1.0.33

# @scaffit/cli

Command-line interface for Scaffit - Add modular scaffolds to your project.

## Installation

### Recommended: Use npx (No installation required)

```bash
# Just use npx - works immediately!
npx scaffit add env
```

### Alternative: Global Installation

```bash
npm install -g @scaffit/cli
# Then use: scaffit
```

## Usage

```bash
# Initialize new project with wizard
npx scaffit init

# Add scaffolds to your project
npx scaffit add env
npx scaffit add prettier
npx scaffit add eslint --dry-run  # Preview changes

# Launch web dashboard
npx scaffit web

# Search and discover scaffolds
npx scaffit search payment
npx scaffit search --category auth

# List available scaffolds
npx scaffit list

# Check project health
npx scaffit health

# Update scaffolds
npx scaffit update eslint
npx scaffit update --all
npx scaffit update --yes  # Skip confirmation prompts

# Rollback changes
npx scaffit rollback eslint
npx scaffit rollback env --yes  # Skip confirmation prompts

# Security audit
npx scaffit audit

# Test scaffolds
npx scaffit test env
npx scaffit test --all

# Diagnose and fix issues
npx scaffit repair
npx scaffit repair --all

# Clean up files and cache
npx scaffit clean --all
npx scaffit clean --cache

# Validate project integrity
npx scaffit validate
npx scaffit validate --fix

# Get help and information
npx scaffit help
npx scaffit help add
npx scaffit info env
npx scaffit info --all

# Remove a scaffold
npx scaffit remove env

# Show verbose information
npx scaffit verbose
npx scaffit verbose --scaffold env
npx scaffit verbose --project
npx scaffit verbose --all
```

## Commands

### `npx scaffit init`

Initialize a new project with interactive wizard:
- Framework selection (Next.js, React, Express, etc.)
- Package manager choice (npm, yarn, pnpm)
- Scaffold selection
- Git initialization
- One-command project creation

### `npx scaffit add <scaffold>`

Add a scaffold to your current project:
- Load scaffold from npm
- Interactive configuration prompts
- Install files and dependencies
- Show summary of changes
- `--dry-run` flag for preview mode

### `npx scaffit search <query>`

Search and discover scaffolds:
- Fuzzy search by name, tags, category
- Popularity metrics and ratings
- Filter by framework compatibility
- Interactive installation

### `npx scaffit health`

Check project health and diagnostics:
- Scaffold version checks
- Security vulnerability scanning
- Dependency analysis
- Configuration validation
- Best practice recommendations

### `npx scaffit update <scaffold>`

Update scaffolds to latest versions:
- Version checking with changelog
- Breaking change warnings
- Automatic migration
- Batch updates with `--all`
- `--yes` flag to skip confirmation prompts
- `--dry-run` for preview

### `npx scaffit rollback <scaffold>`

Rollback scaffold changes:
- Version history tracking
- One-click rollback
- `--yes` flag to skip confirmation prompts
- Automatic backups
- Git integration

### `npx scaffit audit`

Security audit and compliance check:
- CVE database checking
- Dependency vulnerability scanning
- Hardcoded secret detection
- Configuration security analysis
- Fix recommendations

### `npx scaffit test <scaffold>`

Test scaffold installations:
- Installation verification
- Runtime testing
- Integration testing
- Performance benchmarks
- `--all` flag for all scaffolds

### `npx scaffit web`

Launch the web dashboard for visual scaffold management.

### `npx scaffit list`

List all available scaffolds, optionally filtered by category.

### `npx scaffit repair`

Diagnose and fix common issues with scaffolds:
- Fixes corrupted scaffold installations
- Repairs missing files and dependencies
- Cleans up orphaned files
- Interactive or automatic fixing

### `npx scaffit clean`

Clean up temporary files, cache, and backups:
- Cleans npm/yarn/pnpm cache
- Removes old scaffold backups
- Cleans temporary installation files
- Shows space freed after cleanup

### `npx scaffit validate`

Validate project integrity and scaffold installations:
- Validates scaffold installations
- Checks file integrity and configuration
- Verifies dependencies and scripts
- Provides fix recommendations

### `npx scaffit help [command]`

Show help information and command list:
- General help with all commands
- Specific command help with examples
- Usage patterns and options
- Support information

### `npx scaffit info [scaffold]`

Show detailed information about scaffolds:
- Comprehensive scaffold details
- Dependencies and file structure
- Configuration options
- Usage examples and changelog

### `npx scaffit remove <scaffold>`

Remove a previously installed scaffold.

### `npx scaffit verbose [options]`

Show verbose information about Scaffit CLI, scaffolds, and project:

- `npx scaffit verbose` - General CLI and environment information
- `npx scaffit verbose --scaffold <name>` - Detailed scaffold information including prompts and configuration
- `npx scaffit verbose --project` - Project information including installed scaffolds and scripts
- `npx scaffit verbose --all` - Comprehensive information for all installed scaffolds

Provides detailed debugging and diagnostic information for troubleshooting.

## Examples

```bash
# Initialize new project
npx scaffit init

# Add environment variable setup
npx scaffit add env

# Add Prettier formatting
npx scaffit add prettier

# Preview eslint integration
npx scaffit add eslint --dry-run

# Launch web UI
npx scaffit web --port 3001

# Search for payment scaffolds
npx scaffit search payment

# List all scaffolds
npx scaffit list

# Check project health
npx scaffit health

# Update all scaffolds
npx scaffit update --all

# Update without prompts
npx scaffit update --yes

# Rollback eslint to previous version
npx scaffit rollback eslint

# Rollback without prompts
npx scaffit rollback env --yes

# Run security audit
npx scaffit audit

# Test all scaffolds
npx scaffit test --all

# Diagnose and fix issues
npx scaffit repair --all

# Clean up everything
npx scaffit clean --all

# Validate project
npx scaffit validate --fix

# Get help
npx scaffit help add

# Get scaffold information
npx scaffit info stripe
npx scaffit info --all

# Show verbose information
npx scaffit verbose
npx scaffit verbose --scaffold env
npx scaffit verbose --project
npx scaffit verbose --all
```

## Configuration

Scaffolds are configured through interactive prompts. Each scaffold defines its own configuration schema.

## Troubleshooting

- **Scaffold not found**: Make sure the scaffold name is correct and the package is published
- **Permission errors**: Ensure you have write permissions to the project directory
- **Network issues**: Check your internet connection for downloading packages