Skip to main content

CLI

Command-line interface for PolarGrid Edge AI Infrastructure.

Installation

npm install -g @polargrid/cli

Quick Start

# Login to PolarGrid (opens browser)
polargrid login

# Check who you're logged in as
polargrid whoami

# List your organizations
polargrid orgs list

# Create an API key
polargrid keys create my-app-key

# Set default region
polargrid config set default_region yto-01

# Chat with a model (streaming)
polargrid chat "What is the capital of Canada?"

# Text-to-speech
polargrid tts "Hello from PolarGrid" --output hello.mp3

Authentication

Browser Login (Interactive)

polargrid login
Opens your browser for OAuth authentication. Your credentials are stored encrypted at rest in your OS keychain (macOS Keychain, Windows Credential Manager, or Linux Secret Service), with an AES-256-GCM encrypted file at ~/.polargrid/credentials.enc as a fallback where no keychain is available.

API Key (CI/CD)

For CI/CD pipelines, no login is needed. Just set the environment variable:
export POLARGRID_API_KEY="pg_your_api_key"

# Now you can run inference commands
polargrid chat "Hello" --no-interactive

Check Current Session

polargrid whoami
Shows your email, user ID, and current organization.

Logout

polargrid logout

Shell Completions

Enable tab-completion for commands, subcommands, and flags:
# Bash
eval "$(polargrid completion bash)" >> ~/.bashrc

# Zsh
eval "$(polargrid completion zsh)" >> ~/.zshrc

# Fish
polargrid completion fish > ~/.config/fish/completions/polargrid.fish

Next Steps

All Commands

Complete command reference for auth, inference, models, GPU, and more