agentcli
Shared conventions for command-line tools whose primary callers are agents. It owns no food domain: it owns predictable errors, JSON output, skills, in-binary guides, and the candidate record used for composition.
Install and test
uv sync --project .
uv run --project . pytest -q
CLI contract
Every consuming tool uses click, declares --json per command with
json_option, and makes its top-level group JsonAwareGroup. The group scans
raw arguments so even parse failures that happen before a subcommand exists
honour a --json request. Importing agentcli.exits also changes Click's own
usage-error code from 2 to 1; consumers must not repeat that correction.
| code | meaning |
|---|---|
| 0 | success |
| 1 | usage error or a caller-liftable refusal |
| 2 | remote, network, or site failure after allowed retries |
| 3 | a caller-stated assertion did not hold |
| 4 | a data-quality warning escalated by --strict |
An exhausted request budget is code 1, because the caller can lift it. A proportional recipe fit with no solution is code 3.
--json emits exactly one JSON object on stdout and nothing else. Success and
failure are symmetric:
{"ok":true,"data":{}}
{"ok":false,"error":{"message":"..."}}
A search with no matches is successful with an empty list. Under --json,
errors go to stdout so a caller never has to merge streams to recover the one
promised document. Human errors go to stderr.
The stable public surface is:
UsageError,RemoteError,AssertionFailure, andStrictFailure.dumps,emit,emit_error,json_option, andlimit_option.JsonAwareGroupfor every consuming tool's top-level group.skill_group(name=..., package=...)forskill install,uninstall, andstatus. Installation refuses an unrelated destination, recognises owned broken symlinks, copies by default, and supports--link,--to, and--dry-run. With no options it installs everywhere the skill is wanted and refreshes its own earlier copies, so plaininstallis the whole job; a directory holding somebody else's skill is still refused.guide_command(text)for a complete manual available without a network.candidate,macro_options,matches,rank, andunverifiablefor the shared composition record and filters below.
Candidate contract
Candidate sources answer the same question: filter things someone could eat by per-serving macros, then rank them with provenance. Recipes and restaurant meals therefore emit the same record:
{
"kind":"recipe",
"id":"sourdough-pizza",
"name":"Sourdough Pizza",
"per_serving":{"kcal":384.2,"protein":31.5,"fat":12.1,"carbs":38.4},
"complete":true,
"detail":{}
}
kind is recipe or meal. id is accepted back by the emitting tool;
display-only slugs are not identifiers. Source-specific fields live under
detail, which shared code never reads.
Sources accept macro_options (--max-kcal, --min-protein) and use rank.
The rank key is unrounded protein per 100 kcal, then absolute protein, then
name. --max-kcal 0 is valid because zero-calorie records exist.
per_serving contains only macros actually known by the source. Missing is
never filled with zero. complete exposes whether the full shape is present;
a candidate missing a requested filter macro is excluded and returned in the
source's unverifiable or equivalent bucket. Every source emits that bucket,
even when its loader makes it structurally empty.
This contract is the reason the tools can be independent packages: an orchestrator can merge and rank results without knowing which source answered.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file click_agentcli-0.2.0.tar.gz.
File metadata
- Download URL: click_agentcli-0.2.0.tar.gz
- Upload date:
- Size: 23.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b596b17a027d8224f07fd3ac8189719c9f31d02341ae872bab1fab8cbecc1028
|
|
| MD5 |
788bc12b76a5e25efa2888064d37ba9e
|
|
| BLAKE2b-256 |
b9d1ec5017be97282666c9f50352888ad21197f17f3dfd42b25cd0f5ae5e9b46
|
Provenance
The following attestation bundles were made for click_agentcli-0.2.0.tar.gz:
Publisher:
release.yml on owahltinez/click-agentcli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
click_agentcli-0.2.0.tar.gz -
Subject digest:
b596b17a027d8224f07fd3ac8189719c9f31d02341ae872bab1fab8cbecc1028 - Sigstore transparency entry: 2542934668
- Sigstore integration time:
-
Permalink:
owahltinez/click-agentcli@a95916a46392dd72d78896ff77ab68f542adf5d9 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/owahltinez
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a95916a46392dd72d78896ff77ab68f542adf5d9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file click_agentcli-0.2.0-py3-none-any.whl.
File metadata
- Download URL: click_agentcli-0.2.0-py3-none-any.whl
- Upload date:
- Size: 23.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af3b5a5a89ce0ac19bc2ede704769f986861b9d5e086d7ef5fe812f2acab9b68
|
|
| MD5 |
e696a710183e7de546df6abe0ecf55fe
|
|
| BLAKE2b-256 |
46dbd46027bd30af4ffc74682ff0721cc19a2c0bccca89bd310b389da4a7da2d
|
Provenance
The following attestation bundles were made for click_agentcli-0.2.0-py3-none-any.whl:
Publisher:
release.yml on owahltinez/click-agentcli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
click_agentcli-0.2.0-py3-none-any.whl -
Subject digest:
af3b5a5a89ce0ac19bc2ede704769f986861b9d5e086d7ef5fe812f2acab9b68 - Sigstore transparency entry: 2542934790
- Sigstore integration time:
-
Permalink:
owahltinez/click-agentcli@a95916a46392dd72d78896ff77ab68f542adf5d9 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/owahltinez
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a95916a46392dd72d78896ff77ab68f542adf5d9 -
Trigger Event:
push
-
Statement type: