@polargrid/cli
v0.1.0
Published
PolarGrid CLI - Command-line interface for PolarGrid Edge AI Infrastructure
Readme
PolarGrid CLI
Command-line interface for PolarGrid Edge AI Infrastructure.
Installation
npm install -g @polargrid/cliQuick Start
# Login to PolarGrid
polargrid login
# List your organizations
polargrid orgs list
# Create an API key
polargrid keys create my-app-key
# Test inference
polargrid test inference --region us-east --prompt "Hello world"Commands
Authentication
polargrid login # Browser OAuth flow
polargrid login --headless # API key authentication (for CI/CD)
polargrid logout # Clear stored credentials
polargrid whoami # Show current user and organizationOrganizations
polargrid orgs list # List organizations you belong to
polargrid orgs switch <org_id> # Switch to a different organization
polargrid orgs current # Show current organizationAPI Keys
polargrid keys list # List API keys
polargrid keys create <name> # Create a new API key
--permissions <level> # read-only, read-write, or admin
--project <id> # Scope to a specific project
polargrid keys revoke <key_id> # Revoke an API keyRegions
polargrid regions list # List available regions with latency
polargrid regions ping # Ping all regions, show RTTTesting
polargrid test # Health check (default)
polargrid test health # Check edge infrastructure health
--region <region> # Specific region or all
polargrid test inference # Run a quick inference test
--region <region> # Required: target region
--model <model> # Model to use (default: gpt2)
--prompt <prompt> # Prompt to sendConfiguration
polargrid config list # Show current config
polargrid config get <key> # Get a config value
polargrid config set <key> <val> # Set a config value
polargrid config unset <key> # Remove a config valueConfig options:
default_region- Default edge region for requestsoutput_format- Output format: json, table, or plainapi_base_url- Override API base URL
CI/CD Usage
For CI/CD pipelines, use the --headless flag with an API key:
# Set API key as environment variable
export POLARGRID_API_KEY="pg_your_api_key_here"
# Login in headless mode
polargrid login --headless
# Or pass the key directly
polargrid login --headless --api-key "pg_your_api_key_here"Configuration Files
The CLI stores configuration in ~/.polargrid/:
credentials.json- Authentication tokens (mode 0600)config.json- CLI configuration
Development
# Install dependencies
npm install
# Build
npm run build
# Run locally
npm start -- --help
# Watch mode
npm run devLicense
MIT
