Run a one-shot LLM coding agent from the pks CLI, or enroll the current session as a shareable agent that people and other agents can send work to.
pks agent <prompt> [options]$ pks agent "summarise this repo"Run the one-shot coding agent in the current directory
$ pks agent "fix the lint errors" --read-onlyInspect-only run with mutating tools disabled
$ pks agent run "apply the migration" --cwd ./srcScope the tool sandbox to a subdirectory
$ pks agent registerEnroll this session as a shareable agent
pks agent covers two capabilities that share a command branch: a provider-neutral coding agent that runs a prompt to completion inside the CLI process, and a registration command that makes the current session visible as a person-like agent in Agent Share.
pks agent "<prompt>" runs an in-process tool-use loop against Azure OpenAI or Anthropic. The model gets a fixed tool set — read, write, edit, bash, grep, find, ls — all rooted at a single sandbox directory, and the loop runs until the model stops, the turn cap is hit, or the provider ends the response.
pks agent register does something entirely different. It enrolls the current terminal session against a configured Agent Share provider so that other people and agents can share content to it. No LLM is involved.
--cwd, which defaults to the current working directory.gpt-5.5 on Azure OpenAI; Anthropic models are selected with --model.pks agent does not spawn Claude Code or Codex. For a full remote coding session, use pks claude or pks vibecast instead.pks agent "<prompt>" returns an exit code you can branch on in CI: 0 for a clean stop, 2 when the turn cap is exceeded, 3 when the provider ends on max tokens, a content filter, or an error.--read-only removes write, edit, and bash from the tool registry, leaving inspection tools only.--skill <name> loads ~/.pks-cli/agent-skills/<name>.md and uses it as the system prompt in place of the default.--max-turns bounds the tool-call iterations; --cwd bounds what the agent can touch.pks agent register mints a per-user agent inbox on the Agent Share server, so the session shows up in the Share panel as somewhere to send screenshots, links, and decisions.The coding agent runs entirely inside the pks process. It resolves a model, resolves a credential for that model, builds a tool registry rooted at the sandbox directory, and then loops: send the conversation, execute any tool calls the model returns, send the results back. Nothing is persisted between runs — each invocation starts from an empty conversation.
Registration goes the other way. It reads the Agent Share credential stored by pks share init, refreshes the stored OIDC token, and posts an enrollment to the share server. The server resolves the owner from the bearer token and creates the inbox. The registered agent appears in the Share panel within about 30 seconds.
agent run is compute: a model, a sandbox, and a bounded loop.agent register is presence: an identity on a share server, with no model behind it.A third surface lives on the same command: the -a create|list|status|start|stop|remove action flags. These generate persona and knowledge markdown under <cwd>/.pks/agents/ and track status in memory only. They start no process. They are documented on the reference page so you recognize them, not so you build on them.
run · register
Bare pks agent "<prompt>" is rewritten to pks agent run "<prompt>" before the argument parser sees it, so the two forms are the same command. See the reference page for the full flag surface.
Complete command, argument, flag, environment-variable, and exit-code reference for the pks agent branch — the coding agent and session registration.
pks agent <command> [options]
Enroll the current coding session against an Agent Share server so it appears in the Share panel as a person other people and agents can send work to.
pks agent register [NAME] [options]
Give pks a prompt and let it work: pick a model, supply a credential, bound the sandbox and turn count, and read the exit code from a scripted run.
pks agent "<prompt>" [options]