Enterprise-grade CLI for the Xase AI Lab (governed AI training datasets)
Project description
๐จ Xase AI Lab CLI
Enterprise-grade command-line interface for governed AI training datasets
Beautiful, interactive CLI for discovering, managing, and consuming governed AI training datasets with enterprise compliance built-in.
โจ Features
- ๐จ Beautiful UI - Claude-inspired orange theme with rich terminal formatting
- ๐ Interactive Onboarding - Guided setup wizard for first-time users
- ๐ Secure Authentication - Email OTP with token management
- ๐ Rich Tables - Formatted displays for offers, leases, and usage stats
- โก Fast & Reliable - Built with async support and retry logic
- ๐ก๏ธ Compliance-First - GDPR & AI Act compliant data access
๐ฆ Installation
# Clone or navigate to the CLI directory
cd packages/xase-cli
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install in editable mode
pip install -e .
# Verify installation
xase-cli --help
๐ Quick Start
First Run - Interactive Onboarding
On first run, Xase CLI will guide you through setup:
xase-cli
You'll see:
- Beautiful ASCII art banner with orange theme
- Interactive setup wizard to configure API URL
- Guided next steps for authentication and usage
Manual Setup
Run the setup wizard anytime:
xase-cli setup
Choose from:
- ๐ API Connection Settings
- ๐ Authentication & Login
- โ๏ธ Advanced Settings
- ๐๏ธ View Current Configuration
Authentication
# Login with email OTP
xase-cli login
# Enter your email
# Check email for 6-digit code
# Enter code to complete authentication
# View usage statistics
xase-cli usage
# Logout
xase-cli logout
Working with Datasets
# List available offers
xase-cli list-offers --limit 20 --risk LOW
# Create a lease for a dataset
xase-cli mint-lease DATASET_ID --ttl-seconds 3600
# View active leases
xase-cli list-leases
# Get lease details
xase-cli lease-details LEASE_ID
# Stream dataset for training
xase-cli stream DATASET_ID --lease-id LEASE_ID --output batch.json
๐ Commands Reference
Core Commands
setup
Interactive setup wizard
xase-cli setup
login
Authenticate via email OTP
xase-cli login
logout
Remove saved tokens
xase-cli logout
version
Show CLI version
xase-cli version
Dataset Discovery
list-offers
List available access offers with filters
xase-cli list-offers [OPTIONS]
Options:
--limit N Maximum number of offers (default: 20)
--risk LEVEL Filter by risk level (LOW, MEDIUM, HIGH)
--language LANG Filter by language
Example:
xase-cli list-offers --risk MEDIUM --language en --limit 50
Lease Management
mint-lease
Create a new lease for a dataset
xase-cli mint-lease DATASET_ID [OPTIONS]
Arguments:
DATASET_ID Dataset ID to lease
Options:
--ttl-seconds N Lease time-to-live in seconds (default: 1800)
Example:
xase-cli mint-lease ds_abc123 --ttl-seconds 3600
Output:
โ Lease minted
โน Lease ID: lease_xyz789
โน Expires: 2026-02-15T19:30:00Z
list-leases
List active leases
xase-cli list-leases [OPTIONS]
Options:
--limit N Maximum number of leases (default: 20)
Example:
xase-cli list-leases --limit 10
Output:
Active Leases
โญโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโโฎ
โ Lease ID โ Dataset โ Status โ Expires โ
โโโโโโโโโโโโโโโโผโโโโโโโโโโโโโผโโโโโโโโโผโโโโโโโโโโค
โ lease_xyz123 โ ds_med_001 โ ACTIVE โ 18:30 โ
โฐโโโโโโโโโโโโโโโดโโโโโโโโโโโโโดโโโโโโโโโดโโโโโโโโโโฏ
lease-details
Show detailed information about a lease
xase-cli lease-details LEASE_ID
Arguments:
LEASE_ID Lease ID to inspect
Example:
xase-cli lease-details lease_xyz789
Data Streaming
stream
Stream dataset batch for training
xase-cli stream DATASET_ID [OPTIONS]
Arguments:
DATASET_ID Dataset to stream
Options:
--lease-id ID Lease ID to use (required)
--env ENV Environment (development, staging, production)
--estimated-hours Estimated hours of usage (default: 0.5)
--output FILE Output file path
Example:
xase-cli stream ds_def456 \
--lease-id lease_xyz789 \
--env production \
--output training_batch.json
Monitoring
usage
Show usage statistics
xase-cli usage
Output:
Usage Statistics
โญโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโฎ
โ Tenant ID โ tenant_01 โ
โ Active Offers โ 15 โ
โ Active Leases โ 3 โ
โ Auth Mode โ api_key โ
โฐโโโโโโโโโโโโโโโโดโโโโโโโโโโโโฏ
๐ Production Workflow
Complete flow from discovery to consumption:
# 1. First-time setup
xase-cli setup
xase-cli login
# 2. Discover datasets
xase-cli list-offers --risk MEDIUM --language en
# 3. Create lease for dataset
xase-cli mint-lease ds_abc123 --ttl-seconds 7200
# Note the lease ID from output
# 4. Stream data in batches
xase-cli stream ds_abc123 \
--lease-id lease_xyz789 \
--env production \
--output batch_001.json
xase-cli stream ds_abc123 \
--lease-id lease_xyz789 \
--env production \
--output batch_002.json
# 5. Monitor active leases
xase-cli list-leases
# 6. Check usage statistics
xase-cli usage
# 7. View lease details
xase-cli lease-details lease_xyz789
Error Handling
The CLI exits with standard codes:
0- Success1- General error (API error, validation failed)2- Configuration error (missing API key)130- Interrupted by user (Ctrl+C)
Example error:
$ python xase_cli.py validate pol_invalid
โ HTTP 404: Policy not found
Best Practices
1. Always validate before consuming
# โ
Good
python xase_cli.py validate pol_xyz789 --requested-hours 0.5
python xase_cli.py stream ds_def456 --output data.json
# โ Bad (no validation)
python xase_cli.py stream ds_def456 --output data.json
2. Use small batches for long-running jobs
# โ
Good - consume in 0.5h increments
for i in {1..10}; do
python xase_cli.py validate pol_xyz789 --requested-hours 0.5
python xase_cli.py stream ds_def456 --output batch_$(printf %03d $i).json
sleep 60
done
# โ Bad - single large request
python xase_cli.py stream ds_def456 --output all_data.json # May timeout
3. Monitor lease expiration
# Check lease status regularly
python xase_cli.py list-leases | grep "Expires"
4. Secure your API key
# โ
Good - use environment variable
export XASE_API_KEY="xase_pk_..."
# โ Bad - hardcode in script
XASE_API_KEY="xase_pk_..." python xase_cli.py list-offers
Automation Example
Bash script for continuous consumption:
#!/bin/bash
set -e
POLICY_ID="pol_xyz789"
DATASET_ID="ds_def456"
BATCH_SIZE=0.5
OUTPUT_DIR="./training_data"
mkdir -p "$OUTPUT_DIR"
for i in {1..20}; do
echo "Processing batch $i..."
# Validate access
python xase_cli.py validate "$POLICY_ID" --requested-hours "$BATCH_SIZE"
# Stream data
OUTPUT_FILE="$OUTPUT_DIR/batch_$(printf %03d $i).json"
python xase_cli.py stream "$DATASET_ID" --output "$OUTPUT_FILE"
echo "โ Batch $i saved to $OUTPUT_FILE"
# Wait before next batch
sleep 30
done
echo "โ All batches completed"
Troubleshooting
"XASE_API_KEY environment variable not set"
Fix:
export XASE_API_KEY="xase_pk_..."
"HTTP 401: Unauthorized"
Causes:
- Invalid API key
- Expired API key
- Wrong tenant
Fix:
- Verify API key in dashboard
- Regenerate if expired
"HTTP 403: Access denied"
Causes:
- Policy expired
- Usage limit exceeded
- Lease revoked
Fix:
# Check policy status
python xase_cli.py validate pol_xyz789
# Request new lease if needed
python xase_cli.py execute off_abc123 --hours 1.0
"HTTP 429: Rate limit exceeded"
Fix:
- Add delays between requests
- Reduce batch frequency
- Contact support to increase rate limit
Support
- Documentation: docs.xase.ai
- API Reference: api.xase.ai/docs
- Issues: github.com/xase/xase-cli/issues
- Email: support@xase.ai
License
MIT ยฉ Xase
Built for AI Labs by the Xase team
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xase_ai-2.0.0.tar.gz.
File metadata
- Download URL: xase_ai-2.0.0.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdb70abc83c69f38a53a23a1b6ffe27ea6e98b0c184070db721dd33dbb5cda30
|
|
| MD5 |
1c06b0db8371fb29f2f05cc0f5d5a725
|
|
| BLAKE2b-256 |
528875d78a0dff7440ec796353a897066268e35763dc2ed39193c04acb2328a8
|
File details
Details for the file xase_ai-2.0.0-py3-none-any.whl.
File metadata
- Download URL: xase_ai-2.0.0-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c730a1ac1e5783dcbc0ddb68336b9739909aead39a7b56d3ec03136e123239c
|
|
| MD5 |
b0dcbe7aa12d5953b8717842ae5bfb70
|
|
| BLAKE2b-256 |
ba43146cfc507d7b92021cefde25ef49c355988e5dd4da33d6337c03a54633d5
|