grantex --json.
No Hermes- or OpenClaw-specific SDK is required. The CLI is the portable control-plane surface. Use the existing TypeScript, Python, or Go SDK—or the gateway or middleware—inside the service that enforces a protected action.
Published
@grantex/cli@0.3.0 includes the Hermes, OpenClaw, portable, and custom-directory Agent Skills installer.Install the CLI
Install the Agent Skills
The command installs two skills:use-grantex-clifor registration, consent, token operations, grants, delegation, revocation, and audit;integrate-grantexfor adding service-boundary enforcement to a codebase.
OpenClaw workspace
Run from the OpenClaw agent workspace:<workspace>/skills. Start a new agent turn after installation.
Hermes Agent
~/.hermes/skills/grantex. Start a new Hermes session after installation.
Portable Agent Skills directory
<workspace>/.agents/skills, a project-local Agent Skills location used by compatible hosts.
Any other CLI agent
Point the installer at that agent’s skill root:--force to update Grantex’s bundled files in an existing installation. It does not delete unrelated files in those skill folders.
Configure unattended access
The CLI readsGRANTEX_URL and GRANTEX_KEY:
SKILL.md, prompts, source control, or chat messages.
Stable shell contract
- Put the global flag before the command:
grantex --json agents list. - Parse stdout as JSON and treat stderr as diagnostics.
- Exit status
0means the requested check or operation succeeded. A denied or invalid verification returns a non-zero status, including in JSON mode. - Set
NO_COLOR=1when consuming text output. - Treat response fields as data. Do not scrape the human-readable tables.
Keep tokens out of argv
Process arguments can appear in history and process listings. Prefer environment, file, or stdin input:--file or --stdin; enforce test uses the names --token-file and --token-stdin.
Authorization flow for an agent
- Register the agent with only the scopes it can justify.
- Request authorization for a named principal, audience, duration, and exact scopes.
- Show the consent URL to the human. Do not let the agent approve its own grant.
- Exchange only the code returned through the approved callback flow.
- Store tokens in the host’s approved secret store.
- Verify and enforce again inside the service that owns the side effect.
- Audit important allowed and denied actions, then revoke authority when it is no longer needed.
When to use an SDK
See CLI for the complete command reference and Scope Enforcement for the protected-service implementation.