Learn how to use Codebot from the command line to automate development tasks.
The codebot run command executes development tasks by:
- Cloning a repository into an isolated workspace
- Running Claude Code CLI to make changes
- Creating a pull request with the changes
codebot run --task-prompt-file task.yamlOr with inline JSON:
codebot run --task-prompt '{"repository_url": "https://github.com/user/repo.git", "description": "Add feature"}'Task prompts can be provided as YAML or JSON files, or as inline strings.
repository_url(string) - Git URL to clonedescription(string) - Task description for Claude Code CLI
ticket_id(string) - External ticket/issue ID (e.g., "PROJ-123")ticket_summary(string) - Short name for the ticket (e.g., "fix-login-bug")test_command(string) - Override auto-detected test commandbase_branch(string) - Branch to checkout from (default: auto-detect main/master)
Create a file task.yaml:
repository_url: https://github.com/user/repo.git
ticket_id: PROJ-123
ticket_summary: fix-login-bug
description: |
Fix the login authentication bug where users cannot log in
with special characters in passwords.
Ensure all tests pass.Run it:
codebot run --task-prompt-file task.yamlCreate a file task.json:
{
"repository_url": "https://github.com/user/repo.git",
"ticket_id": "PROJ-123",
"ticket_summary": "fix-login-bug",
"description": "Fix the login authentication bug where users cannot log in with special characters in passwords.\nEnsure all tests pass."
}Run it:
codebot run --task-prompt-file task.jsonFor quick tasks, use inline JSON:
codebot run --task-prompt '{
"repository_url": "https://github.com/user/repo.git",
"description": "Add dark mode support to the application"
}'Task prompt as JSON or YAML string.
codebot run --task-prompt '{"repository_url": "...", "description": "..."}'Path to task prompt file (JSON or YAML).
codebot run --task-prompt-file task.yamlBase directory for workspaces (default: ./codebot_workspace).
codebot run --task-prompt-file task.yaml --work-dir /tmp/codebotGitHub App authentication is required via environment variables. See Configuration Guide for setup instructions.
Required environment variables:
GITHUB_APP_ID- GitHub App IDGITHUB_APP_PRIVATE_KEY_PATH- Path to private key fileGITHUB_APP_INSTALLATION_ID- Installation ID
Enable verbose output for debugging.
codebot run --task-prompt-file task.yaml --verboseWhen you run a task, Codebot follows this workflow:
- Parse Task Prompt - Validates the task configuration
- Setup Environment - Creates isolated workspace and clones repository
- Check for CLAUDE.md - Looks for project-specific guidance
- Run Claude Code CLI - Executes AI agent with comprehensive system prompt
- Verify Commits - Ensures changes were committed
- Push Branch - Pushes the new branch to remote
- Create PR - Creates a pull request on GitHub
- Summary - Displays results and PR URL
Branches are automatically named using the format:
u/codebot/[TICKET-ID/]<uuid>/<short-name>
Examples:
u/codebot/abc1234/add-dark-modeu/codebot/PROJ-123/def5678/fix-login-bug
Where:
uuid- 7-character hash for uniquenessTICKET-ID- Optional ticket ID from task promptshort-name- Generated from ticket_summary or description
Work directories are named:
task_[TICKET-ID_]<uuid>
Examples:
task_abc1234task_PROJ-123_def5678
Claude Code CLI follows a senior engineer workflow:
- Read and understand the task description
- Come up with a plan - Break down into logical steps
- Implement the plan - Write clean, maintainable code
- Write tests - Create comprehensive tests
- Run all tests - Verify no regressions
- Commit changes - With clear, descriptive messages
If your repository has a CLAUDE.md or Agents.md file, Claude Code CLI will use it for:
- Test commands
- Environment setup instructions
- Code style guidelines
- Repository conventions
Example CLAUDE.md:
# Project Guidelines
## Testing
Run tests with: `npm test`
## Code Style
- Use TypeScript strict mode
- Follow Airbnb style guide
- Add JSDoc comments for public APIs
## Conventions
- Feature branches: `feature/description`
- Commit format: `type(scope): message`See the Examples Guide for more practical use cases.
For CLI issues, task failures, and other problems, see the Troubleshooting Guide.
- HTTP API Guide - Submit tasks programmatically
- Configuration Guide - Customize settings
- Examples - See more use cases