Skip to main content
workser is the command line at the centre of Workser Code. It’s what your AI agent runs — through its own shell — to act as your DevOps engineer: provision a database, set an environment variable, deploy, read logs. You can run every one of these commands yourself too.

Install

Workser Desktop installs and updates the CLI for you. Install it manually only if you want workser on its own, alongside an agent running outside the app:
Node 20+.
The published build is a single self-contained file. Every runtime dependency is bundled in, so it runs under the system node from any directory with no node_modules beside it. That’s how Workser Code installs it onto your agent’s PATH during onboarding without running an npm install.

Two ways it connects

Workser Desktop writes ~/.workser/session.json pointing at its local daemon on http://127.0.0.1:<port>.Every call flows through Workser Code, which handles authentication, approval gates, and live progress in the UI. This is how you see what your agent is doing.
Both speak the same /v1/… contract.

How endpoint, token and project are resolved

$WORKSER_ENV names a backend rather than a URL: An unrecognised value is a hard error, not a silent fall-back to production. Run workser doctor to see what resolved and where it came from.
The session file records the endpoint it logged in against. Changing $WORKSER_ENV afterwards needs a fresh workser login (or an explicit --endpoint).

Global flags

The output contract

Every command supports --json and returns a single stable line:

Exit codes

Error codes worth knowing

Command surface

Built-in help

The CLI carries its own guides, so what your agent reads always matches the version it’s running:
Topics: automation · brand · business · computer-use · database · deliverables · deploy · images · memory · neon · roles · sdlc-entities · search · storage · version-control.

The scope boundary

The CLI is deliberately small, because it’s driven by a model that can be influenced by whatever it reads. Two rules define the surface:
  1. One project. Every command targets the single project linked to the working directory. Your agent can list and read projects, but not create one or switch which is pinned.
  2. Operate within that project; don’t administer the project set. Your agent can provision and use the project’s own infrastructure — create the database, read its connection string, browse rows, provision storage and auth, deploy, set env vars, manage files. Sensitive operations use the applicable approval and autonomy policy.
What it can never do, in any circumstance:
This is the first of two gates — the daemon and Workser’s API enforce the same boundary server-side against the agent’s project-scoped key. The local refusal exists so your agent gets a precise, machine-readable answer and a clear next step instead of a bare 403. Read the whole model in Security & approvals.

A typical run

The line between CLI and SDK

workser db query is for inspecting the database while building. It is not how a running app reads its own data — that’s @workser/app. An app that shells out to the CLI on every request is the most common mistake here.
  • Needs to happen when a user hits the app → the SDK.
  • Needs to happen to the app — provision, configure, deploy, read logs → this CLI.
  • Needs to keep running after the request finishes → a workflow.