Skip to main content

keystone-cli

keystone is the command-line tool of the Keystone platform. Use it to build, test, deploy and operate pro-code agents. You can also manage knowledge bases, prompts, tool credentials and skills with it.

The CLI includes the Keystone agent SDK (keystone-agent-sdk). An agent project that you create with the CLI uses that SDK.

Install

The CLI needs Python 3.12 or later.

pip install keystone-cli
keystone --version

Get started

  1. Log in. The command opens your browser and keeps your session for later commands.

    keystone login
    
  2. Select the workspace that your commands use.

    keystone workspace use <name>
    
  3. Create an agent project from a template, then check it.

    keystone agent init my-agent --template llm
    keystone agent validate my-agent
    
  4. Run the unit tests of the agent on your computer.

    keystone agent test my-agent
    
  5. Deploy the agent, make the new version Live, and call it.

    keystone agent deploy my-agent --publish --wait
    keystone agent invoke my-agent --input '{"prompt": "hi"}'
    

To see the fields of agent.yaml, run keystone agent manifest. Every command has --help.

CI with a service account

Use a platform service account in CI. The CLI sends its API key as Authorization: Bearer <key>. A CI job does not run keystone login.

Before you start, an admin gives the service account three permissions on its workspace, one time:

Permission Resource Why
agent:register the workspace of the service account Register a new agent
agent-vb:version:create the workspace of the service account Upload a bundle
agent:read the workspace of the service account Find an agent by name (delete, versions, status and others)

In the portal, open Settings → Service Accounts, open the access dialog of the account, and select This workspace as the resource.

deploy --publish, invoke, runs and threads work without agent:read on the workspace. A service account can not read agent logs: keystone agent logs needs trace:read, which only a user can hold.

When the service account deploys a new agent, it gets all other permissions on that agent automatically: read, invoke, and version create, deploy, publish and retire. To invoke an agent that another user created, an admin must give agent:invoke on that agent.

Set these variables in the CI job:

Variable Value
KEYSTONE_API_KEY The API key of the service account. Keep it in a masked CI secret.
KEYSTONE_WORKSPACE_ID The UUID of the target workspace.
KEYSTONE_API_BASE Optional. The platform API URL. The default is the URL of your CLI package.
KEYSTONE_AGENT_API_BASE Optional. The agent API URL for invoke, runs and threads.

Then do these steps:

  1. Make sure that the CLI uses the service account.

    export KEYSTONE_API_KEY=<sa-api-key>
    export KEYSTONE_WORKSPACE_ID=<workspace-uuid>
    keystone whoami
    
  2. Deploy the agent.

    keystone agent deploy my-agent --publish --wait
    
  3. Call the agent.

    keystone agent invoke my-agent --input '{"prompt": "ping"}'
    

Do not put the API key on the command line. The shell history and the CI log can show it.

These rules apply when KEYSTONE_API_KEY is set:

  • The key has priority over KEYSTONE_TOKEN and over a saved login.
  • The CLI does not save the key to a file, and it does not show the key. keystone whoami shows only the key ID.
  • The CLI does not select a workspace for you. --workspace-id has priority over KEYSTONE_WORKSPACE_ID. KEYSTONE_WORKSPACE_ID has priority over the saved workspace.
  • keystone workspace list and keystone workspace use do not operate with a key.

Commands

Command What it does
keystone login, keystone whoami Log in, and show your user.
keystone workspace List and select the workspace that your commands use.
keystone agent Develop and test an agent locally (init, validate, run, test, manifest), ship it (deploy, publish, status, retire, delete), and operate and debug it (invoke, logs, fetch, doctor, runs, hitl, traces, threads).
keystone dev Run the graph of the agent locally again each time you save a file.
keystone kb Create and manage knowledge bases.
keystone prompt Manage the prompts of a workspace.
keystone tool-credentials Manage the credentials that the catalogue tools of your agents use.
keystone skills Install Claude Code skills for work on agents.
keystone version Show the CLI version, the target environment and the version of the bundled agent SDK.

When a run fails

Start with this command. It shows the steps, the errors and the logs of one run.

keystone agent runs debug <agent> <run_id>

Metadata

Release files for keystone-cli 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for keystone-cli 0.5.0
File Size Uploaded Provenance Actions
keystone_cli-0.5.0.tar.gz 320.2 kB Without provenance Details for keystone_cli-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for keystone-cli 0.5.0
File Interpreter ABI Platform Actions
keystone_cli-0.5.0-py3-none-any.whl Python 3 none any Details for keystone_cli-0.5.0-py3-none-any.whl

Total release size: 614.3 kB

Release files / keystone_cli-0.5.0.tar.gz

Download URL keystone_cli-0.5.0.tar.gz
Size 320.2 kB
Tags Source
SHA-256 checksum
How to use checksums
91a53086cf2472f0749963e979f9dd6db271402b25aa899ba6cac10f93d7a615
BLAKE2b-256 checksum
How to use checksums
7562a5540ae6a6d0cb4a7326fd143f14c82e928933358fe4e095eebce964c255
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Release files / keystone_cli-0.5.0-py3-none-any.whl

Download URL keystone_cli-0.5.0-py3-none-any.whl
Size 294.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e8a0a86a9162111e3193971ec591258fab4cf3753f256afad5bf1f4438b6a12f
BLAKE2b-256 checksum
How to use checksums
12ceaed068222a3be7b9de78494f4826fc5d2893d4fa1eb6525a74dc1cb647a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Security for keystone-cli 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page