CodeWork
CLI

CodeWork CLI

Run CodeWork from your terminal, editor, or a server.

The codework CLI runs agent sessions and manages models, plugins, and MCP servers. It also powers the other interfaces: codework acp for editors and codework serve for the RPC server.

Getting started

pnpm add -g @codeworksh/cli

Then, from your project folder:

codework run "Explain how this repository is structured"

See Installation for requirements, signing in, and updates.

Running a prompt

codework run sends one prompt, streams the answer, and exits when the run is done. It prints the session ID first and the model, tokens, and cost last. Pass --cwd to start somewhere other than the current directory.

Pick a model with --provider and --model, and reasoning effort with --thinking:

codework run --provider openrouter --model deepseek/deepseek-v4.1-flash --thinking medium "Plan the database migration"

Browse models with codework models, and see Models to connect a provider.

Press Ctrl+C to stop a run. codework serve won’t resume a run you stopped.

Continuing a session

Pass the session ID to send another prompt to the same session:

codework run --session <id> "Now write the migration"

A session can have more than one thread, each a separate conversation. codework thread list <id> shows them, and --thread <thread-id> continues one. Without --thread, run continues the main thread.

Every command and flag is in the CLI reference.