AI-Powered Terminal Assistant — Understands your codebase, edits files, runs commands, and automates development workflows.
SRcode is a powerful AI-powered terminal assistant designed to supercharge your development workflow. Built with modern TypeScript and React/Ink, it provides an intelligent CLI experience that deeply understands your project context, executes tasks autonomously, and integrates seamlessly with Claude Desktop via the Model Context Protocol (MCP).
- Intelligent Code Understanding — Deep awareness of your project structure, dependencies, and codebase
- Autonomous Task Execution — Executes complex development tasks with intelligent planning
- Tool Ecosystem — 18+ built-in tools for file operations, command execution, web search, and more
- Multi-Model Support — Works with OpenAI, Anthropic Claude, and other LLM providers
- MCP Integration — Native integration with Claude Desktop for enhanced AI capabilities
- Security First — Sandboxed execution with multi-layer permission controls
- Extensible — Plugin and skill system for custom extensions
- Node.js >= 20.18.1
- Bun (recommended for development)
- npm or yarn (for installation)
# Install via npm
npm install -g srcode
# Or via bun
bun install -g srcodesrcode --versionStart an interactive session in your terminal:
srcodeConnect to Claude Desktop by running as an MCP server:
srcode mcp# Ask a question
srcode "How does authentication work in this project?"
# Edit files
srcode "Fix the bug in user.ts"
# Run commands
srcode "Run the test suite"SRcode provides 18+ built-in tools organized into categories:
| Category | Tools |
|---|---|
| File Operations | FileRead, FileWrite, FileEdit, MultiEdit, Glob, Grep, ls |
| System Execution | Bash, Task, Architect, Memory |
| Development | NotebookRead, NotebookEdit, TodoRead, TodoWrite |
| Web & Network | WebFetch, WebSearch |
| AI & Agents | AskExpert, Task, Skill |
| MCP Integration | MCPTool |
SRcode implements a multi-layer permission system for security:
- Tool-level — Each tool declares its own permission requirements
- Session-level — Trust level based on project configuration
- Command-level — Whitelist/blacklist for specific commands
- Filesystem-level — Directory boundary checks
Extend SRcode capabilities with skills — reusable instruction sets in the Agent Skills format:
# Install a skill from GitHub
npx add-skill owner/repo -a srcode
# Use a skill
/skill-nameSRcode supports multiple AI providers. Configure via environment variables:
# Anthropic Claude
export ANTHROPIC_API_KEY=sk-ant-...
# OpenAI
export OPENAI_API_KEY=sk-...
# OpenRouter (for diverse models)
export OPENROUTER_API_KEY=...Create .srcode.json in your project root:
{
"model": "claude-sonnet-4-20250514",
"temperature": 0.7,
"trustProjects": ["./my-trusted-project"],
"allowedCommands": ["git", "npm", "bun"]
}# Switch model interactively
srcode model
# Or set in config
srcode config set model claude-opus-4-20250514# Clone the repository
git clone https://github.com/shareAI-lab/SRcode.git
cd SRcode
# Install dependencies
bun install
# Run in development mode
bun run dev# Build for npm distribution
bun run build
# Or build standalone binary
bun run build:binary# Run all tests
bun test
# Run specific test suites
bun test:unit # Unit tests
bun test:integration # Integration tests
bun test:e2e # End-to-end tests# Type check
bun run typecheck
# Lint
bun run lint
# Format
bun run formatsrcode/
├── src/
│ ├── entrypoints/ # CLI & MCP entry points
│ ├── commands/ # CLI commands
│ ├── tools/ # Tool implementations (18+ tools)
│ ├── services/ # Core services (AI, auth, MCP, etc.)
│ ├── ui/ # React/Ink components
│ └── utils/ # Utilities
├── tests/ # Test suites
├── docs/ # Documentation
└── scripts/ # Build & utility scripts
SRcode uses a Dual-Drive Architecture:
- CLI Mode — Interactive terminal with React/Ink UI
- MCP Mode — JSON-RPC server for Claude Desktop integration
Both modes share the same core business logic, tool system, and state management, achieving ~85% code reuse.
- Runtime: Bun + Node.js
- UI Framework: React + Ink
- Language: TypeScript (strict mode)
- AI Integration: OpenAI SDK + Anthropic SDK
- Protocol: Model Context Protocol (MCP)
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests (
bun test) - Commit your changes
- Push to the branch
- Create a Pull Request
Licensed under the Apache License 2.0. See LICENSE for details.
Star us on GitHub ⭐ | Join our Discord 💬 | Follow us 🐦