CLI
poema drives poema from a shell, on Node 22.19 or later. It is not on npm: this site carries its package.
The command line package is coming; the HTTP API works today.
It reads the same variables as the SDK, and takes manifests in YAML or JSON:
export POEMA_URL=https://api.cloud.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 it
Or sign in from the shell, with no key to copy: poema login --url this site prints a link and a code, you approve the
code in the dashboard, and it keeps an API key of your namespace, named login-… on API keys, until poema logout
revokes it. The SDK and poema-mcp read it too.
Commands
poema apply -f FILEcreates or updates the resources in a file,-for stdin.poema get KIND [NAME] [-o json|yaml]lists or showstasks,workspaces,gateways,modelsorsecrets.poema describe task NAMEshows an instance's spec, status, usage and recent activity, its egress 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 exec NAME -- CMD [ARGS...]runs a command in it, when it was made withdebug: true.poema suspend NAMEandpoema resume NAMEstop and restart it, andpoema timeout NAME SECONDSresets its deadline (0 clears it).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 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 its SSH host block,NAME.NAMESPACE.poema, forscp,sftpand editors, and with--writeputs it in~/.ssh/config.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.poema secret set NAME KEY=VALUE ...stores a secret, andpoema secret listshows their names and keys, never their values.poema usage [--from DAY] [--to DAY]is your namespace's spend and compute, in total, by model and by day (DAYisYYYY-MM-DD).poema quota getshows your namespace's quota next to what it has in use.poema login --url URLandpoema logoutsign in through this site and out again, as above.poema version(orpoema --version) prints the CLI's version.
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