| Crates.io | hessra-cli |
| lib.rs | hessra-cli |
| version | 0.1.0 |
| created_at | 2025-08-27 21:23:15.962015+00 |
| updated_at | 2025-08-27 21:23:15.962015+00 |
| description | Command-line interface for Hessra authentication and identity management |
| homepage | |
| repository | https://github.com/hessra/hessra-sdk.rs |
| max_upload_size | |
| id | 1813215 |
| size | 116,217 |
Command-line interface for Hessra authentication and identity management.
cargo install hessra
cargo install --path hessra-cli
cargo build --release
# Binary will be at target/release/hessra
Get an identity token using mTLS authentication:
hessra identity authenticate \
--server test.hessra.net \
--cert ~/.hessra/client.crt \
--key ~/.hessra/client.key \
--ca ~/.hessra/ca.pem \
--save-as default
Or use environment variables:
export HESSRA_SERVER=test.hessra.net
export HESSRA_CERT=~/.hessra/client.crt
export HESSRA_KEY=~/.hessra/client.key
export HESSRA_CA=~/.hessra/ca.pem
hessra identity authenticate
Create a delegated identity token for an AI agent or service:
hessra identity delegate \
--identity "uri:urn:test:user:ai-agent" \
--ttl 3600 \
--from-token default \
--save-as ai-agent
Verify a saved token:
hessra identity verify --token-name default
Or verify a token file:
hessra identity verify --token-file /path/to/token --identity "uri:urn:test:user"
Refresh an identity token:
hessra identity refresh --token-name default --save-as refreshed
hessra identity list
hessra identity delete old-token
hessra config init
hessra config set default_server test.hessra.net
hessra config set default_cert_path ~/.hessra/client.crt
hessra config set default_key_path ~/.hessra/client.key
hessra config set default_ca_path ~/.hessra/ca.pem
# Show all configuration
hessra config get
# Show specific value
hessra config get default_server
hessra config path
The CLI stores configuration and tokens in ~/.hessra/:
~/.hessra/config.toml~/.hessra/tokens/This location is consistent across all platforms (Linux, macOS, Unix).
default_server = "test.hessra.net"
default_port = 443
default_cert_path = "/home/user/.hessra/client.crt"
default_key_path = "/home/user/.hessra/client.key"
default_ca_path = "/home/user/.hessra/ca.pem"
token_storage_dir = "/home/user/.hessra/tokens"
The CLI supports the following environment variables:
HESSRA_SERVER: Default server hostnameHESSRA_PORT: Default server portHESSRA_CERT: Path to client certificateHESSRA_KEY: Path to client private keyHESSRA_CA: Path to CA certificateBy default, the CLI provides human-readable colored output:
✓ Authentication successful!
Identity: uri:urn:test:user
Expires in: 7200 seconds
Token saved as: default
Use --json flag for machine-readable output:
hessra identity authenticate --json
{
"success": true,
"identity": "uri:urn:test:user",
"expires_in": 7200,
"token_saved_as": "default",
"token_path": "/home/user/.hessra/tokens/default.token"
}
hessra identity authenticate \
--cert ~/.hessra/my-cert.crt \
--key ~/.hessra/my-key.key \
--ca ~/.hessra/ca.pem
hessra identity delegate \
--identity "uri:urn:test:myuser:ai-assistant" \
--ttl 3600 \
--save-as ai-assistant
export AI_AGENT_TOKEN=$(cat ~/.hessra/tokens/ai-assistant.token)
# Use environment variables and JSON output for CI/CD
export HESSRA_SERVER=prod.hessra.net
export HESSRA_CERT="$CI_MTLS_CERT"
export HESSRA_KEY="$CI_MTLS_KEY"
export HESSRA_CA="$CI_CA_CERT"
# Get token and extract it using jq
TOKEN=$(hessra identity authenticate --json | jq -r '.token')
secure-storage feature (when available) for keychain integrationApache-2.0