CodeWork
CLI

Reference

Every CodeWork CLI command, flag, and environment variable.

Run codework --help or codework <command> --help to see this from your terminal.

Commands

CommandWhat it does
codework run <prompt>Start or continue an agent session
codework modelsList the model catalog
codework models providersList provider IDs
codework models refreshDownload the model catalog if it’s stale
codework auth loginSign in to a subscription provider
codework auth statusShow a stored login without refreshing it
codework auth refreshRefresh a stored login if it has expired
codework auth logoutClear a stored login
codework plugin add <spec>Install a plugin and add it to a settings file
codework plugin remove <spec>Remove a plugin from a settings file
codework plugin installInstall every plugin the settings files name
codework plugin listList configured plugins and what each resolved to
codework plugin check [spec]Report plugins with a newer revision
codework plugin update [spec]Fetch newer revisions
codework plugin reloadRe-import plugins in a running server
codework session link <id>Anchor a session to a project folder, through a running server
codework tuiOpen the terminal UI, starting the background server if needed
codework service startStart the background server and print its URL
codework service restartRestart the background server and print its URL
codework service statusPrint the background server’s URL, or stopped
codework service stopStop the background server
codework serveStart the RPC server
codework acpStart the ACP server on stdio

codework run

FlagDescription
-s, --session <id>Continue an existing session
-C, --cwd <path>Working directory for a new session
--provider <id>Model catalog provider ID
--model <id>Model ID
--thinking <level>off, minimal, low, medium, high, xhigh, or max
--sandbox-driver <driver>Sandbox driver for a new session (default local)
--sandbox-id <id>Reuse an existing sandbox instance
--sandbox-provider-id <id>Attach to an existing remote sandbox by its provider ID
--server <url>Run against an RPC server, e.g. ws://127.0.0.1:7433/rpc/v1

codework auth

FlagDescription
--openai-codexUse OpenAI Codex (ChatGPT Plus or Pro)
--github-copilotUse GitHub Copilot
--devicelogin only: use a device code instead of a local browser callback
--browserlogin only: open the sign-in URL in your browser (default on)
--enterprise <host>login only: GitHub Enterprise domain for Copilot
--enable-modelslogin only: enable unconfigured Copilot catalog models
--auth-file <path>Credential file (default <home>/aikit/auth.json)
--server <url>Store the credentials in a running RPC server
--jsonMachine-readable output

codework plugin

FlagApplies toDescription
-g, --globaladd, removeEdit the user-wide settings file instead of this project’s
--session <id>addWrite to the project a session is linked to
--verboselistShow the message behind a failure
--refreshcheckAsk the registry again instead of reusing a recent answer
--server <url>reloadServer base URL (default http://127.0.0.1:7433)

codework models

FlagApplies toDescription
--provider <id>modelsList only this provider’s models
--forcerefreshDownload the catalog even if it’s fresh

codework tui and codework service

codework tui reuses the background server named in <home>/service.json, or starts one, then connects the terminal UI to it. The server keeps running after the UI exits; codework service stop stops it. A server from an older CLI version is replaced. Its log is <home>/log/server.log.

FlagApplies toDescription
--hosttui, start, restartInterface a new background server binds (default 127.0.0.1)
--porttui, start, restartPort a new background server listens on (default 7433)
--server <url>tuiUse this RPC server instead of the background server

codework serve

FlagDescription
--hostInterface to bind (default 127.0.0.1)
--portPort to listen on, or 0 for any free port (default 7433)
--serviceRun as the background server, logging to <home>/log/server.log

Global Flags

These work on every command that runs CodeWork locally, including run, serve, and acp.

FlagDescription
--homeCodeWork home for settings, credentials, cache and data (default ~/.codework)
--databaseSQLite database path, or :memory: for throwaway sessions
--user-config-dirDirectory whose settings.jsonc replaces the user settings in --home

Environment Variables

VariableDescription
CODEWORK_MODELS_FILEPin the model catalog to a file you manage
CODEWORK_MODELS_TTLHow old the catalog may get before a refresh (default 15 minutes)
OPENAI_API_KEYOpenAI API key
ANTHROPIC_API_KEYAnthropic API key
OPENROUTER_API_KEYOpenRouter API key
GEMINI_API_KEYGoogle Gemini API key
XAI_API_KEYxAI API key

Settings files are covered in the settings reference.