CLI Tool
The @simosphere/cli is a command-line interface for the SIMOSphere AI platform. It lets you manage API keys, test model completions interactively, inspect usage statistics, and automate workflows directly from your terminal — without writing any code.
Installation
Install the CLI globally from npm. It requires Node.js 18 or later. After installation, the simo command is available in your terminal:
# Install globally
npm install -g @simosphere/cli
# Verify installation
simo --version
# Or run without installing via npx
npx @simosphere/cli --helpAuthentication
The CLI reads your API key from the SIMOSPHERE_API_KEY environment variable. You can also authenticate interactively using the login command, which stores the key securely in your system keychain:
# Set via environment variable
export SIMOSPHERE_API_KEY="sk_live_YOUR_API_KEY"
# Or login interactively (stores in system keychain)
simo login
# Verify authentication
simo whoamiSecurity Note
The simo login command uses your operating system's native keychain (macOS Keychain, GNOME Keyring, Windows Credential Manager) for secure storage. The key is never written to disk in plaintext.
Command Reference
The CLI is organized into subcommands. Every command supports a --help flag for detailed usage information and a --json flag for machine-readable output.
simo chat
Start an interactive chat session with any available model. Supports multi-turn conversations with full history, streaming output, system prompts, and configurable temperature. The session can be exported to JSON for archival.
simo chat --model mistral-small-latest
simo chat --model mistral-small-latest --system "You are a legal advisor."
simo chat --model mistral-small-latest --temperature 0.2 --max-tokens 2048simo complete
Send a single completion request and print the result to stdout. Accepts input from arguments, stdin, or a file. Ideal for scripting and pipeline integration:
simo complete "Summarize this document" --model mistral-small-latest
cat document.txt | simo complete --model mistral-small-latest
simo complete --file input.txt --model mistral-small-latest --output result.txtsimo models
List all models available on your plan, including context window sizes, pricing tiers, and current availability status:
simo models
simo models --json
simo models --filter "mistral"simo keys
Manage your API keys from the command line. List active keys, create new ones with specific scopes, and revoke compromised keys instantly:
simo keys list
simo keys create --name "CI Pipeline" --scopes chat:completions,models:read
simo keys revoke sk_live_abc123...simo usage
Display token usage statistics for the current billing period. Shows prompt tokens, completion tokens, total cost, and per-model breakdowns:
simo usage
simo usage --period week
simo usage --json --period monthsimo health
Check the operational status of the SIMOSphere AI platform including API gateway, model backends, and database health:
simo health
simo health --jsonScripting and Automation
The CLI is designed for use in scripts and CI/CD pipelines. All commands support the --json flag for machine-readable output, and exit codes follow standard conventions (0 for success, 1 for errors, 2 for usage errors).
#!/bin/bash
set -euo pipefail
# Process all markdown files in a directory
for file in docs/*.md; do
echo "Processing: $file"
simo complete --file "$file" \
--system "Summarize this document in 3 sentences." \
--model mistral-small-latest \
--output "summaries/$(basename "$file")"
done
# Check model availability before deployment
STATUS=$(simo health --json | jq -r '.status')
if [ "$STATUS" != "healthy" ]; then
echo "Platform is $STATUS — aborting deployment"
exit 1
fiEnvironment Variables
The CLI respects the following environment variables. Command-line flags always take precedence over environment variable values:
| Variable | Description |
|---|---|
SIMOSPHERE_API_KEY | API key for authentication. Required unless logged in via the keychain. |
SIMOSPHERE_BASE_URL | Override the API base URL. Defaults to https://api.simosphereai.com/v1. |
SIMOSPHERE_DEFAULT_MODEL | Default model for completions when --model is not specified. |
NO_COLOR | Disable colored output. Automatically detected in non-TTY environments. |