Runtime Reference
The Kiwi Runtime — the bridge between cloud AI and your local machine.
Runtime Reference
The Kiwi Runtime (kiwi-runtime) connects the cloud AI to your local machine. It's the process that lets the AI read files, write code, run commands, and search your codebase — all on your machine.
Quick Start
# Default: restricted to current directory
kiwi-runtime connect
# Allow access to additional directories
kiwi-runtime connect --allow /tmp --allow /var/log
# Full filesystem access
kiwi-runtime connect --scope fullUsually automatic
When you launch the TUI with kiwi, the runtime starts automatically in the background. You only need to run kiwi-runtime directly when using the web dashboard or for advanced setups.
Options
| Flag | Description | Default |
|---|---|---|
--server | Server preset (app) or full URL | app |
--scope | restricted or full | restricted |
--allow PATH | Additional allowed directory (repeatable) | — |
--runID / --run-id | Pin to a specific run | — |
-w, --worktree NAME | Run in an isolated git worktree | — |
--token | Access token (used by TUI for shared auth) | — |
--email | Email for authentication | — |
--version | Show version and exit | — |
What the Runtime Can Do
When the runtime is connected, the AI can perform these operations on your machine:
Read & Search
- Read files — full content, specific line ranges, or grep within files
- Search across files — recursive search with glob patterns and context lines
- List directories — browse your project structure
- Get file info — size, permissions, timestamps
Write & Edit
- Create files — write new files with automatic parent directory creation
- Edit files — find-and-replace, line range replacement, insert at line, apply diffs
- Append to files — add content to existing files
- Large file support — chunked writing for files too large for a single message
Manage Files
- Move and rename files and directories
- Copy files and directories (recursive)
- Delete files and directories
- Create directories
Run Commands
- Shell commands — run any command with timeout protection and output streaming
- Interactive commands — PTY support for commands that need input (like
npm loginorgh auth login)
Scope Modes
Restricted (Default)
The AI can only access files in your current directory. This is the safe default.
kiwi-runtime connect --scope restrictedAdd specific directories with --allow:
kiwi-runtime connect --allow /tmp --allow ~/shared-configsFull
The AI can access any file on your system. Use when you need cross-project access.
kiwi-runtime connect --scope fullViewing Runtime Logs
See what the runtime is doing in real time:
- In the TUI: Press
Ctrl+Oor type/show-logs - Interactive input: Type directly in the logs screen when a command needs input
- Interrupt: Press
Ctrl+Kto stop a running command
Lifecycle
With the TUI
The TUI manages the runtime automatically:
- You launch
kiwi - The TUI spawns
kiwi-runtimein the background - The runtime connects to the backend
- When you send a message, the AI can execute commands through the runtime
- On exit, you're prompted to keep or stop running runtimes
Standalone (with Web Dashboard)
Run the runtime manually for browser-based access:
- You run
kiwi-runtime connect --scope full - The runtime connects and waits
- You open kiwicode.ai/autocode/new and ask the AI to connect
- The AI binds to your runtime and starts executing
Press Ctrl+C to disconnect.
Troubleshooting
Runtime not starting
Check authentication:
kiwi whoamiIf not authenticated, run kiwi login first.
"Permission denied" in restricted mode
Add the directory with --allow:
kiwi-runtime connect --allow /path/to/dirOr switch to full mode:
kiwi-runtime connect --scope fullInteractive command hangs
Open Runtime Logs (Ctrl+O) — the command may be waiting for your input. Type directly in the logs screen. Press Ctrl+K to interrupt.
WebSocket disconnects
The TUI automatically detects disconnects and respawns the runtime. For standalone runtimes, restart manually:
kiwi-runtime connect