-
-
Notifications
You must be signed in to change notification settings - Fork 2
cmd ai
Manage the ɳSelf AI plugin and local LLM stack.
nself ai <subcommand> [flags] [args]
nself ai manages the local Ollama runtime that powers zero-config inference. It groups three areas: the local Ollama stack (install, models, health, swap, benchmark), a one-shot chat for quick verification, and the Gemini API key pool for cloud routing.
For provider key management and AI request routing, use nself gateway (wired to nself-ai-gateway at port 3761). For PTY session relay commands, use nself claw session (wired to nself-ai-cc at port 3760).
The ai local subtree installs and inspects an Ollama daemon and the small set of models recommended for the host RAM tier. ai pool manages auto-provisioned Gemini keys (OAuth-onboarded Google accounts, GCP project creation, key rotation, daily quota tracking) so the gateway always has free or near-free capacity.
Most flags are non-destructive. Pulling models requires network access. Pool subcommands talk to the nself-ai-gateway plugin over its internal HTTP API; if the plugin is not running, commands report a clear error.
| Name | Description |
|---|---|
local install |
Install Ollama, systemd service, firewall, and recommended models |
local models list |
List installed and registered local models with diff |
local models add <model> |
Pull a model via Ollama and register with nself-ai-gateway |
local models remove <model> |
Soft-delete a local model and uninstall from Ollama |
local models recommend |
Print recommended models for this host |
local health |
Show Ollama and nself-ai-gateway health |
local swap <model> |
Hot-swap the default model for a task |
local benchmark [model] |
Run benchmark prompts against one or more models |
chat <message> |
Send a quick chat message to the local AI |
pool init |
Interactive wizard: add a Google account and auto-provision a Gemini key |
pool status |
Show pool status (keys, usage, capacity) |
pool provision |
Non-interactive provision using stored refresh token |
pool add |
Add a Google account via OAuth (opens browser) |
pool remove |
Remove a key from the pool (soft-revoke + optional GCP delete) |
pool rotate |
Rotate a key (create new GCP key, revoke old) |
pool test |
Test one or all keys with a 1-token Gemini request |
pool daily-reset |
Manually trigger the daily counter reset |
Top-level nself ai exposes no flags; flags belong to each subcommand.
| Flag | Default | Description |
|---|---|---|
--yes |
false | Non-interactive mode |
--no-models |
false | Skip model pulls |
--model |
"" |
Pull only this model |
--bind |
"" |
host:port to bind Ollama to |
--json |
false | Emit JSON output |
| Flag | Default | Description |
|---|---|---|
--installed |
false | Show only installed |
--registered |
false | Show only registered |
--json |
false | Emit JSON output |
| Flag | Default | Description |
|---|---|---|
--task |
chat |
Comma-separated task classes |
--default |
false | Set as default for the tasks |
| Flag | Default | Description |
|---|---|---|
--force |
false | Remove even if default |
| Flag | Default | Description |
|---|---|---|
--tier |
auto |
Force a tier (auto, minimal, balanced, max) |
| Flag | Default | Description |
|---|---|---|
--watch |
false | Re-poll every 2s |
--json |
false | Emit JSON output |
| Flag | Default | Description |
|---|---|---|
--task |
chat |
Task: chat, embed, classify, or all
|
--reason |
"" |
Free-text reason (audit log) |
| Flag | Default | Description |
|---|---|---|
--tasks |
chat |
Comma-separated tasks |
--iterations |
5 |
Iterations per task |
| Flag | Default | Description |
|---|---|---|
--model |
"" |
Model to use (default: AI_DEFAULT_MODEL or gemma2:2b) |
--json |
false | Emit JSON output |
| Flag | Default | Description |
|---|---|---|
--json |
false | Emit JSON output |
--verbose |
false | Show per-key details |
| Flag | Default | Description |
|---|---|---|
--account |
"" |
Google account email (required) |
| Flag | Default | Description |
|---|---|---|
--account |
"" |
Google account email hint |
| Flag | Default | Description |
|---|---|---|
--account |
"" |
Remove by Google account email |
--key-id |
"" |
Remove by key index |
| Flag | Default | Description |
|---|---|---|
--key-id |
"" |
Key index to rotate (required) |
| Flag | Default | Description |
|---|---|---|
--key-id |
"" |
Test a specific key |
--all |
false | Test all keys |
| Flag | Default | Description |
|---|---|---|
--dry-run |
false | Show what would reset without resetting |
# Install Ollama and pull recommended models for this host
nself ai local install --yes
# Send a quick verification chat
nself ai chat "hello"
# See what models are recommended for the host RAM tier
nself ai local models recommend
# Pull and register a model, set as default for chat
nself ai local models add llama3.2:3b --default
# Onboard a new Google account and auto-provision a Gemini key
nself ai pool init
# Check pool capacity
nself ai pool status --verbose- cmd-claw, ɳClaw assistant control plane
- cmd-doctor, diagnose AI runtime issues
- cmd-plugin, install or update the AI plugin
- Commands, full command index
ɳSelf CLI v1.0.9. MIT licensed. Docs CC BY 4.0.
GitHub · Issues · Discussions · nself.org · docs.nself.org
Getting Started
Commands
- Commands, Overview
- Lifecycle: cmd-init · cmd-build · cmd-start · cmd-stop · cmd-restart · cmd-dev
- Monitoring: cmd-status · cmd-logs · cmd-health · cmd-urls · cmd-doctor · cmd-monitor · cmd-alerts · cmd-sentry · cmd-watchdog · cmd-dogfood
- Data: cmd-db · cmd-backup · cmd-dr · cmd-queue · cmd-webhooks
- Config: cmd-config · cmd-service · cmd-env · cmd-promote
- Networking: cmd-ssl · cmd-trust · cmd-dns-setup
- Security: cmd-security · cmd-secrets · cmd-waf
- Tenancy: cmd-tenant · cmd-billing
- Plugins: cmd-plugin · cmd-license
- AI: cmd-ai · cmd-claw · cmd-model
- Templates: cmd-template
- Utilities: cmd-exec · cmd-clean · cmd-reset · cmd-update · cmd-upgrade · cmd-version · cmd-admin · cmd-migrate · cmd-migrate-firebase · cmd-migrate-supabase · cmd-completion
Features
- Features, Overview
- Feature-Auth
- Feature-Storage
- Feature-Search
- Feature-Functions
- Feature-Email
- Feature-Monitoring
- Feature-Plugins
- Feature-ɳClaw, AI Assistant
- Feature-ɳChat, Messaging
- Feature-ɳTV, Media Player
- Feature-ɳFamily, Family Social
- Feature-ɳCloud, Managed Hosting
- Feature-Memory-Rooms, Knowledge Organization
- Feature-Agent-Dashboard, Agent Metrics
- Feature-Image-Generation, AI Image Generation
Configuration
- Configuration, Overview
- Config-Env-Vars
- Config-Postgres
- Config-Hasura
- Config-Auth
- Config-Nginx
- Config-Optional-Services
- Config-Custom-Services
- Config-System
Plugins (87 + 10 monitoring)
Free (25)
- plugin-backup
- plugin-content-acquisition
- plugin-content-progress
- plugin-cron
- plugin-donorbox
- plugin-feature-flags
- plugin-github
- plugin-github-runner
- plugin-invitations
- plugin-jobs
- plugin-link-preview
- plugin-mdns
- plugin-mlflow
- plugin-monitoring
- plugin-notifications
- plugin-notify
- plugin-paypal
- plugin-search
- plugin-shopify
- plugin-stripe
- plugin-subtitle-manager
- plugin-tokens
- plugin-torrent-manager
- plugin-vpn
- plugin-webhooks
Pro (62)
- plugin-access-controls
- plugin-activity-feed
- plugin-admin-api
- nself-ai-gateway
- nself-ai-cc
- nself-ai-mcp
- plugin-analytics
- plugin-auth
- plugin-backup-pro
- plugin-bots
- plugin-browser
- plugin-calendar
- plugin-cdn
- plugin-chat
- plugin-claw
- plugin-claw-budget
- plugin-claw-news
- plugin-claw-web
- plugin-cloudflare
- plugin-cms
- plugin-compliance
- plugin-cron-pro
- plugin-ddns
- plugin-devices
- plugin-documents
- plugin-donorbox-pro
- plugin-entitlements
- plugin-epg
- plugin-file-processing
- plugin-game-metadata
- plugin-geocoding
- plugin-geolocation
- plugin-google
- plugin-home
- plugin-idme
- plugin-knowledge-base
- plugin-linkedin
- plugin-livekit
- plugin-media-processing
- plugin-meetings
- plugin-moderation
- plugin-mux
- plugin-notify-pro
- plugin-object-storage
- plugin-observability
- plugin-paypal-pro
- plugin-photos
- plugin-podcast
- plugin-post
- plugin-realtime
- plugin-recording
- plugin-retro-gaming
- plugin-rom-discovery
- plugin-shopify-pro
- plugin-social
- plugin-sports
- plugin-stream-gateway
- plugin-streaming
- plugin-stripe-pro
- plugin-support
- plugin-tmdb
- plugin-voice
- plugin-web3
- plugin-workflows
Planned (26)
plugin-auditplugin-blogplugin-checkoutplugin-commerceplugin-drmplugin-exportplugin-flowplugin-importplugin-ldapplugin-mailgunplugin-mediaplugin-oauth-providersplugin-pagesplugin-postmarkplugin-rate-limitplugin-reportsplugin-samlplugin-schedulerplugin-sendgridplugin-ssoplugin-subscriptionplugin-thumbplugin-transcoderplugin-twilioplugin-wafplugin-watermark
Guides
- Guide-Production-Deployment
- Guide-SSL-Setup
- Guide-Multi-Tenancy
- Guide-Security-Hardening
- Guide-Monitoring-Setup
- Guide-Backup-Restore
- Guide-Custom-Services
- Guide-Migration-from-v1
Architecture
Reference
- API-Reference
- reference-error-codes, Error Codes
Licensing
Security
Brand
Operations
- operations/release-cascade, Release Cascade
- operations/self-healing, Self-Healing Schema
- operations/redis-tuning, Redis Pool Tuning
- operations/meilisearch-warmup, MeiliSearch Warm-Up
- operations/jwt-rotation, JWT Key Rotation
- operations/windows-wsl2-setup, Windows / WSL2 Setup
- operations/gemini-oauth-reauth, Gemini OAuth Reauth
Contributing
Admin
- USER-ACTION-QUEUE, Pending Admin Actions