CLI
partite is the command line tool for Partite. It manages configuration, such as models, agents and meshes, publishes mesh versions, runs meshes and shows traces. It works with the hosted service and with a self-hosted Partite Mesh.
It is made for people at a terminal and for scripts and agents. At a terminal it prints tables and asks questions. In a script it prints JSON, never asks, and exits with a code that says what happened.
Install
With Homebrew, on macOS or Linux:
brew install partite-ai/tap/partiteOr download an archive from the releases page. There are archives for Linux, macOS and Windows, on AMD64 and ARM64. Each has the partite binary. Put it on your PATH.
Or install it with Go 1.27.4 or later:
go install github.com/partite-ai/partite-cli/cmd/partite@latestTo set up tab completion, run partite completion --help. It covers bash, zsh, fish and PowerShell.
Log in
partite login
partite whoamipartite login opens a login page in your browser, and prints the page and a code. Check that the page shows the same code, and approve. The CLI waits until you finish.
| Flag | What it does |
|---|---|
--no-browser | Prints the page and does not open a browser. Use it over SSH: open the page on another device. |
--org <ORG_CODE> | Logs in to this organization. Without it, you choose on the login page. partite whoami shows the code of the organization you are logged in to. |
--with-api-key | Stores an API key token instead. See below. |
partite whoami shows the context, the server, who you are, the organization and your permissions. It also checks that the server accepts the login.
The CLI keeps the login in the operating system’s keychain, and refreshes it when it expires. To keep it in a file instead, set PARTITE_NO_KEYRING=1. The file is credentials.json in the config folder, with mode 0600. partite logout removes the login.
partite login works only with the hosted service. For a self-hosted Partite Mesh, use an API key.
API keys for scripts and CI
A script uses an API key. Create one in the UI under Access > API keys, or with the CLI:
partite api-key create ci --scope configuration:read --scope configuration:writeThe token is printed once. Give the script the token in PARTITE_API_TOKEN:
export PARTITE_API_TOKEN=prt_ak_...
partite mesh listGive the key only the scopes the script needs. The CLI names scopes as the API does:
| Scope | Name in the UI | Lets the CLI |
|---|---|---|
configuration:read | Read configuration | List and show configuration and traces |
configuration:write | Write configuration | Create, change and delete configuration |
mesh:converse | Converse with meshes | Run meshes: run, chat and conversation |
The CLI looks names up with the configuration API. So a key with only mesh:converse must name a mesh by its ID, as in partite run cmsh_... --label prod "Hello". See API Keys for the other scopes.
To store a token in a context instead, pass it on standard input. At a terminal, the CLI asks for it and hides what you type.
echo "$PARTITE_API_TOKEN" | partite login --with-api-keyThe CLI uses the first credentials it finds, in this order:
PARTITE_API_TOKEN, an API key token.PARTITE_TOKEN, an OAuth access token.- The login or API key stored for the context.
Contexts
A context is a server and how to log in to it. Two are built in:
| Context | Server | Login |
|---|---|---|
cloud | https://api.partite.ai | partite login |
local | http://localhost:8080 | None. For a self-hosted server that does not require auth. |
cloud is the default. To use another context for one command, pass --context <NAME> or set PARTITE_CONTEXT. To change the default, run partite context use <NAME>.
To add a server, such as a self-hosted Partite Mesh, create a context and store an API key for it:
partite context set acme --url https://mesh.acme.example.com
echo "$PARTITE_API_TOKEN" | partite --context acme login --with-api-key
partite context use acmepartite context set changes only the flags you pass:
| Flag | What it sets |
|---|---|
--url | The server URL. |
--auth | api-key (the default for a new context), login (the hosted service only) or none (a self-hosted server without REQUIRE_AUTH). |
--org | The organization partite login logs in to. |
--web-url | The web app that view commands open. The cloud context has https://app.partite.ai. |
--enterprise | true, false or auto. Whether the server has the features only the hosted service has. auto means yes when the host name ends in .partite.ai. |
partite context list, partite context show and partite context delete list, show and delete contexts. The config file is config.yaml in ~/.config/partite. Set PARTITE_CONFIG_DIR to use another folder.
Output
At a terminal, the CLI prints tables. Otherwise it prints JSON. -o picks the format:
| Format | Output |
|---|---|
-o table | A table, or the fields of one resource |
-o json | JSON. A list is an array. A resource uses the same field names as the Terraform provider. |
-o yaml | YAML, in the same format that -f reads |
-o id | Only the IDs, one per line |
Anywhere a command takes an ID, it also takes the resource’s name.
Errors go to standard error. With -o json they are JSON too:
{"error": {"message": "...", "code": 5, "hint": "...", "param": "...", "decision_id": "..."}}code is the exit code. hint says what to do next. param names the input the server found the problem with. decision_id is set when a boundary refused the action. Show the decision with partite boundary decision <DECISION_ID>.
The CLI asks questions only at a terminal. --no-input makes it fail instead of asking. Delete commands ask before they delete. Without a terminal, pass --yes, or the command fails with exit code 2.
Get, edit and apply
Most resources have get and apply. get -o yaml prints the same format that apply -f reads. So you can save a resource, edit it and apply it:
partite agent get triage -o yaml > triage.yaml
# edit triage.yaml
partite agent apply -f triage.yamlapply creates the resource from the file, or changes the one with the same name to match the file. It ignores the fields the server sets, such as id and created_at, so the output of get can be applied as it is. In the file, refer to other resources by name or ID. -f - reads standard input. create also takes -f, and its flags override the file.
A mesh file can also list the draft’s inputs and links. partite mesh apply adds the ones that are missing, changes the ones that are different and removes the ones the file leaves out. If the file has no inputs key or no links key, those stay as they are.
Every change to a mesh goes to its draft. Changing an agent makes a new version of the agent, but the mesh keeps using the version it had. To take the new version into the draft, and then publish the draft:
partite mesh set-agent-version support triage
partite mesh publish support --label v2partite mesh publish gives the draft a label, which freezes it as a version, and opens a new draft. A label can be used once per mesh. partite mesh versions support lists the versions.
Commands
Commands take a resource and a verb: partite <resource> <verb>. Most resources have list, get, create, update, apply and delete. Many also have view, which opens the resource in the web app. Run partite <resource> --help for the verbs and flags of a resource.
| UI group | Command | What it does |
|---|---|---|
| Models | model-provider | Model providers. models lists the models a provider serves. |
model-profile | Model profiles. probe checks a profile with its provider. | |
model-set | Model sets and their rules. | |
embedding-profile | Embedding profiles, which memory stores use. | |
| Memory | memory | Memory stores, their scopes, interaction profiles, and the documents, facts and observations a store holds. recall searches a store as an agent would. |
| Tools | mcp | MCP connections. tools lists their tools, call calls one, and tunnel-key and subscription manage tunnels. |
particle | Uploads, installs and calls particles. | |
workspace | Workspaces, their files and their key-values. | |
skill | Skills. create --dir makes one from a folder, and pull writes its files to a folder. | |
client-task-definition | Client tasks: tasks an agent can send to a user. | |
form | Checks and builds the A2UI forms of client tasks. | |
| Agents | agent | Agents and their versions. |
| Meshes | mesh | Meshes, their inputs and links, the draft and published versions. |
route | Routes, which split a mesh’s traffic across its versions. | |
| Observability | trace | Traces. See Traces. |
eval | Judge metrics, rubrics, monitors and evaluations. The hosted service only. | |
| Access | api-key | API keys. |
access-point | Access points, their clients and secrets. | |
boundary | Boundaries. decision shows a recorded decision. | |
| Triggers | webhook | Webhook destinations. send posts to one as another service would. |
schedule | Schedules. The hosted service only. | |
| Terraform | export | Writes a resource, and what it uses, as Terraform. The hosted service only. |
| Running meshes | run | Sends a request to a mesh and shows the answer. |
chat | A conversation with a mesh at the terminal. | |
conversation | Conversations, their requests, events, files and tasks, and notification channels. | |
| Setup | login, logout, whoami | Logs in and out, and shows who you are. |
context | Contexts. | |
completion | Tab completion scripts. |
Run a mesh
partite run sends a request to a mesh and follows it until it ends:
partite run support --label prod "My order is late"A new conversation needs a mesh version. Pick it with --label, --version, --route or --draft.
| Flag | What it does |
|---|---|
--intent | The intent. Needed when the mesh has more than one, unless only one takes text. |
--input | The whole input, as JSON or YAML. @file reads a file and @- reads standard input. Without it, the text fills the intent’s one text field. |
--attach | Attaches a file. The input refers to it as {"$ref": "attachment://<file name>"}. Repeat it for more files. |
--conversation | Sends the request to an existing conversation, by ID or external ID. |
--external-id, --tag, --request-tag, --notification-channel, --no-trace | Set the external ID, tags, notification channel and tracing of a new conversation, as in the Conversation API. |
--thinking | Shows the model’s thinking. |
--events | Prints every event as a line of JSON, and the result as the last line. |
--no-wait | Starts the request, prints its IDs and does not follow it. |
--timeout | Stops following after this long, such as 5m. The request keeps running. |
At a terminal, the agents’ messages show as they come, and the response at the end. When the mesh asks you something (a task), you answer at the prompt. Press Ctrl-C to stop following. The CLI asks whether to cancel the request on the server.
Without a terminal, run stops at a task, prints it and exits with code 9. The task has the JSON Schema of its answer. Answer it, or decline it:
partite conversation task complete rcnv_8Xk2 --answer "Blue"
partite conversation task complete rcnv_8Xk2 --data @answer.json --follow
partite conversation task cancel rcnv_8Xk2With -o json, run prints one result object:
{"conversation_id": "rcnv_...", "request_id": "rreq_...", "status": "complete", "response": {...}}status is complete, failed, cancelled, task_pending or running. The object has response when the request is complete, error when it failed or was cancelled, and task when it waits for a task.
To hold a conversation at the terminal, use partite chat. Type a message, read the answer, and type the next one. At the prompt, /new starts a new conversation, /id shows the conversation ID and /exit leaves.
partite chat support --label prodOther commands for conversations:
| Command | What it does |
|---|---|
partite conversation intents <CONVERSATION> | Lists the intents and their input fields. With -o json, it has the JSON Schemas. |
partite conversation create <MESH> --label prod | Starts a conversation with no request, for example to attach files first with partite conversation attach. |
partite conversation events <CONVERSATION> --follow | Shows the events of the latest request, and follows them until it ends. |
partite conversation response <CONVERSATION> --wait | Waits for the latest request to end, and shows its result. |
partite conversation requests <CONVERSATION> | Lists the requests and how each ended. |
partite conversation notifications <CHANNEL> --follow | Follows a notification channel. |
A conversation is named by its ID (rcnv_...) or by its external ID. Where a request is optional, the conversation’s latest request is used.
Try an access point’s boundaries
run, chat and conversation can go through an access point as a caller you make up, to try out its boundaries. First let the access point trust the CLI. Then pass the access point, and the caller’s subject and claims:
partite access-point trust-cli partners
partite chat support --label prod --access-point partners --subject alice --claim tier=goldThe CLI signs the caller’s tokens with a key it keeps with the context’s credentials. Anyone with this key can call through the access point as anyone. Trust it only on access points you test with, and remove it with partite access-point untrust-cli.
Traces
A trace is named by its ID (ttrc_...) or by its conversation’s ID (rcnv_...).
partite trace list --mesh support --since 1d
partite trace get rcnv_8Xk2
partite trace request get rcnv_8Xk2 0
partite trace view rcnv_8Xk2| Command | What it shows |
|---|---|
trace list | Traces, newest first. Filter with --mesh, --mesh-version, --status (active, cancelled, complete or failed), --search, --since and --until. |
trace get | Each request of the trace: its status, duration, tokens and cost. |
trace request get | The agents, messages, tool calls and model calls of one request. Pick the request by its index in trace get, or by its ID. --full shows long text and prompts in full. |
trace view | Opens the trace in the web app. The context needs a web app. |
When a request fails, the error’s hint gives the partite trace get command for its conversation.
A self-hosted Partite Mesh with cloud config and CLOUD_TRACE_UPLOAD=manual uploads its traces when asked. To ask, run partite trace upload with a context whose server is that Partite Mesh. --conversation limits it to the traces of some conversations. See Self-Hosting.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error |
| 2 | Bad usage, or a confirmation is needed (pass --yes) |
| 3 | Not logged in, or the login expired |
| 4 | Permission denied |
| 5 | Not found |
| 6 | Conflict, such as a name that is taken |
| 7 | The mesh request failed |
| 8 | The mesh request was cancelled |
| 9 | The mesh request waits for a task |
| 10 | The mesh request was still running when --timeout passed |
| 130 | Cancelled with Ctrl-C |
Codes 7 to 10 come from the commands that follow a request: run, conversation events --follow, conversation response, and conversation task complete and conversation task cancel with --follow.
Environment variables
| Variable | What it does |
|---|---|
PARTITE_API_TOKEN | An API key token. Used before any stored login. |
PARTITE_API_KEY, PARTITE_API_SECRET | The key ID and secret of an API key, an older form of PARTITE_API_TOKEN. |
PARTITE_TOKEN | An OAuth access token. |
PARTITE_CONTEXT | The context to use, like --context. |
PARTITE_URL | The server URL. Overrides the context’s URL. |
PARTITE_CONFIG_DIR | The folder of config.yaml. The default is ~/.config/partite. |
PARTITE_NO_KEYRING | Keep credentials in a file, not the operating system’s keychain. |
A short tour
This builds a mesh with one agent, publishes it and runs it.
Add a model provider, a model profile and a model set. models lists the IDs of the models the provider serves.
partite login
partite model-provider create anthropic --type anthropic --api-key-env ANTHROPIC_API_KEY
partite model-provider models anthropic
partite model-profile create main --provider anthropic --model <MODEL_ID> --max-tokens 8192
partite model-set create default --default mainCreate an agent. @ reads a value from a file. instructions.md holds the agent’s task instructions. input.json is the JSON Schema of the agent’s input, for example:
{
"type": "object",
"properties": {
"text": {"type": "string", "description": "The customer's message"}
},
"required": ["text"]
}partite agent create helper --model-complexity medium \
--task-instructions @instructions.md --input-message-type @input.jsonCreate the mesh from a file, mesh.yaml:
name: support
model_set_id: default
inputs:
- name: chat
agent_id: helper
responses:
- name: answer
description: The reply to the customer
message_type:
type: object
properties:
text: {type: string, description: The reply text}partite mesh apply -f mesh.yaml
partite mesh publish support --label v1Run it, and look at what happened:
partite run support --label v1 "My order is late"
partite trace get <CONVERSATION_ID>
partite trace request get <CONVERSATION_ID> 0To move the configuration to Terraform, export it from the hosted service:
partite export mesh support --all --import-blocks -O support.tfRelated
- Self-Hosting: use the CLI with the
localcontext. - Conversation API: what
runandconversationcall. - SDKs: call meshes from Go and TypeScript.
- Configuration As Code: manage configuration with Terraform.