Quick start

Quick start · Step 3

Publish, deploy, and run

Store an immutable manifest version, activate it, and run the agent.

You have agent.yaml on disk and a runtime from step 1. Three commands finish the story: hand the file to the runtime, choose it as the active version, then run the agent. Read each concept box before you run the matching command.

Publish

Send a resolved snapshot of your manifest to the runtime. The version is keyed by metadata.version and a content hash—it cannot change after publish.

terminal
$ phrony agents publish ./my-agent/agent.yaml

On success the CLI prints the agent reference, for example default/my-agent 0.1.0.

Deploy

Publishing saves your manifest on the runtime, but nothing runs yet. Deploy tells the runtime which saved copy to use when you run this agent—use the same namespace, name, and version as in your file:

terminal
$ phrony agents deploy default/my-agent@0.1.0

Run

Run the agent. The CLI uses the version you deployed. By default it runs in the background and prints a session id; add --attach to chat interactively. See phrony run.

terminal
$ phrony run default/my-agent
$ phrony run default/my-agent --attach

Provider API keys

The runtime needs the provider key at run time. The CLI reads OPENAI_API_KEY from your shell (matching secrets.openai.fromEnv in agent.yaml) and sends it with the run request—the value is not read from the published manifest.

Option 1 — export in the shell. Set the variable in the same terminal session, then run phrony run again (same commands as above):

terminal
$ export OPENAI_API_KEY=sk-...

Option 2 — use a .env file. Put one variable per line (KEY=value). The CLI loads the file when you pass --env-file (or -e) on phrony run; repeat the flag for multiple files. Values already set in your shell are not overwritten.

.env
OPENAI_API_KEY=sk-...
terminal
$ phrony run default/my-agent --attach --env-file .env

End-to-end

terminal
$ export OPENAI_API_KEY=sk-...
$ phrony agents publish ./my-agent/agent.yaml
$ phrony agents deploy default/my-agent@0.1.0
$ phrony run default/my-agent --attach

What happens

CommandEffect
publish
Immutable version stored in the runtime
deploy
Version becomes active for new sessions
run
Session executes the active manifest (model loop, tools, policies, trace)

Next in the checklist: add a tool binding, then human-in-the-loop approval.