CLI tool for composable codebase edits - add pricing, AI assistants, and create pages with ease.
npx dolphin-cli@latest
# or install globally
npm install -g dolphin-clidolphin-cli <command> [options]Add complete billing infrastructure to your app:
- Database tables for subscriptions, invoices, and usage tracking
- Webhook endpoints for payment providers
check()andtrack()abstractions for feature gating
dolphin-cli pricing [options]
Options:
-y, --yes Skip confirmation prompts
--provider <provider> Payment provider (stripe, lemonsqueezy) [default: stripe]Example:
# Setup Stripe billing
dolphin-cli pricing --provider stripe
# In your code
import { check, track } from './server/pricing';
// Check if user can use a feature
if (await check(userId, 'api_calls', 10)) {
// Track the usage
await track(userId, 'api_calls', 10);
// Perform the API calls
}Setup AI assistant infrastructure within user shards:
- Conversation and message tables
- API endpoints for chat
- Streaming support (SSE)
- Client utilities for easy integration
dolphin-cli ai-assistant [options]
Options:
-y, --yes Skip confirmation prompts
--provider <provider> AI provider (openai, anthropic, ollama) [default: openai]
--model <model> Model to use [default: gpt-4-turbo-preview]Example:
# Setup OpenAI assistant
dolphin-cli ai-assistant --provider openai --model gpt-4
# In your component
import { useAIConversation } from './utils/ai-assistant';
const { messages, loading, sendMessage } = useAIConversation();
await sendMessage(conversationId, "Hello, how can you help?");Create static, dashboard, or feed pages with proper structure:
dolphin-cli create-page <name> [options]
Arguments:
name Name of the page (e.g., "about", "pricing", "feed")
Options:
-t, --type <type> Page type (static, dashboard, feed) [default: static]
-y, --yes Skip confirmation promptsSimple HTML pages with SolidJS and shadcn/ui included:
dolphin-cli create-page about --type staticCreates:
src/client/about/index.html- Self-contained HTML page- Updates
vite.config.tsautomatically
Full SolidJS pages with context, data loading, and state management:
dolphin-cli create-page dashboard --type dashboardCreates:
src/client/dashboard/index.html- Entry HTMLsrc/client/dashboard/index.tsx- Entry pointsrc/client/dashboard/Dashboard.tsx- Main componentsrc/client/dashboard/DashboardContext.tsx- State managementsrc/client/dashboard/DashboardApiClient.ts- API clientsrc/client/dashboard/DashboardAutosaveService.ts- Autosave functionalitysrc/client/dashboard/DashboardUndoRedoService.ts- Undo/redo support- Updates
vite.config.tsautomatically - Provides
/api/dashboard/loadand/api/dashboard/saveendpoint templates
Twitter-like infinite scroll feed pages with real-time updates:
dolphin-cli create-page feed --type feedCreates:
src/client/feed/index.html- Entry HTMLsrc/client/feed/index.tsx- Entry pointsrc/client/feed/Feed.tsx- Main feed component with infinite scrollsrc/client/feed/FeedContext.tsx- Feed state managementsrc/client/feed/FeedApiClient.ts- API client with paginationsrc/client/feed/FeedAutosaveService.ts- Autosave functionalitysrc/client/feed/FeedUndoRedoService.ts- Undo/redo support- Updates
vite.config.tsautomatically - Provides
/api/feed/loadand/api/feed/saveendpoints with continuation token support
Dolphin CLI expects your project to follow this structure:
project/
├── src/
│ ├── client/ # Frontend pages
│ │ ├── dashboard/ # Dynamic page example
│ │ └── styles/ # Global styles
│ └── server/
│ ├── db/
│ │ ├── schema.ts # Main database schema
│ │ └── sharded-schema.ts # Per-user shard schema
│ ├── api/ # API endpoints
│ ├── webhooks/ # Webhook handlers
│ └── pricing/ # Pricing utilities
├── vite.config.ts
└── .env.example
After running commands, update your .env file with the required variables:
# Stripe
STRIPE_SECRET_KEY=
STRIPE_PUBLISHABLE_KEY=
STRIPE_WEBHOOK_SECRET=
STRIPE_PRO_PRICE_ID=
STRIPE_ENTERPRISE_PRICE_ID=# OpenAI
OPENAI_API_KEY=
# Anthropic
ANTHROPIC_API_KEY=
# Ollama
OLLAMA_HOST=http://localhost:11434- Initialize pricing for your SaaS:
dolphin-cli pricing --provider stripe- Add AI chat capabilities:
dolphin-cli ai-assistant --provider openai- Create a pricing page:
dolphin-cli create-page pricing --type static- Create a user dashboard:
dolphin-cli create-page dashboard --type dashboard- Create a social feed:
dolphin-cli create-page feed --type feedTo contribute to Dolphin CLI:
git clone https://github.com/your-username/dolphin-cli
cd dolphin-cli
npm install
npm run devnpm run build
npm publishMIT
Contributions are welcome! Please feel free to submit a Pull Request.
Built with 🐬 by the Dolphin CLI team