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
-
Log in. The command opens your browser and keeps your session for later commands.
keystone login -
Select the workspace that your commands use.
keystone workspace use <name>
-
Create an agent project from a template, then check it.
keystone agent init my-agent --template llm keystone agent validate my-agent
keystone agent init --helplists the templates, for examplellm,rag-qa,hitl,tool-agentanda2a(an agent that calls another agent of the workspace). -
Run the unit tests of the agent on your computer.
keystone agent test my-agent
-
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 (status, retire, delete 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:
-
Make sure that the CLI uses the service account.
export KEYSTONE_API_KEY=<sa-api-key> export KEYSTONE_WORKSPACE_ID=<workspace-uuid> keystone whoami
-
Deploy the agent.
keystone agent deploy my-agent --publish --wait
-
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_TOKENand over a saved login. - The CLI does not save the key to a file, and it does not show the key.
keystone whoamishows only the key ID. - The CLI does not select a workspace for you.
--workspace-idhas priority overKEYSTONE_WORKSPACE_ID.KEYSTONE_WORKSPACE_IDhas priority over the saved workspace. keystone workspace listandkeystone workspace usedo 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.7.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| keystone_cli-0.7.2.tar.gz | 328.1 kB | Without provenance | Details for keystone_cli-0.7.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| keystone_cli-0.7.2-py3-none-any.whl | Python 3 | none | any | Details for keystone_cli-0.7.2-py3-none-any.whl |
Total release size: 633.1 kB
Release files / keystone_cli-0.7.2.tar.gz
| Download URL | keystone_cli-0.7.2.tar.gz |
|---|---|
| Size | 328.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f65d4b394d55670559616081b71c7b52934fdeb65c3a0e73173a9113858730f
|
|
BLAKE2b-256 checksum How to use checksums |
cd733ef5886bc2b4ac21287bed64583e15c877eba3f86e37c20c5435fdc3d6e7
|
| 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.7.2-py3-none-any.whl
| Download URL | keystone_cli-0.7.2-py3-none-any.whl |
|---|---|
| Size | 305.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b932c6fb482145ffd75381b4f7d35cd3149166282081dbd0c890f57def513a7e
|
|
BLAKE2b-256 checksum How to use checksums |
cb9ffa3598cb8dfd453f6e12be19f8a48d8dfca5ae2b32ed25e4af0a66c99c2c
|
| 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.7.2
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.