CLI Reference¶
AiHint Standard provides command-line interfaces for all implementations to make it easy to work with AiHint metadata from the terminal.
Python CLI¶
Installation¶
Commands¶
Generate Keys¶
Options:
- --output-dir
: Directory to save generated keys (default: current directory)
Create AiHint¶
aihint create \
--target "https://example.com" \
--issuer "https://example.com" \
--score 0.85 \
--method "aihint-core-v1" \
--private-key "keys/private_key.pem" \
--output "aihint.json"
Options:
- --target
: Target URL for the AiHint
- --issuer
: Issuer URL
- --score
: Trust score (0.0-1.0)
- --method
: Scoring method (default: "aihint-core-v1")
- --comment
: Optional comment
- --expires-at
: Expiration date (ISO format)
- --private-key
: Path to private key file
- --output
: Output file path
Verify AiHint¶
Options:
- --public-key
: Path to public key file (optional)
Validate AiHint¶
Show Info¶
JavaScript CLI¶
Installation¶
Commands¶
Generate Keys¶
Options:
- --output-dir
: Directory to save generated keys (default: current directory)
Create AiHint¶
npx aihint create \
--target "https://example.com" \
--issuer "https://example.com" \
--score 0.85 \
--method "aihint-core-v1" \
--private-key "keys/private_key.pem" \
--output "aihint.json"
Options:
- --target
: Target URL for the AiHint
- --issuer
: Issuer URL
- --score
: Trust score (0.0-1.0)
- --method
: Scoring method (default: "aihint-core-v1")
- --comment
: Optional comment
- --expires-at
: Expiration date (ISO format)
- --private-key
: Path to private key file
- --output
: Output file path
Verify AiHint¶
Options:
- --public-key
: Path to public key file (optional, will fetch from URL if not provided)
Validate AiHint¶
Fetch from URL¶
Show Info¶
PHP CLI¶
Installation¶
Commands¶
Generate Keys¶
Options:
- --output-dir
: Directory to save generated keys (default: current directory)
Create AiHint¶
php vendor/bin/aihint create \
--target "https://example.com" \
--issuer "https://example.com" \
--score 0.85 \
--method "aihint-core-v1" \
--private-key "keys/private_key.pem" \
--output "aihint.json"
Options:
- --target
: Target URL for the AiHint
- --issuer
: Issuer URL
- --score
: Trust score (0.0-1.0)
- --method
: Scoring method (default: "aihint-core-v1")
- --comment
: Optional comment
- --expires-at
: Expiration date (ISO format)
- --private-key
: Path to private key file
- --output
: Output file path
Verify AiHint¶
php vendor/bin/aihint verify aihint.json
php vendor/bin/aihint verify https://example.com/.well-known/aihint.json
Options:
- --public-key
: Path to public key file (optional, will fetch from URL if not provided)
Validate AiHint¶
Fetch from URL¶
Show Info¶
Common Use Cases¶
Quick Setup¶
# Generate keys
aihint generate-keys --output-dir ./keys
# Create and sign AiHint
aihint create \
--target "https://mywebsite.com" \
--issuer "https://mywebsite.com" \
--score 0.85 \
--private-key "keys/private_key.pem" \
--output "aihint.json"
# Verify the result
aihint verify aihint.json
Batch Processing¶
Remote Verification¶
Key Management¶
# Generate new keys
aihint generate-keys --output-dir ./new-keys
# Backup existing keys
cp keys/private_key.pem backup/private_key_$(date +%Y%m%d).pem
cp keys/public_key.pem backup/public_key_$(date +%Y%m%d).pem
Environment Variables¶
All CLI implementations support the following environment variables:
AIHINT_DEFAULT_METHOD
: Default scoring methodAIHINT_DEFAULT_EXPIRY_DAYS
: Default expiration period in daysAIHINT_KEY_DIRECTORY
: Default directory for key filesAIHINT_TIMEOUT
: HTTP timeout for remote operations (JavaScript/PHP only)AIHINT_CACHE_DIR
: Directory for caching remote keys (PHP only)
See Also¶
- Python API - Python implementation details
- JavaScript API - JavaScript implementation details
- PHP API - PHP implementation details
- Implementation Guide - Detailed usage guide