Skip to content
New Kodine v2 is now available

CLI

Commands and options for the Kodine CLI.

Run the Kodine CLI with no arguments and it launches the TUI.

Terminal window
kodine

It also takes the commands documented on this page, which is how you drive Kodine programmatically.

Terminal window
kodine run "Explain how closures work in JavaScript"

tui

Launches Kodine’s terminal user interface.

Terminal window
kodine [project]

Flags

FlagShortDescription
--continue-cPick up the most recent session
--session-sID of the session to pick up
--forkFork the session while continuing (pair with --continue or --session)
--promptPrompt to start with
--model-mModel, written as provider/model
--agentAgent to run
--autoAutomatically approve permissions that aren’t explicitly denied
--portPort to listen on
--hostnameHostname to listen on
--mdnsTurn on mDNS discovery
--mdns-domainCustom mDNS domain name
--corsExtra browser origin(s) to allow via CORS

Commands

Below are the commands the Kodine CLI offers.


agent

Manage Kodine agents.

Terminal window
kodine agent [command]

create

Scaffold a new agent with custom configuration.

Terminal window
kodine agent create

The command walks you through building an agent with its own system prompt and permission setup. In the generated frontmatter, anything you didn’t allow ends up denied.

Flags

FlagShortDescription
--pathWhere to write the agent file (defaults to the global location or .kodine/agent, depending on the prompt)
--descriptionWhat the agent should do
--modeAgent mode: all, primary, or subagent
--permissionsComma-separated permissions to allow (default: all). Available: bash, read, edit, glob, grep, webfetch, task, todowrite, websearch, lsp, skill. Anything omitted is denied. Alias: --tools
--model-mModel, in provider/model format

Supplying --path, --description, --mode, and --permissions together makes the command run without prompting.


list

Print every available agent.

Terminal window
kodine agent list

attach

Connect a terminal to a Kodine backend server that’s already running (started with serve or web).

Terminal window
kodine attach [url]

That’s how you use the TUI against a remote Kodine backend. For example:

Terminal window
# Spin up the backend server for web/mobile access
kodine web --port 4096 --hostname 0.0.0.0
# From a second terminal, attach the TUI to the running backend
kodine attach http://10.20.30.40:4096

Flags

FlagShortDescription
--dirWorking directory the TUI starts in
--continue-cPick up the most recent session
--session-sID of the session to pick up
--forkFork the session while continuing (pair with --continue or --session)
--password-pBasic auth password (falls back to KODINE_SERVER_PASSWORD)
--username-uBasic auth username (falls back to KODINE_SERVER_USERNAME or kodine)

auth

Manage provider credentials and logins.

Terminal window
kodine auth [command]

login

Kodine draws its provider list from Models.dev, so kodine auth login can set up API keys for whichever provider you want to use. Credentials live in ~/.local/share/kodine/auth.json.

Terminal window
kodine auth login

At startup, Kodine reads providers from that credentials file, plus any keys present in your environment or in a project .env file.

Flags
FlagShortDescription
--provider-pID or name of the provider to log in to
--method-mLabel of the login method to use, skipping the method picker

list

Print every authenticated provider found in the credentials file.

Terminal window
kodine auth list

Or the short form.

Terminal window
kodine auth ls

logout

Sign out of a provider by removing it from the credentials file.

Terminal window
kodine auth logout

github

Manage the GitHub agent used for repository automation.

Terminal window
kodine github [command]

install

Set up the GitHub agent in a repository.

Terminal window
kodine github install

This creates the required GitHub Actions workflow and walks you through configuration. Learn more.


run

Execute the GitHub agent — normally from inside GitHub Actions.

Terminal window
kodine github run
Flags
FlagDescription
--eventGitHub mock event the agent should run for
--tokenGitHub personal access token

mcp

Manage Model Context Protocol servers.

Terminal window
kodine mcp [command]

add

Register an MCP server in your configuration.

Terminal window
kodine mcp add

The command walks you through connecting either a local or a remote MCP server.


list

Show every configured MCP server along with its connection status.

Terminal window
kodine mcp list

Or the short form.

Terminal window
kodine mcp ls

auth

Sign in to an OAuth-enabled MCP server.

Terminal window
kodine mcp auth [name]

Without a server name, you’ll get a picker listing the OAuth-capable servers.

You can also view OAuth-capable servers together with their auth status.

Terminal window
kodine mcp auth list

Or the short form.

Terminal window
kodine mcp auth ls

logout

Delete OAuth credentials for an MCP server.

Terminal window
kodine mcp logout [name]

debug

Troubleshoot OAuth connection problems for an MCP server.

Terminal window
kodine mcp debug <name>

models

Print every model offered by your configured providers.

Terminal window
kodine models [provider]

Output covers all configured providers and is written in the provider/model format.

Handy for finding the exact model identifier to put in your config.

Pass a provider ID to narrow the list down to that provider.

Terminal window
kodine models anthropic

Flags

FlagDescription
--refreshRe-fetch the models cache from models.dev
--verbosePrint richer model output, including metadata such as costs

Reach for --refresh when the cached model list needs updating — for example after a provider adds new models that Kodine should see.

Terminal window
kodine models --refresh

run

Run Kodine non-interactively by handing it a prompt directly.

Terminal window
kodine run [message..]

Great for scripts, automation, or quick answers where spinning up the full TUI would be overkill. For example.

Terminal window
kodine run Explain the use of context in Go

Attaching to a running kodine serve instance also avoids paying MCP server cold-start time on each run:

Terminal window
# Spin up a headless server in one terminal
kodine serve
# From another terminal, run commands against it
kodine run --attach http://localhost:4096 "Explain async/await in JavaScript"

Flags

FlagShortDescription
--commandCommand to execute; the message becomes its args
--continue-cPick up the most recent session
--session-sID of the session to pick up
--forkFork the session while continuing (pair with --continue or --session)
--shareShare the session
--model-mModel, written as provider/model
--agentAgent to run
--file-fFile(s) to attach to the message
--formatFormat: default (formatted) or json (raw JSON events)
--titleSession title (falls back to a truncated prompt when omitted)
--attachAttach to a running kodine server (e.g., http://localhost:4096)
--password-pBasic auth password (falls back to KODINE_SERVER_PASSWORD)
--username-uBasic auth username (falls back to KODINE_SERVER_USERNAME or kodine)
--dirDirectory to run in, or a path on the remote server when attaching
--portPort for the local server (random by default)
--variantModel variant (provider-specific reasoning effort)
--thinkingShow thinking blocks
--autoAutomatically approve permissions that aren’t explicitly denied

serve

Launch a headless Kodine server for API access. The server docs describe the full HTTP interface.

Terminal window
kodine serve

This brings up an HTTP server exposing Kodine’s functionality without the TUI. Set KODINE_SERVER_PASSWORD to turn on HTTP basic auth (the username defaults to kodine).

Flags

FlagDescription
--portPort to listen on
--hostnameHostname to listen on
--mdnsTurn on mDNS discovery
--mdns-domainCustom mDNS domain name
--corsExtra browser origin(s) to allow via CORS

session

Manage Kodine sessions.

Terminal window
kodine session [command]

list

Print every Kodine session.

Terminal window
kodine session list
Flags
FlagShortDescription
--max-count-nCap output at the N most recent sessions
--formatOutput format: table or json (table)

delete

Remove a Kodine session.

Terminal window
kodine session delete <sessionID>

stats

Print token usage and cost stats across your Kodine sessions.

Terminal window
kodine stats

Flags

FlagDescription
--daysLimit stats to the last N days (all time)
--toolsHow many tools to show (all)
--modelsShow the model usage breakdown (hidden unless requested). Pass a number for the top N
--projectFilter by project (all projects, empty string: current project)

export

Write session data out as JSON.

Terminal window
kodine export [sessionID]

Without a session ID, you’ll get a picker of available sessions.

Flags

FlagDescription
--sanitizeStrip sensitive transcript/file data

import

Load session data from a JSON file or a Kodine share URL.

Terminal window
kodine import <file>

Both local files and Kodine share URLs work as sources.

Terminal window
kodine import session.json
kodine import https://kodine.net/s/abc123

web

Launch a headless Kodine server that serves a web interface.

Terminal window
kodine web

This brings up an HTTP server and opens a browser so you can use Kodine through the web UI. Set KODINE_SERVER_PASSWORD to turn on HTTP basic auth (the username defaults to kodine).

Flags

FlagDescription
--portPort to listen on
--hostnameHostname to listen on
--mdnsTurn on mDNS discovery
--mdns-domainCustom mDNS domain name
--corsExtra browser origin(s) to allow via CORS

acp

Launch an ACP (Agent Client Protocol) server.

Terminal window
kodine acp

The ACP server talks over stdin/stdout using nd-JSON.

Flags

FlagDescription
--cwdWorking directory
--portPort to listen on
--hostnameHostname to listen on
--mdnsTurn on mDNS discovery
--mdns-domainCustom mDNS domain name
--corsExtra browser origin(s) to allow via CORS

plugin

Install a plugin and update your config.

Terminal window
kodine plugin <module>

Or via the alias.

Terminal window
kodine plug <module>

Flags

FlagShortDescription
--global-gInstall into the global config
--force-fOverwrite an existing plugin version

pr

Check out a GitHub PR branch and launch Kodine on it.

Terminal window
kodine pr <number>

db

Database utilities.

Terminal window
kodine db [query]

Flags

FlagDescription
--formatOutput format: json or tsv

path

Print where the database lives.

Terminal window
kodine db path

debug

Tools for debugging and troubleshooting.

Terminal window
kodine debug [command]

uninstall

Remove Kodine along with its related files.

Terminal window
kodine uninstall

Flags

FlagShortDescription
--keep-config-cLeave configuration files in place
--keep-data-dLeave session data and snapshots in place
--dry-runPrint what would be removed, without removing it
--force-fDon’t ask for confirmation

upgrade

Bring Kodine up to the newest version, or to one you choose.

Terminal window
kodine upgrade [target]

Upgrade to the newest version.

Terminal window
kodine upgrade

Upgrade to a chosen version.

Terminal window
kodine upgrade v0.1.48

Flags

FlagShortDescription
--method-mHow it was installed: curl, npm, pnpm, bun, brew

Global Flags

These global flags work on the kodine CLI itself.

FlagShortDescription
--help-hShow help
--version-vPrint the version number
--print-logsWrite logs to stderr
--log-levelLog level (DEBUG, INFO, WARN, ERROR)
--pureRun with external plugins disabled

Environment variables

Environment variables offer another way to configure Kodine.

VariableTypeDescription
KODINE_AUTO_SHAREbooleanShare sessions automatically
KODINE_GIT_BASH_PATHstringWhere the Git Bash executable lives on Windows
KODINE_CONFIGstringPath to the config file
KODINE_TUI_CONFIGstringPath to the TUI config file
KODINE_CONFIG_DIRstringPath to the config directory
KODINE_CONFIG_CONTENTstringInline JSON config content
KODINE_DISABLE_AUTOUPDATEbooleanTurn off automatic update checks
KODINE_DISABLE_PRUNEbooleanTurn off pruning of old data
KODINE_DISABLE_TERMINAL_TITLEbooleanTurn off automatic terminal title updates
KODINE_PERMISSIONstringInline JSON permissions config
KODINE_DISABLE_DEFAULT_PLUGINSbooleanTurn off default plugins
KODINE_DISABLE_LSP_DOWNLOADbooleanTurn off automatic LSP server downloads
KODINE_ENABLE_EXPERIMENTAL_MODELSbooleanTurn on experimental models
KODINE_DISABLE_AUTOCOMPACTbooleanTurn off automatic context compaction
KODINE_DISABLE_CLAUDE_CODEbooleanStop reading from .claude (prompt + skills)
KODINE_DISABLE_CLAUDE_CODE_PROMPTbooleanStop reading ~/.claude/CLAUDE.md
KODINE_DISABLE_CLAUDE_CODE_SKILLSbooleanStop loading .claude/skills
KODINE_DISABLE_MODELS_FETCHbooleanStop fetching models from remote sources
KODINE_DISABLE_MOUSEbooleanTurn off mouse capture in the TUI
KODINE_FAKE_VCSstringFake VCS provider for testing purposes
KODINE_CLIENTstringClient identifier (defaults to cli)
KODINE_ENABLE_EXAbooleanTurn on Exa web search tools
KODINE_ENABLE_PARALLELbooleanTurn on Parallel web search tools
KODINE_SERVER_PASSWORDstringTurn on basic auth for serve/web
KODINE_SERVER_USERNAMEstringOverride the basic auth username (default kodine)
KODINE_MODELS_URLstringCustom URL for fetching model configuration

Experimental

These variables switch on experimental features that may change or disappear.

VariableTypeDescription
KODINE_EXPERIMENTALbooleanMaster switch for experimental features
KODINE_EXPERIMENTAL_ICON_DISCOVERYbooleanTurn on icon discovery
KODINE_EXPERIMENTAL_DISABLE_COPY_ON_SELECTbooleanTurn off copy-on-select in the TUI
KODINE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MSnumberDefault bash command timeout, in ms
KODINE_EXPERIMENTAL_OUTPUT_TOKEN_MAXnumberCap on output tokens for LLM responses
KODINE_EXPERIMENTAL_FILEWATCHERbooleanTurn on the file watcher for the whole directory
KODINE_EXPERIMENTAL_OXFMTbooleanTurn on the oxfmt formatter
KODINE_EXPERIMENTAL_LSP_TOOLbooleanTurn on the experimental LSP tool
KODINE_EXPERIMENTAL_DISABLE_FILEWATCHERbooleanTurn off the file watcher
KODINE_EXPERIMENTAL_EXAbooleanTurn on experimental Exa features
KODINE_EXPERIMENTAL_LSP_TYbooleanTurn on the TY LSP for Python files
KODINE_EXPERIMENTAL_PLAN_MODEbooleanTurn on plan mode
KODINE_EXPERIMENTAL_BACKGROUND_SUBAGENTSbooleanTurn on background subagent tasks
KODINE_EXPERIMENTAL_EVENT_SYSTEMbooleanTurn on the experimental event system
KODINE_EXPERIMENTAL_NATIVE_LLMbooleanTurn on the native LLM request path
KODINE_EXPERIMENTAL_PARALLELbooleanTurn on parallel web search execution
KODINE_EXPERIMENTAL_SCOUTbooleanTurn on the Scout subagent
KODINE_EXPERIMENTAL_WORKSPACESbooleanTurn on workspace support