starcode.help
A powerful conversational AI CLI tool with text editor capabilities, built in Rust
Features • Installation • Quick Start • Configuration • Commands • Contributing • License
- TPS is fast
- Rust is fast
- copy by claude code
- 100% rust code
- Multi-Provider AI Support - Connect to OpenAI, Anthropic, and other OpenAI-compatible APIs
- Interactive TUI - Beautiful terminal user interface with real-time streaming
- Tool Integration - Execute commands, edit files, and interact with your codebase
- MCP Protocol - Model Context Protocol support for extensible toolchains
- Git Integration - AI-assisted git operations with intelligent suggestions
- Smart Search - Fast code search using ripgrep with AST-aware chunking
- Syntax Highlighting - Beautiful code highlighting with multiple themes
- Session Management - Save, resume, and manage conversation sessions
- Internationalization - Multi-language support (English, Chinese)
- Permission System - Fine-grained control over tool execution permissions
- Headless Mode - Process prompts without interactive UI for scripting
- Cross-Platform - Works on Linux, macOS, and Windows
StarCode CLI is your AI-powered coding assistant that can:
- Read and understand your entire codebase
- Edit files with intelligent suggestions and diff previews
- Execute commands in a sandboxed environment
- Search code using regex, glob patterns, or AST-aware search
- Manage Git operations with AI assistance
- Work with MCP servers for extensible functionality
- Resume sessions to continue where you left off
- Process prompts in headless mode for automation
# Clone the repository
git clone https://github.com/xyz1o2/starcode-cli.git
cd starcode-cli
# Build and install into ~/.cargo/bin
./install.sh # Windows: .\install.ps1install.sh installs one binary and adds two command aliases, so any of these
starts the same program:
sc # short form
starcode
starcode-cliTo build by hand instead — note this only gives you the starcode-cli name:
cargo build --release
cp target/release/starcode-cli /usr/local/bin/# Install directly from the repository
cargo install --git https://github.com/xyz1o2/starcode-cli.git starcode-cliDownload the latest release for your platform from the Releases page.
# Option 1: Environment variable
export STAR_API_KEY="your-api-key"
# Option 2: Create a .env file
echo "STAR_API_KEY=your-api-key" > .env# Start interactive mode
sc
# Or with an initial message
sc "Explain the structure of this project"# Process a single prompt
sc -p "What files are in the current directory?"
# With specific output format
sc -p "List all Rust files" --output-format text# API Configuration
STAR_API_KEY=your-api-key # Required: Your API key
STAR_BASE_URL=https://api.openai.com/v1 # Optional: Custom API base URL
# Model Configuration
STAR_MODEL=gpt-4 # Optional: Default model to useCreate ~/.star/user-settings.json:
{
"apiKey": "your-api-key",
"model": "gpt-4",
"baseUrl": "https://api.openai.com/v1",
"temperature": 0.2,
"maxTokens": 8192
}StarCode looks for STAR.md in your project root for project-specific instructions:
# Project: My Awesome Project
## Build Commands
- `cargo build` - Build the project
- `cargo test` - Run tests
## Code Style
- Use snake_case for variables
- Add doc comments for public functions
## Architecture
- Main entry point: src/main.rs
- Core logic: src/core/# Start interactive session
starcode
# With working directory
starcode -d /path/to/project
# Resume a session
starcode --resume
starcode --resume <session-id>
# Skip permission prompts (use with caution!)
starcode --dangerously-skip-permissions# Process a prompt and exit
starcode -p "Your prompt here"
# With specific output format
starcode -p "Your prompt" --output-format jsonl
starcode -p "Your prompt" --output-format text# Initialize a new project with STAR.md
starcode init
# MCP server management
starcode mcp add <server-name> <command>
starcode mcp remove <server-name>
starcode mcp list
# Git operations with AI assistance
starcode git commit
starcode git diff
starcode git status# Default mode - asks for permission
starcode --permission-mode default
# Plan mode - read-only operations only
starcode --permission-mode plan
# YOLO mode - bypass all permissions (dangerous!)
starcode --permission-mode yoloStarCode CLI comes with a comprehensive set of built-in tools:
- Read - Read file contents with line numbers
- Write - Create or overwrite files
- Edit - Make precise file edits
- Bash - Execute shell commands
- Grep - Search files using ripgrep
- Glob - Find files by pattern
- Agent - Spawn sub-agents for complex tasks
- WebFetch - Fetch and analyze web pages
StarCode supports the Model Context Protocol (Model Context Protocol) for extending its capabilities:
# Add an MCP server
starcode mcp add filesystem "npx -y @modelcontextprotocol/server-filesystem /path/to/directory"
# List configured servers
starcode mcp list
# Remove a server
starcode mcp remove filesystem# Clone the repository
git clone https://github.com/xyz1o2/starcode-cli.git
cd starcode-cli
# Debug build
cargo build
# Release build
cargo build --release
# Run tests
cargo test
# Run with logging
RUST_LOG=debug cargo runstarcode/
├── starcode-cli/
│ ├── src/
│ │ ├── main.rs # Entry point
│ │ ├── agent/ # AI agent logic
│ │ ├── commands/ # CLI commands
│ │ ├── core/ # Core functionality
│ │ ├── llm/ # LLM integration
│ │ ├── runtime/ # Runtime environment
│ │ ├── tools/ # Built-in tools
│ │ ├── types/ # Type definitions
│ │ ├── ui/ # Terminal UI
│ │ └── utils/ # Utilities
│ ├── eval/ # Evaluation harness
│ ├── i18n/ # Internationalization
│ └── Cargo.toml # Rust dependencies
├── README.md
└── LICENSE
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
StarCode includes a built-in evaluation harness for testing AI capabilities:
# Run the evaluation suite
starcode eval --tasks eval/tasks.json
# Run with multiple trials
starcode eval --tasks eval/tasks.json --trials 3
# Generate markdown report
starcode eval --tasks eval/tasks.json --report-md eval-report.md
# Compare against baseline
starcode eval --baseline .star/eval-baseline.jsonAPI Key not found
# Check if environment variable is set
echo $STAR_API_KEY
# Or verify the config file exists
cat ~/.star/user-settings.jsonBuild fails
# Make sure you have Rust installed
rustc --version
# Update Rust toolchain
rustup update
# Clean and rebuild
cargo clean && cargo build --releasePermission denied
# Make sure the binary is executable
chmod +x target/release/starcode-cli
# Or install to a directory in your PATH
sudo cp target/release/starcode-cli /usr/local/bin/- Added MCP (Model Context Protocol) support
- Improved session management
- Added Git integration commands
- Performance optimizations
- Bug fixes and stability improvements
- Added headless mode
- Multi-provider support
- Internationalization (i18n)
- Permission system
- Initial release
- Interactive TUI
- Basic tool integration
- File operations
- Built with Rust
- Terminal UI powered by Ratatui
- LLM integration via Rig
- MCP support following Model Context Protocol
Made by xyz1o2