CLI
Covers: the install, the sign-in and every command of poema that a user of an organization runs.
For: developers and agents who work from a shell.
An instance is a Task in code.
poema drives poema cloud from a shell: it makes, watches, enters, suspends and forks instances, and saves keys. The
commands below are grouped by what you do with them.
Install
poema runs on Node 22.19 or later. It is not on npm: this site carries its package.
npm install -g https://client-test.poema.dev/dl/poema-cli-0.1.0.tgz
Sign in
Sign in from the shell, with no key to copy:
poema login --url https://client-test.poema.dev
It prints a link and a code, you approve the code in the dashboard (an Admin's sign-in: a User cannot make a key), and
it keeps an API key of your organization, named login-… on API keys, until poema logout revokes it. The SDK and
poema-mcp read it too.
It reads the same variables as the SDK, and takes manifests in YAML or JSON:
export POEMA_URL=https://api.client-test.poema.dev
export POEMA_API_KEY=poema_ns_...
echo '{"apiVersion": "poema.dev/v1alpha1", "kind": "Task", "metadata": {"name": "hello"},
"spec": {"command": ["sh", "-c", "echo hello; sleep 600"], "gateway": {"name": "default"}, "debug": true}}' | poema apply -f -
poema get tasks
poema logs hello
poema terminal hello # a shell in it (debug: true turns the terminal on)
poema forward hello 3000:3000 # 127.0.0.1:3000 here, to port 3000 inside itIn a script or a CI job, set POEMA_URL and POEMA_API_KEY from the job's secrets, with a key made for that job alone
(Team and access).
poema login --url URLandpoema logoutsign in through this site and out again, as above.poema version(orpoema --version) prints the CLI's version.- Every command takes
--urlin place ofPOEMA_URL(keep the key inPOEMA_API_KEY: on the command line it would stay in your shell's history andps), and-o jsonor-o yamlwhere it prints a list or a resource.
Instances
poema apply -f FILEcreates or updates the resources in a file,-for stdin. With--from NAMEevery Task in it is made from the suspended instanceNAME, a prepared environment, as a fork (--memoryfor its memory too).poema get KIND [NAME] [-o json|yaml]lists or showstasks,workspaces,gateways,modelsorsecrets;poema get tasks --phase Running,Pendinglists only those phases.poema describe task NAMEshows an instance's spec, status, conditions, token counts and its last 20 activity entries, refused hosts included.poema watch task NAMEprints a line per change of its status.poema logs NAME [-f] [--tail N]is its command's output,--tailits last N lines.poema suspend NAMEandpoema resume NAMEsuspend it, memory and files kept, and resume it where it stopped.poema suspendreturns at once:poema get tasksshows when it isSuspended.poema timeout NAME SECONDSsuspends it SECONDS from now, at most your plan's session length; 0 sets that length.poema fork NAME NEW [NEW...] [--memory] [--suspend]forks the suspended instanceNAMEinto a new one of each name, each on a copy of its workspace, or with--memoryof its memory too. With--suspendeach fork stays suspended, copied at once: a snapshot, to resume or fork later.poema delete KIND NAME [--no-wait]deletes a resource, and for an instance waits until it is gone unless told not to.poema ingress NAMElists the listeners of an instance's Gateway and where each is reached.poema mcp report NAME [--tools]lists the MCP servers a running instance's workspaces and repositories declare, andpoema mcp tools URLthe tools the server atURLoffers.
Work inside an instance
These need an instance made with debug: true (Access from your machine on the dashboard).
poema exec NAME -- CMD [ARGS...]runs a command in it, when it was made withdebug: true.poema terminal NAME [--cwd DIR]opens a shell in it, inDIRor its first cloned repository, when it was made withdebug: true.poema forward NAME [LOCAL:]REMOTElistens on127.0.0.1:LOCALand carries each connection to127.0.0.1:REMOTEinside it, also withdebug: true.poema ssh NAME [-- SSH-ARGS...]opens an SSH session in it with OpenSSH'sssh, also withdebug: true; what follows--is ssh's own, after the host: a command, or-Land the like.poema ssh-config [NAME] [--write]prints the one SSH block that reaches every instance,Host *.poema, forssh,scp,sftpand editors, and with--writeputs it in~/.ssh/config. Each instance is thenNAME.NAMESPACE.poema; withNAME, it checks that instance and says its host.poema code NAME [--editor code|cursor] [--folder DIR]opens it in VS Code's or Cursor's Remote-SSH, inDIRor its first cloned repository, also withdebug: true.
Keys and secrets
poema secret set NAME KEY=VALUE ...stores a secret andpoema secret listshows their names and keys, never their values. Give a value asKEY=@FILE(a file's text),KEY=-(stdin) orKEY='$ENV'(an environment variable, in single quotes), so it stays out of your shell's history andps.poema credential add -f FILE [value=@FILE]saves a key on the Keys page by id:FILEsays what it is, such as{"kind": "static_key", "label": "GitHub key", "service": "github-token"}, whereserviceis one of the services Keys lists, and the value comes as@FILE,-or'$ENV', never typed on the line. It prints the key's id.poema credential list [ID]shows them (never a value),poema credential replace ID value=@FILEreplaces one andpoema credential remove IDremoves one. An Admin runs these (Secrets and keys).poema orgapp listshows your organization's own sign-in apps (never a client secret),poema orgapp set --service NAME(or--issuer URL, or--mcp-url URL)--client-id ID client_secret=@FILEsets one, andpoema orgapp remove IDremoves one, after which sign-ins use poema's app again. An Admin runs them, and the secret comes as@FILE,-or'$ENV', never typed on the line.poema service add -f FILE,poema service listandpoema service remove NAME --expected-version VERSIONmanage your organization's own service entries;poema helpgives their options.
Usage and quota
poema usage [--from DAY] [--to DAY]is your organization's model spend and compute, in total, by model and by day (DAYisYYYY-MM-DD).poema quota getshows your organization's quota next to what it has in use. Changing a quota is for operators: your plan sets it (Plans, limits and billing).
Commands for operators
poema help also lists commands for poema's operators (apikey, audit, sessions, events, namespaces,
quota set). Your keys are owner keys, so these answer Forbidden: make and revoke API keys on Settings, Account
(Team and access). For one instance's recent activity, use poema describe task NAME.
Example: an instance to work in
poema apply -f - <<'EOF'
kind: Task
metadata: {name: work}
spec:
command: [sleep, infinity]
gateway: {name: default}
debug: true
EOF
poema exec work -- git clone --depth 1 https://github.com/octocat/Hello-World
poema exec work -- ls Hello-World
poema suspend work
A command your role may not run answers error: Forbidden: .... poema help lists every command, the operator's among them.
Last checked: unreleased checkout.