π€ AI-powered code generation CLI tool with conversation persistence, advanced file tools, and support for multiple LLM providers (OpenAI GPT & Anthropic Claude).
- π― Interactive Mode: Chat-like interface for iterative code generation
- π Conversation Persistence: Save and resume conversations across sessions
- π§ Advanced File Tools: Diff edits, search, checkpoints, and smart directory filtering
- π€ Multiple LLM Providers: OpenAI (GPT-4) and Anthropic (Claude) support
- π Sandbox Deployment: Deploy code to cloud environments (E2B) with auto-detection
- π File Watching: Real-time sync of file changes to deployed sandboxes
- π‘οΈ Graceful Exit: Auto-saves conversations on Ctrl+C exit
- π Retry Logic: Automatic retry with exponential backoff for API rate limits
- π¨ Beautiful Interface: Colorized output with progress indicators
- π Project-Aware: Maintains working directory context per conversation
- β¨οΈ Smart Autocomplete: Tab completion for commands, options, and common patterns
npm install -g promptcoder-clinpm install promptcoder-clipromptcoder config# OpenAI
export OPENAI_API_KEY="your-openai-api-key"
export OPENAI_MODEL="gpt-4o" # optional
# Anthropic
export ANTHROPIC_API_KEY="your-anthropic-api-key"
export ANTHROPIC_MODEL="claude-3-5-sonnet-20241022" # optional
# E2B Sandbox (optional)
export E2B_API_KEY="your-e2b-api-key"Configuration is stored in ~/.promptcoder/config.json
promptcoder interactive
# or
promptcoder ipromptcoder prompt "Create a React component for a todo list"
# or
promptcoder p "Add error handling to my express server" --directory ./my-project# First, configure your sandbox settings
promptcoder sandbox init # or use interactive mode: /sandbox init
# Deploy current project to a sandbox
promptcoder deploy
# Deploy with custom template and name
promptcoder deploy --template react-ts --name "My React App"
# Deploy without opening browser
promptcoder deploy --no-open
# List active sandboxes
promptcoder sandbox list
# Get sandbox status
promptcoder sandbox status <sandbox-id>
# Delete a sandbox
promptcoder sandbox delete <sandbox-id># Watch for changes and sync to sandbox
promptcoder watch <sandbox-id>
# Watch specific patterns
promptcoder watch <sandbox-id> --watch "src/**/*.ts" "*.json"
# Ignore specific patterns
promptcoder watch <sandbox-id> --ignore "node_modules/**" "dist/**"# All commands in interactive mode require / prefix:
# π‘ Press Tab after "/" for autocomplete!
# Conversation Management
/help # Show all available commands
/exit # Exit PromptCoder
/save # Save current conversation
/load # Load a previous conversation
/list # List all saved conversations
/rename # Rename current conversation
/delete # Delete a conversation
/clear # Clear current conversation
# Development & Deployment
/config # Configure API keys and settings
/sandbox init # Configure sandbox deployment (E2B API key)
/deploy --template react-ts # Deploy current project
/sandbox list # List active sandboxes
/sandbox status <sandbox-id> # Get sandbox details
/sandbox delete <sandbox-id> # Delete a sandbox
/watch <sandbox-id> # Start file watching
/stop [sandbox-id] # Stop file watching (all or specific)
# Graceful Exit: Press Ctrl+C to exit with auto-saveThe AI has access to these powerful tools:
read_file- Read file contentswrite_file- Write content to files (creates directories automatically)read_directory- Smart directory listing (filters node_modules, .git, etc.)create_directory- Create directoriesdelete_file- Delete filesfile_exists- Check if files/directories exist
edit_file_diff- Precise edits using exact text matchinginsert_lines- Insert content at specific line numbersdelete_lines- Remove specific line ranges
search_in_files- Search patterns across multiple files with regex support
create_checkpoint- Save snapshots of file stateslist_checkpoints- View all checkpoints with metadatarestore_checkpoint- Rollback to previous statesshow_file_diff- Compare current files with checkpoint versions
deploy_to_sandbox- Deploy project to cloud sandbox (E2B)sync_to_sandbox- Sync files to existing sandboxlist_sandboxes- List active deploymentsget_sandbox_status- Check sandbox detailsdelete_sandbox- Remove sandbox deploymentsstart_code_sync- Start real-time file watchingstop_code_sync- Stop file watchingget_sync_status- Check sync status
promptcoder i
Prompt: Create a modern React TypeScript app with routing and state management
# The AI will:
# 1. Read your directory structure
# 2. Create package.json with dependencies
# 3. Set up TypeScript configuration
# 4. Create components and routing
# 5. Set up state management
# 6. Add proper file structurepromptcoder i
Prompt: Refactor this codebase to use TypeScript and add proper error handling
# The AI will:
# 1. Create a checkpoint of current state
# 2. Search through existing files
# 3. Convert JavaScript to TypeScript
# 4. Add error handling patterns
# 5. Update configurations
# 6. Show diffs of changes made# Start working on a project
promptcoder i
Prompt: Build a REST API with Express and PostgreSQL
# ... work continues ...
save
Name: "E-commerce API"
Description: "Building product catalog and user auth"
# Later, resume exactly where you left off
promptcoder i
load
# Select: "E-commerce API (15 messages, 12/5/2024)"
# Continue with full context preserved# Seamless development workflow with commands and AI assistance
promptcoder i
Prompt: Create a React TypeScript app with routing
# ... AI creates the app ...
/save # Save this conversation
/deploy --template react-ts --name "My App" # Deploy to sandbox
# β
Deployment successful! Sandbox ID: abc123...
/watch abc123 # Start file watching
# π File watcher started successfully
Prompt: Add a dark mode toggle to the navbar
# ... AI makes changes ...
# β
Synced 3 file(s) to sandbox (automatically)
/sandbox list # Check all deployments
/stop abc123 # Stop file watching when doneπ€ PromptCoder Interactive Mode
Commands: /exit, /clear, /save, /load, /list, /rename, /delete
CLI Commands: /deploy, /sandbox, /watch, /stop (use /help for full list)
Press Ctrl+C to exit
[My React Project] Prompt: Add authentication to the app
π Processing (1/25)...
π¬ Response:
I'll help you add authentication to your React app. Let me first examine your current project structure.
π§ Executing 2 tool call(s):
β read_directory({"dir_path":"."})
Contents of . (8 items):
FILE: package.json (2KB)
DIR: src
FILE: tsconfig.json (421B)
...
β read_file({"file_path":"src/App.tsx"})
File contents of src/App.tsx:
...
π Continuing conversation after tool execution...
π¬ Response:
Now I'll create the authentication system. I'll add:
1. Auth context and provider
2. Login/signup components
3. Protected routes
4. JWT token management
π§ Executing 4 tool call(s):
β create_checkpoint({"checkpoint_name":"before_auth","description":"Before adding authentication"})
Created checkpoint "before_auth" with 12 files
β write_file({"file_path":"src/contexts/AuthContext.tsx","content":"..."})
Successfully wrote 1240 characters to src/contexts/AuthContext.tsx
...
β
Turn completed
# Clone and install
git clone https://github.com/promptcoder/promptcoder-cli.git
cd promptcoder-cli
npm install
# Development mode
npm run dev
# Build
npm run build
# Test global installation
npm run build && npm link- API Keys: Stored locally in
~/.promptcoder/config.json - Conversations: Stored locally in
~/.promptcoder/conversations/ - No Data Sharing: All data remains on your machine
- Secure: Uses official OpenAI and Anthropic SDKs
- Node.js: 16.0.0 or higher
- API Key: OpenAI or Anthropic API key
- Operating System: macOS, Linux, or Windows
MIT Β© PromptCoder Team
Contributions are welcome! Please feel free to submit a Pull Request.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with β€οΈ for developers who want to code faster with AI assistance.