Skip to content
CLI

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/partite

Or 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@latest

To set up tab completion, run partite completion --help. It covers bash, zsh, fish and PowerShell.

Log in

partite login
partite whoami

partite 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.

FlagWhat it does
--no-browserPrints 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-keyStores 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:write

The token is printed once. Give the script the token in PARTITE_API_TOKEN:

export PARTITE_API_TOKEN=prt_ak_...
partite mesh list

Give the key only the scopes the script needs. The CLI names scopes as the API does:

ScopeName in the UILets the CLI
configuration:readRead configurationList and show configuration and traces
configuration:writeWrite configurationCreate, change and delete configuration
mesh:converseConverse with meshesRun 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-key

The CLI uses the first credentials it finds, in this order:

  1. PARTITE_API_TOKEN, an API key token.
  2. PARTITE_TOKEN, an OAuth access token.
  3. 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:

ContextServerLogin
cloudhttps://api.partite.aipartite login
localhttp://localhost:8080None. 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 acme

partite context set changes only the flags you pass:

FlagWhat it sets
--urlThe server URL.
--authapi-key (the default for a new context), login (the hosted service only) or none (a self-hosted server without REQUIRE_AUTH).
--orgThe organization partite login logs in to.
--web-urlThe web app that view commands open. The cloud context has https://app.partite.ai.
--enterprisetrue, 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:

FormatOutput
-o tableA table, or the fields of one resource
-o jsonJSON. A list is an array. A resource uses the same field names as the Terraform provider.
-o yamlYAML, in the same format that -f reads
-o idOnly 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.yaml

apply 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 v2

partite 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 groupCommandWhat it does
Modelsmodel-providerModel providers. models lists the models a provider serves.
model-profileModel profiles. probe checks a profile with its provider.
model-setModel sets and their rules.
embedding-profileEmbedding profiles, which memory stores use.
MemorymemoryMemory stores, their scopes, interaction profiles, and the documents, facts and observations a store holds. recall searches a store as an agent would.
ToolsmcpMCP connections. tools lists their tools, call calls one, and tunnel-key and subscription manage tunnels.
particleUploads, installs and calls particles.
workspaceWorkspaces, their files and their key-values.
skillSkills. create --dir makes one from a folder, and pull writes its files to a folder.
client-task-definitionClient tasks: tasks an agent can send to a user.
formChecks and builds the A2UI forms of client tasks.
AgentsagentAgents and their versions.
MeshesmeshMeshes, their inputs and links, the draft and published versions.
routeRoutes, which split a mesh’s traffic across its versions.
ObservabilitytraceTraces. See Traces.
evalJudge metrics, rubrics, monitors and evaluations. The hosted service only.
Accessapi-keyAPI keys.
access-pointAccess points, their clients and secrets.
boundaryBoundaries. decision shows a recorded decision.
TriggerswebhookWebhook destinations. send posts to one as another service would.
scheduleSchedules. The hosted service only.
TerraformexportWrites a resource, and what it uses, as Terraform. The hosted service only.
Running meshesrunSends a request to a mesh and shows the answer.
chatA conversation with a mesh at the terminal.
conversationConversations, their requests, events, files and tasks, and notification channels.
Setuplogin, logout, whoamiLogs in and out, and shows who you are.
contextContexts.
completionTab 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.

FlagWhat it does
--intentThe intent. Needed when the mesh has more than one, unless only one takes text.
--inputThe 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.
--attachAttaches a file. The input refers to it as {"$ref": "attachment://<file name>"}. Repeat it for more files.
--conversationSends the request to an existing conversation, by ID or external ID.
--external-id, --tag, --request-tag, --notification-channel, --no-traceSet the external ID, tags, notification channel and tracing of a new conversation, as in the Conversation API.
--thinkingShows the model’s thinking.
--eventsPrints every event as a line of JSON, and the result as the last line.
--no-waitStarts the request, prints its IDs and does not follow it.
--timeoutStops 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_8Xk2

With -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 prod

Other commands for conversations:

CommandWhat 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 prodStarts a conversation with no request, for example to attach files first with partite conversation attach.
partite conversation events <CONVERSATION> --followShows the events of the latest request, and follows them until it ends.
partite conversation response <CONVERSATION> --waitWaits 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> --followFollows 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=gold

The 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
CommandWhat it shows
trace listTraces, newest first. Filter with --mesh, --mesh-version, --status (active, cancelled, complete or failed), --search, --since and --until.
trace getEach request of the trace: its status, duration, tokens and cost.
trace request getThe 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 viewOpens 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

CodeMeaning
0Success
1Error
2Bad usage, or a confirmation is needed (pass --yes)
3Not logged in, or the login expired
4Permission denied
5Not found
6Conflict, such as a name that is taken
7The mesh request failed
8The mesh request was cancelled
9The mesh request waits for a task
10The mesh request was still running when --timeout passed
130Cancelled 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

VariableWhat it does
PARTITE_API_TOKENAn API key token. Used before any stored login.
PARTITE_API_KEY, PARTITE_API_SECRETThe key ID and secret of an API key, an older form of PARTITE_API_TOKEN.
PARTITE_TOKENAn OAuth access token.
PARTITE_CONTEXTThe context to use, like --context.
PARTITE_URLThe server URL. Overrides the context’s URL.
PARTITE_CONFIG_DIRThe folder of config.yaml. The default is ~/.config/partite.
PARTITE_NO_KEYRINGKeep 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 main

Create 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.json

Create 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 v1

Run 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> 0

To move the configuration to Terraform, export it from the hosted service:

partite export mesh support --all --import-blocks -O support.tf

Related