Skip to main content
Grantex works with shell-capable agents without a framework-specific adapter. Install the CLI once, place the bundled Agent Skills where the host discovers them, and let the agent call 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

The host needs Node.js 18 or newer. Confirm the command is available:

Install the Agent Skills

The command installs two skills:
  • use-grantex-cli for registration, consent, token operations, grants, delegation, revocation, and audit;
  • integrate-grantex for adding service-boundary enforcement to a codebase.

OpenClaw workspace

Run from the OpenClaw agent workspace:
This writes to <workspace>/skills. Start a new agent turn after installation.

Hermes Agent

This writes to ~/.hermes/skills/grantex. Start a new Hermes session after installation.

Portable Agent Skills directory

This writes to <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:
Use --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 reads GRANTEX_URL and GRANTEX_KEY:
You can instead create a user-managed profile:
Keep API keys in the host’s secret store or environment injection mechanism. Do not place them in 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 0 means the requested check or operation succeeded. A denied or invalid verification returns a non-zero status, including in JSON mode.
  • Set NO_COLOR=1 when 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:
The same commands accept --file or --stdin; enforce test uses the names --token-file and --token-stdin.

Authorization flow for an agent

  1. Register the agent with only the scopes it can justify.
  2. Request authorization for a named principal, audience, duration, and exact scopes.
  3. Show the consent URL to the human. Do not let the agent approve its own grant.
  4. Exchange only the code returned through the approved callback flow.
  5. Store tokens in the host’s approved secret store.
  6. Verify and enforce again inside the service that owns the side effect.
  7. Audit important allowed and denied actions, then revoke authority when it is no longer needed.
grantex enforce test is a development preflight, not a security boundary. An autonomous agent can bypass a check it controls. The protected service must verify the token and required scope before executing the action.

When to use an SDK

See CLI for the complete command reference and Scope Enforcement for the protected-service implementation.
Last modified on August 10, 2026