Push and deploy
This group covers getting any agent to run on a customer’s data: push and deploy a version, then have the vault owner connect it.
Shipping has three steps, and they are the same for code agents and workflows:
| Step | What it does | CLI | ROC |
|---|---|---|---|
| Build | Bundles the code and writes manifest.json. |
mk build |
The Workflow Builder builds from the canvas. |
| Push | Uploads a version to the Agent Service’s storage bucket, the registry. Versions are immutable. | mk push |
Part of Deploy in the Workflow Builder. |
| Deploy | Applies deployment records: which version runs, for which vaults and events. | mk deploy |
Agent page → Overview → deployments; Deploy in the Workflow Builder. |
Then a vault owner must connect the agent before it runs on their data. See Connect to a vault.
Before you start
From ROC, open your Agent Service → ⋯ → Settings → General and copy:
- Agent-service public key: pass it as
--as-pubkey. - Registry bucket ID: pass it as
--bucket.
On the Access tab, generate two tokens:
| Token | Used by | Environment variable |
|---|---|---|
| Storage access token | mk push, mk widget push, mk cubby push |
MANYKIND_DDC_ACCESS_TOKEN |
| CLI access token | mk deploy, mk publish |
MANYKIND_ACCESS_TOKEN |
Tokens are shown once. Members of an Agent Service get their storage token through an invite; see Team.
Environments
Every command takes --env dev|stage|prod (or $MANYKIND_ENV). The default is dev. One flag selects the whole environment: the storage network for push (dev = devnet, stage = testnet, prod = mainnet), the platform API for deploy, and the endpoints baked into widgets. Push and deploy to the same environment.
Build
mk buildWrites dist/<alias>/bundle.js, manifest.json, and widgets/<id>/ for every agent in manykind.config.ts. A workflow written with defineWorkflow builds the same way; its graph and the workflow runner become the bundle. mk build first runs the checks of mk validate, which lists every problem at once; run it on its own while you edit. Build errors are listed in Write an agent.
Push
export MANYKIND_DDC_ACCESS_TOKEN=…mk push --env dev --bucket <bucketId> --as-pubkey <agentServicePubkey>mk push:
- uploads
bundle.jsand each widget directory, content-addressed; - writes
manifest.jsonunderagents/<alias>/<version>/in the bucket and moveslatestto it; - stamps the agent id
<agentServicePubkey>:<alias>and the environment’s endpoints into the manifest and widgets; - declares any cubby the manifest names that the bucket does not have yet.
To publish into an organization vault instead of a bucket you control, pass --vault <vaultId> --vault-scope <scope> instead of --bucket: the vault API checks you may write that scope and writes the vault’s registry bucket itself. Its request body is capped at 64 MiB; ship large assets as vault objects, not in the bundle.
Before uploading anything, mk push checks the access token against the bucket’s on-chain owner. A token that the owner did not issue is refused with the owner’s address and the fix. See Team.
Preview a push with mk push --dry-run: it lists what would be uploaded and where, from local files only, without credentials.
Bump version in manykind.config.ts for each push you want to keep. An A2A agent you run elsewhere is registered with --kind external; see Bring your own (A2A).
Deploy
export MANYKIND_ACCESS_TOKEN=…mk deploy --env dev --as-pubkey <agentServicePubkey>mk deploy reads every record in deployments/ and applies them as one set, replacing what is live. The folder is the desired state: delete a file and the next deploy removes that record. Each apply creates a revision you can roll back to in ROC.
Deployment records
One record per file; the filename is the record name (^[a-z0-9][a-z0-9_-]{0,62}$). .json and .jsonc are read, comments allowed.
{ "priority": 99, "targeting": "", // empty: the default record, matches everything "version": "latest", "weight": 1}{ "priority": 10, "targeting": "vault.scope == 'sandbox'", "version": "0.2.0", "weight": 1, "params": { "temperature": 0.1 }}| Field | Required | Rule |
|---|---|---|
priority |
yes | Among matching records, the lowest priority wins. |
targeting |
yes | A CEL expression over vault (id, scope), event (type), and connection.settings. "" marks the default record. |
version |
yes | A pushed semver, or "latest". |
weight |
no | A positive integer, default 1. Records in the same priority tier split traffic by weight: 90 and 10 is a 90/10 split. |
enabled |
no | false excludes the record. |
params |
no | Overrides the manifest’s param defaults. |
engagements |
no | Per-engagement overrides: { "<id>": { priority, weight, limit: { n, per }, enabled, params } }. |
expiresAt |
no | RFC 3339. Once past, the record is ignored. |
The set must contain exactly one default record (empty targeting). A Job resolves its version when it is created and keeps it until it ends, so "latest" affects new Jobs only.
| Flag | Default | Meaning |
|---|---|---|
--version <v> |
— | Override version in every record without editing files. |
--deployments <path> |
deployments |
A folder, or one file holding { "deployments": [...] } or a single record. |
--dry-run |
— | Compare the set with what is live and print what would change; apply nothing. |
--note, --author |
git user.email |
Recorded on the revision. |
Preview a deploy before you apply it:
$ mk deploy --dry-runDry run of mk deploy: <agentServicePubkey>:ticket-triage (dev), live revision 3; 1 change, nothing sent = unchanged default: latest (priority 99, weight 1) + add sandbox-canary: 0.2.0 (priority 10, weight 1, when vault.scope == 'sandbox')Rollout patterns
| Goal | Records |
|---|---|
| Ship to everyone | One default record, version pinned or "latest". |
| Canary to an audience | Add a record with targeting and a lower priority than the default. |
| Percentage rollout | Two records in one priority tier with weights such as 90 / 10. |
| Temporary experiment | Add expiresAt. |
In ROC
Open Agents, pick the agent, and use the deployments manager on Overview: New deployment, Edit deployment, Delete deployment, and History with Roll back. The form has Route (Name, Audience — targeting (CEL), Version, Priority, Weight), Parameters, Engagements, and Execution rules. Save revision creates a new revision; limits in Execution rules are saved separately with Save limits.
Scripts, CI, and coding agents
In your terminal, mk push and mk deploy run as soon as you start them and print text. In a script, in CI, or under a coding agent, the CLI changes two things:
- It never prompts. When nobody can answer (a coding agent,
CIset, stdin not a terminal, orMK_NON_INTERACTIVE=1),mk pushandmk deployneed--yes. Without it they change nothing, exit2, and print the command to re-run. - It prints JSON. When stdout is not a terminal, or a coding agent runs it, the result is JSON on stdout and progress goes to stderr. A failure is one JSON object with a stable
reason. Force a format with--format text|jsonor--json.
# CImk validatemk buildmk push --bucket "$BUCKET" --as-pubkey "$AS_PUBKEY" --yesmk deploy --dry-run > plan.json # what would change, for the logmk deploy --yesExit codes: 0 success, 1 failed, 2 usage or confirmation needed, 4 authentication. See Output, prompts, and errors.
Workflows
A workflow is an agent, so the same steps apply.
- Release, then deploy. Release in the Workflow Builder, or
mk release, checks the workflow and publishes a numbered version without making it live; Deploy, ormk deploy <version>, makes a release live. See Release and deploy. latestis what is live. A workflow’s triggers (events, schedules, webhooks) are read from itslatestversion.mk releaseleaveslatestalone andmk deploy <version>moves it;mk pushmoves it at once.- Push and deploy still work.
mk build,mk push,mk deployship adefineWorkflowworkflow as any agent, without checks. See Workflows in code.
Listing
mk publish sends the agent’s card to the marketplace listing, and the agent page’s Pricing tab publishes its pricing. Neither is needed to deploy, connect, or run the agent.