Skip to main content

agent-tool-shared-cli

The shared chassis for the agent-tool-<x>-cli family — agent-ready command-line tools that an LLM can drive with no prior knowledge of them.

PyPI CI Python License: MIT

pip install agent-tool-shared-cli

The tools built on it — each learns the same contract, so an agent that knows one knows them all:

Tool Install For
drone-cli pipx install agent-tool-drone-cli Drone CI — builds, failing-step logs, promotions
grafana-cli pipx install agent-tool-grafana-cli Grafana — log discovery, health scan, alert routing
openproject pipx install agent-tool-openproject-cli OpenProject — work packages, time, invoicing
lexware-office pipx install agent-tool-lexware-office-cli Lexware Office — invoices, contacts, AR-aging

This repo also holds the family's engineering docs — read these first if you are standing up a new tool:

Keywords: agent CLI chassis, LLM tool contract, exit-code taxonomy, JSON output CLI, keyring credentials, Python CLI library, AI agent tooling, Claude.

What's in it

This package is deliberately small. It holds the agent contract and the pure utilities that implement it — the things that must be identical across every tool, because an agent learns the contract once and applies it everywhere.

Module What
agentcli.errors The exit-code taxonomy (0/1/3/4/5/6/7/130) + DryRun
agentcli.output Emitter: json/table/markdown/csv, --fields projection, NDJSON streaming
agentcli.credentials Keyring storage with a 0600 fallback and an env override
agentcli.appspec AppSpec — the two strings that make all of the above tool-specific
from agentcli import AppSpec, Credentials, Emitter, OutputFormat, NotFoundError

SPEC = AppSpec(name="drone-cli", env_prefix="DRONECLI")

SPEC.config_dir()            # ~/.config/drone-cli  (or $DRONECLI_CONFIG_DIR)
SPEC.env("TOKEN")            # "DRONECLI_TOKEN"

Credentials(SPEC).get_token("default")     # env > keyring > 0600 file
Emitter(OutputFormat.json, fields=["id", "status"]).emit(rows)
raise NotFoundError("no such build")       # -> exit 5, JSON on stderr

The exit-code contract

Published API. You may leave a code unallocated, or repurpose one deliberately. You may never renumber one — agents branch on these, and they are documented in three places per tool (README, the in-binary guide, and the Claude skill).

Code Meaning
0 success (including a successful --dry-run)
1 generic error
2 reserved for Click/Typer usage errors — never allocate
3 config error
4 auth error (401/403)
5 not found (404)
6 conflict (409 / optimistic locking)
7 validation error (422) — see fieldErrors
8+ per-tool, and only for a condition you have observed
130 SIGINT

What is deliberately NOT here

client.py, serialize.py, resolve.py and the domain commands stay in each tool. They look shareable and are not:

OpenProject stops paginating on an authoritative total — "never stop on a short page". Drone has no total, and a short page is the terminator. The rule that inverts between tool #1 and tool #2 is exactly the rule you must not hoist.

Auth schemes, retry matrices and error-body shapes are the same story. Pulling them in would make this a framework with a config object per tool, which is how shared-code projects die.

Share the contract, not the transport.

Contributing

You need nothing but Python:

pip install -e '.[test]'
pytest                       # 74 tests, no network, no services

Changes here affect every downstream CLI. Two rules:

  1. Never renumber an exit code, and never change an output shape without treating it as a breaking change — downstream agents depend on both.
  2. Don't add a module because two tools happen to share it today. Wait until a third does, and until you can state the rule it obeys. tests/test_contract.py is the tripwire: if a change makes you edit it, stop and think.

License

MIT — see LICENSE.

Metadata

Release files for agent-tool-shared-cli 0.1.4

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

Source distribution (sdist)

Source distribution for agent-tool-shared-cli 0.1.4
File Size Uploaded Provenance
agent_tool_shared_cli-0.1.4.tar.gz 23.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for agent-tool-shared-cli 0.1.4
File Interpreter ABI Platform
agent_tool_shared_cli-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 41.1 kB

Release files / agent_tool_shared_cli-0.1.4.tar.gz

Download URL agent_tool_shared_cli-0.1.4.tar.gz
Size 23.0 kB
Tags Source
SHA-256 checksum
How to use checksums
29904abb5d8cdfcff046da6a4dd96ce5e58fd0abb4cc7b3f8ad728f9f3a1e4f2
BLAKE2b-256 checksum
How to use checksums
17bdc45773245abe3378b31b1127cc34aeaa729d3b6b936e1f173c5717d37903
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 20, 2026.

Transparency log

Release files / agent_tool_shared_cli-0.1.4-py3-none-any.whl

Download URL agent_tool_shared_cli-0.1.4-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5bd561139c27cd4d88f11fcf372a92ddeba3fa7325fffd2848a6b942da17b49b
BLAKE2b-256 checksum
How to use checksums
96e8be9b8e116a2e5a183d9b416e6f70008efa04d183e84b796a81d7466f69f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 20, 2026.

Transparency log

Security for agent-tool-shared-cli 0.1.4

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for agent_tool_shared_cli-0.1.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 20, 2026.

Transparency log

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