|
| 1 | +# Kilo Code CLI - Docker Guide |
| 2 | + |
| 3 | +A containerized version of the Kilo Code CLI with full browser automation support. |
| 4 | + |
| 5 | +## Quick Start Examples |
| 6 | + |
| 7 | +### Build the Image |
| 8 | + |
| 9 | +**Basic build** (no metadata required): |
| 10 | + |
| 11 | +```bash |
| 12 | +cd cli |
| 13 | +docker build -t kilocode/cli . |
| 14 | +``` |
| 15 | + |
| 16 | +**With build metadata** (optional, for production/CI): |
| 17 | + |
| 18 | +```bash |
| 19 | +docker build \ |
| 20 | + --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \ |
| 21 | + --build-arg VCS_REF=$(git rev-parse --short HEAD) \ |
| 22 | + --build-arg VERSION=$(jq -r '.version' package.json) \ |
| 23 | + -t kilocode/cli:$(jq -r '.version' package.json) \ |
| 24 | + -t kilocode/cli:latest \ |
| 25 | + . |
| 26 | +``` |
| 27 | + |
| 28 | +The build arguments are all optional and have defaults: |
| 29 | + |
| 30 | +- `BUILD_DATE` - defaults to empty string |
| 31 | +- `VCS_REF` - defaults to empty string |
| 32 | +- `VERSION` - defaults to "latest" |
| 33 | + |
| 34 | +### 1. Basic Interactive Mode |
| 35 | + |
| 36 | +Run the CLI interactively in your current directory: |
| 37 | + |
| 38 | +```bash |
| 39 | +docker run -it --rm -v $(pwd):/workspace kilocode/cli |
| 40 | +``` |
| 41 | + |
| 42 | +### 2. Architect Mode |
| 43 | + |
| 44 | +Start in architect mode for planning and design: |
| 45 | + |
| 46 | +```bash |
| 47 | +docker run -it --rm -v $(pwd):/workspace kilocode/cli --mode architect |
| 48 | +``` |
| 49 | + |
| 50 | +### 3. One-Shot Autonomous Mode |
| 51 | + |
| 52 | +Execute a single task and exit automatically: |
| 53 | + |
| 54 | +```bash |
| 55 | +docker run --rm -v $(pwd):/workspace kilocode/cli --auto "Run tests and fix any issues" |
| 56 | +``` |
| 57 | + |
| 58 | +### 4. With Local Configuration |
| 59 | + |
| 60 | +Mount your existing Kilo Code configuration to avoid setup prompts: |
| 61 | + |
| 62 | +```bash |
| 63 | +docker run -it --rm \ |
| 64 | + -v $(pwd):/workspace \ |
| 65 | + -v ~/.kilocode:/home/kilocode/.kilocode \ |
| 66 | + kilocode/cli |
| 67 | +``` |
| 68 | + |
| 69 | +--- |
| 70 | + |
| 71 | +## Additional Options |
| 72 | + |
| 73 | +### Custom Workspace Path |
| 74 | + |
| 75 | +```bash |
| 76 | +docker run -it --rm -v /path/to/project:/workspace kilocode/cli |
| 77 | +``` |
| 78 | + |
| 79 | +### Mount Git Configuration |
| 80 | + |
| 81 | +For commit operations: |
| 82 | + |
| 83 | +```bash |
| 84 | +docker run -it --rm \ |
| 85 | + -v $(pwd):/workspace \ |
| 86 | + -v ~/.kilocode:/home/kilocode/.kilocode \ |
| 87 | + -v ~/.gitconfig:/home/kilocode/.gitconfig:ro \ |
| 88 | + kilocode/cli |
| 89 | +``` |
| 90 | + |
| 91 | +### Environment Variables |
| 92 | + |
| 93 | +```bash |
| 94 | +docker run -it --rm \ |
| 95 | + -v $(pwd):/workspace \ |
| 96 | + -e KILOCODE_MODE=code \ |
| 97 | + kilocode/cli |
| 98 | +``` |
| 99 | + |
| 100 | +### With Timeout |
| 101 | + |
| 102 | +```bash |
| 103 | +docker run --rm \ |
| 104 | + -v $(pwd):/workspace \ |
| 105 | + kilocode/cli /usr/local/bin/kilocode --timeout 300 --auto "Run tests" |
| 106 | +``` |
| 107 | + |
| 108 | +## Configuration |
| 109 | + |
| 110 | +### Persistent Configuration |
| 111 | + |
| 112 | +The CLI stores configuration in `~/.kilocode/config.json`. You can: |
| 113 | + |
| 114 | +**Option 1: Mount local config** (recommended) |
| 115 | + |
| 116 | +```bash |
| 117 | +-v ~/.kilocode:/home/kilocode/.kilocode |
| 118 | +``` |
| 119 | + |
| 120 | +**Option 2: Use Docker volume for isolated config** |
| 121 | + |
| 122 | +```bash |
| 123 | +docker volume create kilocode-config |
| 124 | +docker run -it --rm \ |
| 125 | + -v $(pwd):/workspace \ |
| 126 | + -v kilocode-config:/home/kilocode/.kilocode \ |
| 127 | + kilocode/cli |
| 128 | +``` |
| 129 | + |
| 130 | +### Terminal Colors and Theme |
| 131 | + |
| 132 | +If you experience text visibility issues (text blending with background), you can: |
| 133 | + |
| 134 | +**Option 1: Set theme explicitly in config** |
| 135 | + |
| 136 | +Edit `~/.kilocode/config.json`: |
| 137 | + |
| 138 | +```json |
| 139 | +{ |
| 140 | + "theme": "dark" // or "light" for light terminals |
| 141 | +} |
| 142 | +``` |
| 143 | + |
| 144 | +**Option 2: Force color environment variables** |
| 145 | + |
| 146 | +```bash |
| 147 | +docker run -it --rm \ |
| 148 | + -v $(pwd):/workspace \ |
| 149 | + -e FORCE_COLOR=1 \ |
| 150 | + -e COLORTERM=truecolor \ |
| 151 | + kilocode/cli |
| 152 | +``` |
| 153 | + |
| 154 | +**Option 3: Pass terminal info** |
| 155 | + |
| 156 | +```bash |
| 157 | +docker run -it --rm \ |
| 158 | + -v $(pwd):/workspace \ |
| 159 | + -e TERM=$TERM \ |
| 160 | + kilocode/cli |
| 161 | +``` |
0 commit comments