@deploybay/cli
v1.0.3
Published
Command-line interface for DeployBay serverless platform
Readme
DeployBay CLI
A command-line interface for DeployBay, a serverless deployment platform.
Installation
npm install -g @deploybay/cliCore Commands
deploybay login
Authenticate with your DeployBay account to access deployment features.
deploybay init
Initialize a new DeployBay project in the current directory.
Features:
- 🚀 Project scaffolding with templates
- 📝 TypeScript/JavaScript support
- 🎯 Multiple framework options:
- Vanilla (Basic DeployBay app)
- Hono (Lightweight web framework)
- Itty Router (Zero-dependency router)
Usage:
deploybay init
# Follow the interactive prompts to configure your projectdeploybay dev
Start a local development server with hot reload and debugging features.
Features:
- 🚀 Hot Reload: Automatically rebuilds and reloads when you change files
- 📁 File Watching: Watches all project files for changes
- ⚡ Fast Development: Uses esbuild for fast bundling
- 🔄 Debounced Rebuilds: Prevents excessive rebuilding with 500ms debounce
- 🎯 Manual Refresh: Press Ctrl+R to manually refresh the server
- 🌐 Port Management: Automatically finds available ports
Usage:
deploybay dev # Start with default settings
deploybay dev --port 3000 # Use specific port
deploybay dev --host 0.0.0.0 # Bind to all interfaces
deploybay dev --no-watch # Disable file watchingdeploybay deploy
Deploy your application to DeployBay's serverless platform.
Features:
- 🌍 Global edge deployment
- 🔄 Automatic scaling
- 📊 Built-in monitoring
- 🔐 Secure environment handling
deploybay secret
Manage environment variables and encrypted secrets for your application.
Usage:
deploybay secret set API_KEY "your-key" --type secret # Set encrypted secret
deploybay secret set NODE_ENV "production" --type variable # Set environment variable
deploybay secret list # View all configured variablesdeploybay migration
Manage database schema migrations.
Features:
- 📝 Create new migrations
- 🔄 Apply pending migrations
- 📊 Check migration status
- 🔍 Preview migration changes
Usage:
deploybay migration create users # Create new migration
deploybay migration list # Show all migrations
deploybay migration status # Check pending migrations
deploybay migration apply # Apply pending migrations
deploybay migration apply --dry-run # Preview changesSDK Integration
The DeployBay SDK provides built-in services for your application:
import { data, store, media, config, ai } from '@deploybay/sdk';
// SQL Database
const users = await data.query('SELECT * FROM users WHERE active = ?', [true]);
// Key-Value Storage
await store.put('session:123', JSON.stringify(sessionData));
const session = await store.get('session:123');
// File Storage
await media.put('uploads/avatar.jpg', imageBuffer, {
metadata: { contentType: 'image/jpeg' }
});
// Environment & Secrets
const apiKey = config.get('API_KEY');
const isDev = config.isDevelopment();
// AI Capabilities
const result = await ai.run('text-model', {
prompt: 'Analyze this text...'
});SDK Features
📊 SQL Database (
data)- Full SQL query support
- Prepared statements
- Transactions
- Automatic migrations
💾 Key-Value Store (
store)- Fast caching
- Session storage
- Bulk operations
- Prefix scanning
📁 Media Storage (
media)- File uploads/downloads
- Image handling
- Large file support
- Metadata management
⚙️ Configuration (
config)- Environment variables
- Encrypted secrets
- Environment detection
- Runtime configuration
🤖 AI Integration (
ai)- Built-in AI capabilities
- Multiple model support
- Easy integration
Development
To work on the CLI itself:
cd packages/cli
pnpm install
pnpm buildFile Watching Details
The dev command uses chokidar for file watching:
Ignored Patterns:
node_modules/**.git/**.deploybay/**dist/**build/****/*.log
Watch Features:
- Debounced rebuilds (500ms)
- Manual refresh with Ctrl+R
- Automatic port management
- Clean shutdown handling
- Terminal integration
