Hessra CLI
Command-line interface for Hessra authentication and identity management.
Installation
From cargo
From Source
Development Build
# Binary will be at target/release/hessra
Usage
Identity Management
Authenticate with mTLS
Get an identity token using mTLS authentication:
Or use environment variables:
Create Delegated Identity
Create a delegated identity token for an AI agent or service:
Verify Token
Verify a saved token:
Or verify a token file:
Refresh Token
Refresh an identity token:
List Saved Tokens
# Simple list
# List with details (shows identity and expiry status)
Inspect Token
View detailed information about a token including identity, expiry, and status:
# Inspect a saved token
# Inspect with verbose output (shows full Biscuit content)
# Inspect token from file
# JSON output for scripting
Prune Expired Tokens
Remove expired tokens from storage:
# Interactive mode (asks for confirmation)
# Dry run to see what would be deleted
# Force deletion without confirmation
Delete Token
Authorization Operations
Request Authorization Token
Request an authorization token for a specific resource and operation:
Using mTLS authentication:
Using a saved identity token:
Automatically use default identity token if available:
Output just the token for piping:
# Use in environment variable
# Pipe to another command
|
Verify Authorization Token
Verify an authorization token:
# Pipe token from another command
| \
# Or provide token directly
Configuration Management
Initialize Configuration
Set Configuration Values
View Configuration
# Show all configuration
# Show specific value
Show Configuration File Path
Configuration
The CLI stores configuration and tokens in ~/.hessra/
:
- Configuration file:
~/.hessra/config.toml
- Tokens directory:
~/.hessra/tokens/
This location is consistent across all platforms (Linux, macOS, Unix).
Configuration File Format
= "test.hessra.net"
= 443
= "/home/user/.hessra/client.crt"
= "/home/user/.hessra/client.key"
= "/home/user/.hessra/ca.pem"
= "/home/user/.hessra/tokens"
Environment Variables
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 certificate
Output Formats
Standard Output
By default, the CLI provides human-readable colored output:
✓ Authentication successful!
Identity: uri:urn:test:user
Expires in: 7200 seconds
Token saved as: default
JSON Output
Use --json
flag for machine-readable output:
Examples
Workflow: Delegate to AI Agent
- Authenticate with your credentials:
- Create a delegated token for your AI agent:
- Provide the token to your AI agent:
CI/CD Usage
# Use environment variables and JSON output for CI/CD
# Get token and extract it using jq
TOKEN=
Security Notes
- Tokens are stored in plain text files by default
- Use appropriate file permissions for token storage directory
- Consider using the
secure-storage
feature (when available) for keychain integration - Never commit tokens or certificates to version control
License
Apache-2.0