@polargrid/cli
v0.2.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 yto-01 --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 keyProjects
polargrid projects list # List projects in current org
polargrid projects info <id> # Show project details
polargrid projects create <name> # Create a new project
--description <text> # Project description
polargrid projects delete <id> # Delete a project (with confirmation)
--yes # Skip confirmationRegions
polargrid regions list # List available regions with latency
polargrid regions ping # Ping all regions, show RTT
--count <n> # Number of pings per region (default: 3)Inference
polargrid chat [prompt] # Interactive chat (streaming)
--model <model> # Model (default: Meta-Llama-3.1-8B-Instruct)
--region <region> # Edge region
--system <prompt> # System prompt
--temperature <n> # Temperature (0.0-2.0)
--no-interactive # Single-shot mode
polargrid completions <prompt> # Text completion (streaming)
--model <model> # Model
--max-tokens <n> # Max tokens (default: 200)
polargrid tts <text> # Text-to-speech
--voice <voice> # Voice (default: af_bella)
--model <model> # TTS model (default: kokoro-82m)
--format <fmt> # mp3, wav, opus, flac (default: mp3)
--output <file> # Output file (default: output.mp3)
--speed <n> # Speed 0.25-4.0 (default: 1.0)
polargrid transcribe <file> # Transcribe audio to text
--model <model> # STT model (default: whisper-large-v3-turbo)
--language <lang> # Language code (e.g., en, fr)
--format <fmt> # text, json, srt, vtt, verbose_json
--output <file> # Output file (default: stdout)
polargrid translate <file> # Translate audio to English
--model <model> # STT model
--format <fmt> # text, json
--output <file> # Output fileModels & GPU
polargrid models list # List available models
polargrid models load <model> # Load a model on edge server
--force # Force reload
polargrid models unload <model> # Unload a model
polargrid models unload-all # Unload all models
polargrid models status # Show model loading status
polargrid gpu status # GPU utilization and info
polargrid gpu memory # GPU memory usage (visual bar chart)
polargrid gpu purge # Free GPU memory
--force # Force purgeTesting
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: Meta-Llama-3.1-8B-Instruct)
--prompt <prompt> # Prompt to sendShell Completions
polargrid completion bash # Generate bash completions
polargrid completion zsh # Generate zsh completions
polargrid completion fish # Generate fish completions
# Install (e.g., for zsh):
eval "$(polargrid completion zsh)" >> ~/.zshrcConfiguration
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
