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 FILE creates or updates the resources in a file, - for stdin.
  • poema get KIND [NAME] [-o json|yaml] lists or shows tasks, workspaces, gateways, models or secrets.
  • poema describe task NAME shows an instance's spec, status, usage and recent activity, its egress included.
  • poema watch task NAME prints a line per change of its status.
  • poema logs NAME [-f] [--tail N] is its command's output, --tail its last N lines.
  • poema exec NAME -- CMD [ARGS...] runs a command in it, when it was made with debug: true.
  • poema suspend NAME and poema resume NAME stop and restart it, and poema timeout NAME SECONDS resets its deadline (0 clears it).
  • poema fork NAME NEW [NEW...] [--memory] [--suspend] forks the suspended instance NAME into a new one of each name, each on a copy of its workspace, or with --memory of its memory too. With --suspend each 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, in DIR or its first cloned repository, when it was made with debug: true.
  • poema forward NAME [LOCAL:]REMOTE listens on 127.0.0.1:LOCAL and carries each connection to 127.0.0.1:REMOTE inside it, also with debug: true.
  • poema ssh NAME [-- SSH-ARGS...] opens an SSH session in it with OpenSSH's ssh, also with debug: true; what follows -- is ssh's own, after the host: a command, or -L and the like.
  • poema ssh-config NAME [--write] prints its SSH host block, NAME.NAMESPACE.poema, for scp, sftp and editors, and with --write puts it in ~/.ssh/config.
  • poema code NAME [--editor code|cursor] [--folder DIR] opens it in VS Code's or Cursor's Remote-SSH, in DIR or its first cloned repository, also with debug: true.
  • poema secret set NAME KEY=VALUE ... stores a secret, and poema secret list shows 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 (DAY is YYYY-MM-DD).
  • poema quota get shows your namespace's quota next to what it has in use.
  • poema login --url URL and poema logout sign in through this site and out again, as above.
  • poema version (or poema --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