🐶✨The sassy AI code agent that makes IDEs look outdated ✨🐶
⭐ Star this repo if you hate expensive IDEs! ⭐
"Who needs an IDE when you have 1024 angry puppies?" - Someone, probably.
This project was coded angrily in reaction to Windsurf and Cursor removing access to models and raising prices.
You could also run 50 code puppies at once if you were insane enough.
Would you rather plow a field with one ox or 1024 puppies? - If you pick the ox, better slam that back button in your browser.
Code Puppy is an AI-powered code generation agent, designed to understand programming tasks, generate high-quality code, and explain its reasoning similar to tools like Windsurf and Cursor.
uvx code-puppy -i# Install UV if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh
# Set UV to always use managed Python (one-time setup)
echo 'export UV_MANAGED_PYTHON=1' >> ~/.zshrc # or ~/.bashrc
source ~/.zshrc # or ~/.bashrc
# Install and run code-puppy
uvx code-puppy -iUV will automatically download the latest compatible Python version (3.11+) if your system doesn't have one.
pip install code-puppyNote: pip installation requires your system Python to be 3.11 or newer.
To make UV always use managed Python versions (recommended):
# Set environment variable permanently
echo 'export UV_MANAGED_PYTHON=1' >> ~/.zshrc # or ~/.bashrc
source ~/.zshrc # or ~/.bashrc
# Now all UV commands will prefer managed Python installations
uvx code-puppy # No need for --managed-python flag anymore# Check which Python UV will use
uv python find
# Or check the current project's Python
uv run python --versionCreate markdown files in .claude/commands/, .github/prompts/, or .agents/commands/ to define custom slash commands. The filename becomes the command name and the content runs as a prompt.
# Create a custom command
echo "# Code Review
Please review this code for security issues." > .claude/commands/review.md
# Use it in Code Puppy
/review with focus on authenticationexport MODEL_NAME=gpt-5 # or gemini-2.5-flash-preview-05-20 as an example for Google Gemini models
export OPENAI_API_KEY=<your_openai_api_key> # or GEMINI_API_KEY for Google Gemini models
export CEREBRAS_API_KEY=<your_cerebras_api_key> # for Cerebras models
export SYN_API_KEY=<your https://dev.synthetic.new api key> # for Synthetic provider
# or ...
export AZURE_OPENAI_API_KEY=...
export AZURE_OPENAI_ENDPOINT=...
code-puppy --interactiveCode Puppy supports the Synthetic provider, which gives you access to various open-source models through a custom OpenAI-compatible endpoint. Set SYN_API_KEY to use models like:
synthetic-DeepSeek-V3.1-Terminus(128K context)synthetic-Kimi-K2-Instruct-0905(256K context)synthetic-Qwen3-Coder-480B-A35B-Instruct(256K context)synthetic-GLM-4.6(200K context)
These models are available via https://api.synthetic.new/openai/v1/ and provide high-quality coding assistance with generous context windows.
Run specific tasks or engage in interactive mode:
# Execute a task directly
code-puppy "write me a C++ hello world program in /tmp/main.cpp then compile it and run it"Code Puppy now supports DBOS durable execution.
When enabled, every agent is automatically wrapped as a DBOSAgent, checkpointing key interactions (including agent inputs, LLM responses, MCP calls, and tool calls) in a database for durability and recovery.
You can toggle DBOS via either of these options:
- CLI config (persists):
/set enable_dbos true(orfalseto disable)
Config takes precedence if set; otherwise the environment variable is used.
The following environment variables control DBOS behavior:
DBOS_CONDUCTOR_KEY: If set, Code Puppy connects to the DBOS Management Console. Make sure you first register an app nameddbos-code-puppyon the console to generate a Conductor key. Default:None.DBOS_LOG_LEVEL: Logging verbosity:CRITICAL,ERROR,WARNING,INFO, orDEBUG. Default:ERROR.DBOS_SYSTEM_DATABASE_URL: Database URL used by DBOS. Can point to a local SQLite file or a Postgres instance. Example:postgresql://postgres:dbos@localhost:5432/postgres. Default:dbos_store.sqlitefile in the config directory.DBOS_APP_VERSION: If set, Code Puppy uses it as the DBOS application version and automatically tries to recover pending workflows for this version. Default: Code Puppy version + Unix timestamp in millisecond (disable automatic recovery).
- Python 3.11+
- OpenAI API key (for GPT models)
- Gemini API key (for Google's Gemini models)
- Cerebras API key (for Cerebras models)
- Anthropic key (for Claude models)
- Ollama endpoint available
This project is licensed under the MIT License - see the LICENSE file for details.
We support AGENT.md files for defining coding standards and styles that your code should comply with. These rules can cover various aspects such as formatting, naming conventions, and even design guidelines.
For examples and more information about agent rules, visit https://agent.md
Use the /mcp command to manage MCP (list, start, stop, status, etc.)
In the TUI you can click on MCP settings on the footer and interact with a mini-marketplace.
Watch this video for examples! https://www.youtube.com/watch?v=1t1zEetOqlo
Code Puppy supports Round Robin model distribution to help you overcome rate limits and distribute load across multiple AI models. This feature automatically cycles through configured models with each request, maximizing your API usage while staying within rate limits.
Add a round-robin model configuration to your ~/.code_puppy/extra_models.json file:
export CEREBRAS_API_KEY1=csk-...
export CEREBRAS_API_KEY2=csk-...
export CEREBRAS_API_KEY3=csk-...
{
"qwen1": {
"type": "cerebras",
"name": "qwen-3-coder-480b",
"custom_endpoint": {
"url": "https://api.cerebras.ai/v1",
"api_key": "$CEREBRAS_API_KEY1"
},
"context_length": 131072
},
"qwen2": {
"type": "cerebras",
"name": "qwen-3-coder-480b",
"custom_endpoint": {
"url": "https://api.cerebras.ai/v1",
"api_key": "$CEREBRAS_API_KEY2"
},
"context_length": 131072
},
"qwen3": {
"type": "cerebras",
"name": "qwen-3-coder-480b",
"custom_endpoint": {
"url": "https://api.cerebras.ai/v1",
"api_key": "$CEREBRAS_API_KEY3"
},
"context_length": 131072
},
"cerebras_round_robin": {
"type": "round_robin",
"models": ["qwen1", "qwen2", "qwen3"],
"rotate_every": 5
}
}Then just use /model and tab to select your round-robin model!
The rotate_every parameter controls how many requests are made to each model before rotating to the next one. In this example, the round-robin model will use each Qwen model for 5 consecutive requests before moving to the next model in the sequence.
Code Puppy features a flexible agent system that allows you to work with specialized AI assistants tailored for different coding tasks. The system supports both built-in Python agents and custom JSON agents that you can create yourself.
/agentShows current active agent and all available agents
/agent <agent-name>Switches to the specified agent
/agent agent-creatorSwitches to the Agent Creator for building custom agents
/truncate <N>Truncates the message history to keep only the N most recent messages while protecting the first (system) message. For example:
/truncate 20Would keep the system message plus the 19 most recent messages, removing older ones from the history.
This is useful for managing context length when you have a long conversation history but only need the most recent interactions.
- Name:
code-puppy - Specialty: General-purpose coding assistant
- Personality: Playful, sarcastic, pedantic about code quality
- Tools: Full access to all tools
- Best for: All coding tasks, file management, execution
- Principles: Clean, concise code following YAGNI, SRP, DRY principles
- File limit: Max 600 lines per file (enforced!)
- Name:
agent-creator - Specialty: Creating custom JSON agent configurations
- Tools: File operations, reasoning
- Best for: Building new specialized agents
- Features: Schema validation, guided creation process
Built-in agents implemented in Python with full system integration:
- Discovered automatically from
code_puppy/agents/directory - Inherit from
BaseAgentclass - Full access to system internals
- Examples:
code-puppy,agent-creator
User-created agents defined in JSON files:
- Stored in user's agents directory
- Easy to create, share, and modify
- Schema-validated configuration
- Custom system prompts and tool access
-
Switch to Agent Creator:
/agent agent-creator
-
Request agent creation:
I want to create a Python tutor agent -
Follow guided process to define:
- Name and description
- Available tools
- System prompt and behavior
- Custom settings
-
Test your new agent:
/agent your-new-agent-name
Create JSON files in your agents directory following this schema:
{
"name": "agent-name", // REQUIRED: Unique identifier (kebab-case)
"display_name": "Agent Name 🤖", // OPTIONAL: Pretty name with emoji
"description": "What this agent does", // REQUIRED: Clear description
"system_prompt": "Instructions...", // REQUIRED: Agent instructions
"tools": ["tool1", "tool2"], // REQUIRED: Array of tool names
"user_prompt": "How can I help?", // OPTIONAL: Custom greeting
"tools_config": { // OPTIONAL: Tool configuration
"timeout": 60
}
}name: Unique identifier (kebab-case, no spaces)description: What the agent doessystem_prompt: Agent instructions (string or array)tools: Array of available tool names
display_name: Pretty display name (defaults to title-cased name + 🤖)user_prompt: Custom user greetingtools_config: Tool configuration object
Agents can access these tools based on their configuration:
list_files: Directory and file listingread_file: File content readinggrep: Text search across filesedit_file: File editing and creationdelete_file: File deletionagent_run_shell_command: Shell command executionagent_share_your_reasoning: Share reasoning with user
- Read-only agent:
["list_files", "read_file", "grep"] - File editor agent:
["list_files", "read_file", "edit_file"] - Full access agent: All tools (like Code-Puppy)
{
"system_prompt": "You are a helpful coding assistant that specializes in Python development."
}{
"system_prompt": [
"You are a helpful coding assistant.",
"You specialize in Python development.",
"Always provide clear explanations.",
"Include practical examples in your responses."
]
}{
"name": "python-tutor",
"display_name": "Python Tutor 🐍",
"description": "Teaches Python programming concepts with examples",
"system_prompt": [
"You are a patient Python programming tutor.",
"You explain concepts clearly with practical examples.",
"You help beginners learn Python step by step.",
"Always encourage learning and provide constructive feedback."
],
"tools": ["read_file", "edit_file", "agent_share_your_reasoning"],
"user_prompt": "What Python concept would you like to learn today?"
}{
"name": "code-reviewer",
"display_name": "Code Reviewer 🔍",
"description": "Reviews code for best practices, bugs, and improvements",
"system_prompt": [
"You are a senior software engineer doing code reviews.",
"You focus on code quality, security, and maintainability.",
"You provide constructive feedback with specific suggestions.",
"You follow language-specific best practices and conventions."
],
"tools": ["list_files", "read_file", "grep", "agent_share_your_reasoning"],
"user_prompt": "Which code would you like me to review?"
}{
"name": "devops-helper",
"display_name": "DevOps Helper ⚙️",
"description": "Helps with Docker, CI/CD, and deployment tasks",
"system_prompt": [
"You are a DevOps engineer specialized in containerization and CI/CD.",
"You help with Docker, Kubernetes, GitHub Actions, and deployment.",
"You provide practical, production-ready solutions.",
"You always consider security and best practices."
],
"tools": [
"list_files",
"read_file",
"edit_file",
"agent_run_shell_command",
"agent_share_your_reasoning"
],
"user_prompt": "What DevOps task can I help you with today?"
}- All platforms:
~/.code_puppy/agents/
- Built-in:
code_puppy/agents/(in package)
- Use kebab-case (hyphens, not spaces)
- Be descriptive: "python-tutor" not "tutor"
- Avoid special characters
- Be specific about the agent's role
- Include personality traits
- Specify output format preferences
- Use array format for multi-line prompts
- Only include tools the agent actually needs
- Most agents need
agent_share_your_reasoning - File manipulation agents need
read_file,edit_file - Research agents need
grep,list_files
- Include relevant emoji for personality
- Make it friendly and recognizable
- Keep it concise
The system automatically discovers agents by:
- Python Agents: Scanning
code_puppy/agents/for classes inheriting fromBaseAgent - JSON Agents: Scanning user's agents directory for
*-agent.jsonfiles - Instantiating and registering discovered agents
JSON agents are powered by the JSONAgent class (code_puppy/agents/json_agent.py):
- Inherits from
BaseAgentfor full system integration - Loads configuration from JSON files with robust validation
- Supports all BaseAgent features (tools, prompts, settings)
- Cross-platform user directory support
- Built-in error handling and schema validation
Both Python and JSON agents implement this interface:
name: Unique identifierdisplay_name: Human-readable name with emojidescription: Brief description of purposeget_system_prompt(): Returns agent-specific system promptget_available_tools(): Returns list of tool names
The agent_manager.py provides:
- Unified registry for both Python and JSON agents
- Seamless switching between agent types
- Configuration persistence across sessions
- Automatic caching for performance
- Command Interface:
/agentcommand works with all agent types - Tool Filtering: Dynamic tool access control per agent
- Main Agent System: Loads and manages both agent types
- Cross-Platform: Consistent behavior across all platforms
To create a new Python agent:
- Create file in
code_puppy/agents/(e.g.,my_agent.py) - Implement class inheriting from
BaseAgent - Define required properties and methods
- Agent will be automatically discovered
Example implementation:
from .base_agent import BaseAgent
class MyCustomAgent(BaseAgent):
@property
def name(self) -> str:
return "my-agent"
@property
def display_name(self) -> str:
return "My Custom Agent ✨"
@property
def description(self) -> str:
return "A custom agent for specialized tasks"
def get_system_prompt(self) -> str:
return "Your custom system prompt here..."
def get_available_tools(self) -> list[str]:
return [
"list_files",
"read_file",
"grep",
"edit_file",
"delete_file",
"agent_run_shell_command",
"agent_share_your_reasoning"
]- Ensure JSON file is in correct directory
- Check JSON syntax is valid
- Restart Code Puppy or clear agent cache
- Verify filename ends with
-agent.json
- Use Agent Creator for guided validation
- Check all required fields are present
- Verify tool names are correct
- Ensure name uses kebab-case
- Make sure agents directory is writable
- Check file permissions on JSON files
- Verify directory path exists
{
"tools_config": {
"timeout": 120,
"max_retries": 3
}
}{
"system_prompt": [
"Line 1 of instructions",
"Line 2 of instructions",
"Line 3 of instructions"
]
}The agent system supports future expansion:
- Specialized Agents: Code reviewers, debuggers, architects
- Domain-Specific Agents: Web dev, data science, DevOps, mobile
- Personality Variations: Different communication styles
- Context-Aware Agents: Adapt based on project type
- Team Agents: Shared configurations for coding standards
- Plugin System: Community-contributed agents
- Easy Customization: Create agents without Python knowledge
- Team Sharing: JSON agents can be shared across teams
- Rapid Prototyping: Quick agent creation for specific workflows
- Version Control: JSON agents are git-friendly
- Built-in Validation: Schema validation with helpful error messages
- Cross-Platform: Works consistently across all platforms
- Backward Compatible: Doesn't affect existing Python agents
- Core Implementation:
code_puppy/agents/json_agent.py - Agent Discovery: Integrated in
code_puppy/agents/agent_manager.py - Command Interface: Works through existing
/agentcommand - Testing: Comprehensive test suite in
tests/test_json_agents.py
- System scans
~/.code_puppy/agents/for*-agent.jsonfiles JSONAgentclass loads and validates each JSON configuration- Agents are registered in unified agent registry
- Users can switch to JSON agents via
/agent <name>command - Tool access and system prompts work identically to Python agents
- Invalid JSON syntax: Clear error messages with line numbers
- Missing required fields: Specific field validation errors
- Invalid tool names: Warning with list of available tools
- File permission issues: Helpful troubleshooting guidance
- Agent Templates: Pre-built JSON agents for common tasks
- Visual Editor: GUI for creating JSON agents
- Hot Reloading: Update agents without restart
- Agent Marketplace: Share and discover community agents
- Enhanced Validation: More sophisticated schema validation
- Team Agents: Shared configurations for coding standards
- Create and test your agent thoroughly
- Ensure it follows best practices
- Submit a pull request with agent JSON
- Include documentation and examples
- Test across different platforms
- Follow existing code style
- Include comprehensive tests
- Document the agent's purpose and usage
- Submit pull request for review
- Ensure backward compatibility
Consider contributing agent templates for:
- Code reviewers and auditors
- Language-specific tutors
- DevOps and deployment helpers
- Documentation writers
- Testing specialists
Zero-compromise privacy policy. Always.
Unlike other Agentic Coding software, there is no corporate or investor backing for this project, which means zero pressure to compromise our principles for profit. This isn't just a nice-to-have feature – it's fundamental to the project's DNA.
- ❌ Zero telemetry – no usage analytics, crash reports, or behavioral tracking
- ❌ Zero prompt logging – your code, conversations, or project details are never stored
- ❌ Zero behavioral profiling – we don't track what you build, how you code, or when you use the tool
- ❌ Zero third-party data sharing – your information is never sold, traded, or given away
- LLM Provider Communication: Your prompts are sent directly to whichever LLM provider you've configured (OpenAI, Anthropic, local models, etc.) – this is unavoidable for AI functionality
- Complete Local Option: Run your own VLLM/SGLang/Llama.cpp server locally → zero data leaves your network. Configure this with
~/.code_puppy/extra_models.json - Direct Developer Contact: All feature requests, bug reports, and discussions happen directly with me – no middleman analytics platforms or customer data harvesting tools
Code Puppy is designed with privacy-by-design principles. Every feature has been evaluated through a privacy lens, and every integration respects user data sovereignty. When you use Code Puppy, you're not the product – you're just a developer getting things done.
This commitment is enforceable because it's structurally impossible to violate it. No external pressures, no investor demands, no quarterly earnings targets to hit. Just solid code that respects your privacy.
