@donotdev/cli
v0.0.5
Published
Command-line interface for DoNotDev Framework
Maintainers
Readme
@donotdev/cli
Command-line interface for the DoNotDev Framework - scaffold projects, manage deployments, and maintain code quality.
Installation
Global Installation (Recommended for consumers)
npm install -g @donotdev/cli
# or
bun install -g @donotdev/cliProject-local Installation
npm install --save-dev @donotdev/cli
# or
bun add -d @donotdev/cliLicense
This package requires a DoNotDev Framework license. Applications will display a watermark without a valid license key.
View pricing: donotdev.com/pricing Purchase license: donotdev.com/purchase
Configure your license key:
# In .env file (Vite projects)
VITE_DONOTDEV_LICENSE_KEY=dndev_your_key_here
# In .env file (Next.js projects)
NEXT_PUBLIC_DONOTDEV_LICENSE_KEY=dndev_your_key_here
# Or in code (before framework initialization)
globalThis.__DONOTDEV_LICENSE_KEY__ = 'dndev_your_key_here';For detailed setup instructions, see License Key Setup Guide.
Usage
dndev <command> [options]Commands
dndev init [name]
Create a new DoNotDev project. Alias for create-project.
dndev init my-appScaffolds a complete project with:
- Monorepo structure (Turbo)
- Vite or Next.js apps
- Framework packages configured
- CLAUDE.md for AI-assisted development
- Ready-to-use auth, billing, i18n features
Options:
- Interactive prompts guide you through setup
- Choose Vite or Next.js
- Configure features (auth, billing, OAuth)
- Select deployment platform (Firebase, Vercel, both)
dndev create-project [name]
Full form of init. Creates a new DoNotDev project.
dndev create-project my-saas-appdndev create-app [name]
Add a new app to an existing project.
cd my-project
dndev create-app admin-panelOptions:
- Choose app type (Vite or Next.js)
- Configure routing
- Set up i18n
- Enable features per app
dndev deploy
Deploy your application to Firebase or Vercel.
dndev deployFeatures:
- Auto-detects deployment platform
- Validates service accounts (Firebase)
- Deploys functions and hosting
- Handles package.json dependencies
- Creates backups before deployment
- Rollback support on failure
Options:
--project <id>- Specify Firebase project--only functions- Deploy only functions--only hosting- Deploy only hosting--dry-run- Show what would be deployed
dndev sync-secrets
Sync environment variables from .env to Firebase Functions or Vercel.
dndev sync-secretsFeatures:
- Parses
.envfiles - Filters public vars (VITE**, NEXT_PUBLIC**)
- Skips Firebase reserved prefixes
- Supports both Firebase and Vercel
- Cross-platform secret input
Options:
--env-file <path>- Path to .env file (default: .env)--platform <platform>- Target platform: firebase or vercel--project <id>- Firebase project ID--vercel-project <id>- Vercel project ID--dry-run- Show what would be synced--verbose- Detailed output
Examples:
dndev sync-secrets --platform=firebase
dndev sync-secrets --env-file .env.production --project my-firebase-project
dndev sync-secrets --platform=vercel --vercel-project my-vercel-app
dndev sync-secrets --dry-rundndev format [files]
Format code using framework's ESLint and Prettier configurations.
dndev format
dndev format src/**/*.tsFeatures:
- Uses @donotdev/core ESLint rules
- Auto-fixes violations
- Enforces framework conventions
- Import order sorting
- Type safety checks
Setup:
Create eslint.config.js in your project:
import dndevConfig from '@donotdev/core/eslint';
export default [
...dndevConfig,
// Your custom rules
];dndev clean
Remove build artifacts and caches.
dndev clean
dndev clean --cache
dndev clean --allOptions:
--cache- Also remove .turbo, .next, .vite caches--all- Also remove node_modules and lock files
What gets cleaned:
- Always:
dist/directories --cache:.turbo/,.next/,.vite/,tsconfig.tsbuildinfo--all:node_modules/, lock files (package-lock.json, yarn.lock, bun.lockb)
Programmatic Usage
You can also use CLI commands programmatically:
import { createProject, createApp } from '@donotdev/cli';
await createProject('my-app', {
type: 'vite',
features: ['auth', 'billing'],
deployment: 'firebase',
});
await createApp('admin-panel', {
type: 'nextjs',
});Development Mode vs Consumer Mode
The CLI automatically detects execution context:
Consumer Mode (default when installed from npm):
- Creates projects in current directory
- Uses published @donotdev/* packages
- Includes CLAUDE.md for AI assistance
- Standard npm dependency resolution
Development Mode (when run in dndev monorepo):
- Creates projects adjacent to monorepo
- Uses workspace:* dependencies
- Links to local framework packages
Architecture
packages/cli/
├── src/
│ ├── bin/
│ │ └── dndev.mjs # CLI entry point
│ ├── commands/
│ │ ├── init.ts # Alias for create-project
│ │ ├── create-project.ts # Project scaffolding
│ │ ├── create-app.ts # App creation
│ │ ├── deploy.ts # Deployment automation
│ │ ├── sync-secrets.ts # Secret management
│ │ ├── format.ts # Code formatting
│ │ └── clean.ts # Cleanup utilities
│ ├── utils/
│ │ ├── pathResolver.ts # Cross-platform paths
│ │ ├── logger.ts # Colored output
│ │ └── errors.ts # Error handling
│ └── index.ts # Programmatic API
├── templates/ # Scaffolding templates
├── configs/ # Bundled configs
└── package.jsonRequirements
- Node.js >= 18
- Bun >= 1.0 (recommended) or npm
- Git (for project initialization)
For deployment:
- Firebase CLI (for Firebase deployment)
- Vercel CLI (for Vercel deployment)
License
MIT
Links
Built by AMBROISE PARK Consulting
