A unified CLI tool for Flutter SaaS development with live documentation, code generation, and backend integration
npm install @beaulewis/saas-cliA unified CLI for Flutter SaaS development
Live documentation · AI-powered assistance · Code generation · Backend integrations






---
- Features
- Requirements
- Installation
- Quick Start
- Commands
- docs
- ask
- gen
- supabase
- redis
- cf
- push
- flags
- video
- init
- Environment Variables
- Configuration
- Security Notes
- Contributing
- License
- Author
---
| Feature | Description |
|---------|-------------|
| Live Documentation | Query Flutter, Dart, and package docs via Context7 |
| AI-Powered Questions | Ask technical questions with Perplexity AI |
| Code Generation | Generate Riverpod, Drift, GoRouter, Freezed, and more |
| Supabase Management | RLS policies, migrations, types, functions |
| Backend Services | Redis, Cloudflare Workers, OneSignal, PostHog |
| Video Processing | FFmpeg-based video operations |
---
- Node.js 20+ - Download
Some commands require external CLIs to be installed. The table below shows which CLIs are needed for each command:
| Command | Required CLI | Installation |
|---------|--------------|--------------|
| saas init flutter | Flutter SDK | flutter.dev/get-started/install |
| saas init add | Flutter SDK | flutter.dev/get-started/install |
| saas init worker | Wrangler CLI | npm install -g wrangler |
| saas init supabase | Supabase CLI | npm install -g supabase or brew install supabase/tap/supabase |
| saas video * | FFmpeg | brew install ffmpeg (macOS) or apt install ffmpeg (Linux) |
| saas cf * | Wrangler CLI | npm install -g wrangler |
| saas supabase * | Supabase CLI | npm install -g supabase or brew install supabase/tap/supabase |
These commands work out of the box with just Node.js:
- saas docs - Documentation lookup (requires CONTEXT7_API_KEY)
- saas ask - AI questions (requires PERPLEXITY_API_KEY)
- saas gen - Code generation
- saas redis - Redis management (requires REDIS_URL)
- saas push - Push notifications (requires OneSignal keys)
- saas flags - Feature flags (requires PostHog keys)
---
``bashGlobal install via npm
npm install -g @beaulewis/saas-cli
Verify installation:
`bash
saas --version
`
Install from source
`bash
git clone https://github.com/Beaulewis1977/saas-cli.git
cd saas-cli
pnpm install
pnpm build
pnpm link --global
`---
Quick Start
`bash
Look up Flutter documentation
saas docs flutter "ListView.builder with pagination"Ask AI a question
saas ask "best practices for offline-first Flutter apps"Generate a Riverpod notifier
saas gen riverpod notifier UserList --state "List"
`---
Commands
$3
Query live documentation via Context7.
`bash
saas docs flutter "widget lifecycle"
saas docs dart "async streams"
saas docs package riverpod "provider family"
saas docs widget "TextField decoration"
`$3
Ask technical questions using Perplexity AI.
`bash
saas ask "how to implement pull-to-refresh in Flutter"
saas ask --model sonar-pro "explain Flutter rendering pipeline"
saas ask --model sonar-reasoning "debug this riverpod error"
saas ask --model sonar-deep-research "compare state management solutions"
`Available Models:
| Model | Use Case |
|-------|----------|
|
sonar | Fast, general queries (default) |
| sonar-pro | Enhanced responses |
| sonar-reasoning | Complex problem solving |
| sonar-deep-research | In-depth research |$3
Generate Flutter code scaffolds.
`bash
Riverpod
saas gen riverpod notifier UserList --state "List"
saas gen riverpod provider AuthService --async
saas gen riverpod family UserProfile --param userIdDrift (SQLite)
saas gen drift table users --columns "id:int,name:text,email:text"
saas gen drift dao Users --table usersGoRouter
saas gen gorouter route /profile --name profile
saas gen gorouter shell MainShell --routes home,profile,settingsFreezed
saas gen freezed model User --fields "id:int,name:String,email:String?"
saas gen freezed union AuthState --variants loading,authenticated,unauthenticatedPowerSync
saas gen powersync schema --from supabase
saas gen powersync sync-rules users,profilesRepository Pattern
saas gen repository User --methods "getById,getAll,create,update,delete"
`$3
Manage Supabase backend.
`bash
View schema
saas supabase schema
saas supabase schema --table usersCreate table
saas supabase create-table profiles --columns "user_id:uuid,avatar:text,bio:text"RLS policies
saas supabase rls recipes --policy user-owned --column user_id
saas supabase rls posts --policy public-readMigrations
saas supabase migration "add_avatar_to_profiles" --sql "ALTER TABLE..."Generate TypeScript types
saas supabase typesDatabase functions
saas supabase fn get_user_stats --returns json
`$3
Manage Redis cache and queues.
`bash
saas redis ping
saas redis info
saas redis keys "user:*"
saas redis get "session:abc123"
saas redis set "cache:data" '{"key":"value"}' --ttl 3600
saas redis del "cache:data"
saas redis queue add jobs '{"task":"process"}'
saas redis queue pop jobs
`$3
Manage Cloudflare Workers and KV.
`bash
Workers
saas cf worker list
saas cf worker deploy ./worker.js --name my-worker
saas cf worker logs my-workerKV
saas cf kv list
saas cf kv get MY_NAMESPACE key123
saas cf kv put MY_NAMESPACE key123 "value"
`$3
Send notifications via OneSignal.
`bash
saas push send --title "Hello" --message "World" --segments "All"
saas push schedule --title "Reminder" --time "2025-01-15T10:00:00Z"
saas push template list
saas push template create welcome --title "Welcome!" --message "Thanks for joining"
`$3
Manage feature flags via PostHog.
`bash
saas flags list
saas flags get dark-mode
saas flags set dark-mode --enabled --percent 50
saas flags add-user dark-mode user123
saas flags remove-user dark-mode user123
`$3
FFmpeg-based video operations.
`bash
saas video info input.mp4
saas video thumbnail input.mp4 --time 00:00:05 --output thumb.jpg
saas video resize input.mp4 --width 1280 --height 720
saas video compress input.mp4 --quality medium
saas video trim input.mp4 --start 00:00:10 --end 00:00:30
saas video combine video1.mp4 video2.mp4 --output merged.mp4
`$3
Initialize new projects.
`bash
saas init flutter my-app --template saas
saas init supabase --project my-app
saas init worker my-edge-function
saas init add riverpod,drift,freezed
`---
Environment Variables
The CLI reads environment variables for API keys and service credentials. You have two options:
$3
Create a
.env file in your project directory. This allows different API keys per project.`bash
Create .env in your project root (add to .gitignore!)
touch .env
`Copy this template into your
.env file:`ini
Documentation (Context7)
CONTEXT7_API_KEY=AI Questions (Perplexity)
PERPLEXITY_API_KEY=Supabase
SUPABASE_PROJECT_REF=
SUPABASE_ACCESS_TOKEN=Redis
REDIS_URL=Cloudflare Workers
CF_API_TOKEN=Push Notifications (OneSignal)
ONESIGNAL_APP_ID=
ONESIGNAL_API_KEY=Feature Flags (PostHog)
POSTHOG_API_KEY=
POSTHOG_PROJECT_ID=
`Add
.env to your .gitignore to avoid committing secrets:`gitignore
.env
`$3
Add these to your
~/.bashrc, ~/.zshrc, or shell config for system-wide access:`bash
Documentation (Context7)
export CONTEXT7_API_KEY="your-key-here"AI Questions (Perplexity)
export PERPLEXITY_API_KEY="pplx-your-key-here"Supabase
export SUPABASE_PROJECT_REF="your-project-ref"
export SUPABASE_ACCESS_TOKEN="your-access-token"Redis
export REDIS_URL="redis://localhost:6379"Cloudflare Workers
export CF_API_TOKEN="your-cloudflare-token"Push Notifications (OneSignal)
export ONESIGNAL_APP_ID="your-app-id"
export ONESIGNAL_API_KEY="your-api-key"Feature Flags (PostHog)
export POSTHOG_API_KEY="your-posthog-key"
export POSTHOG_PROJECT_ID="your-project-id"
`After adding, reload your shell:
source ~/.bashrc or source ~/.zshrc> Note: Shell-exported environment variables take precedence over
.env file values. If you have both, the shell export wins.$3
| Variable | Description | Required For |
|----------|-------------|--------------|
|
CONTEXT7_API_KEY | Context7 API key | docs |
| PERPLEXITY_API_KEY | Perplexity API key | ask |
| SUPABASE_PROJECT_REF | Supabase project reference | supabase |
| SUPABASE_ACCESS_TOKEN | Supabase access token | supabase |
| REDIS_URL | Redis connection URL | redis |
| CF_API_TOKEN | Cloudflare API token | cf |
| ONESIGNAL_APP_ID | OneSignal app ID | push |
| ONESIGNAL_API_KEY | OneSignal API key | push |
| POSTHOG_API_KEY | PostHog API key | flags |
| POSTHOG_PROJECT_ID | PostHog project ID | flags |---
Global Options
`
--json Output results as JSON
-v, --verbose Enable verbose output
--debug Enable debug output
-V, --version Display version number
-h, --help Display help
`---
Configuration
The CLI stores configuration in
~/.config/saas-cli/:`
~/.config/saas-cli/
├── config.yaml # CLI settings
└── cache/ # Response cache for faster lookups
`---
Security Notes
This CLI executes external tools (FFmpeg, Wrangler, Flutter, Supabase CLI) via shell commands. Ensure you trust the input you provide, especially for:
- Project names in
init commands
- File paths in video commands
- Custom arguments passed to backend CLIs---
Contributing
Contributions are welcome! See CONTRIBUTING.md for development guidelines.
- Bug reports: Open an issue
- Feature requests: Start a discussion
- Pull requests: Fork, create a branch, and submit a PR
`bash
Clone and install
git clone https://github.com/Beaulewis1977/saas-cli.git
cd saas-cli
pnpm installRun in development
pnpm devRun tests
pnpm testBuild
pnpm build
``---
MIT License - see LICENSE file for details.
---
Beau Lewis


---
If you find this tool useful and want to support continued development:

