MCPcopy Index your code
hub / github.com/64bit/commandOK

github.com/64bit/commandOK @v0.1.7

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.7 ↗ · + Follow
55 symbols 107 edges 16 files 5 documented · 9%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

⌘OK

Demo of commandOK in action

commandOK

commandOK is a Spotlight-like command generator for your terminal. Pops up when you need it and gets out of the way when you don't.

Built with Ratatui and powered by your choice of public, private or local LLM provider.

WARN: you must always verify the generated command before accepting it

Install

brew install 64bit/tap/commandok

OR

cargo install commandok

Setup

On first run, a default config is created at ~/.commandok/config.toml. Add your API key for at least one provider:

[commandok]
# Options: anthropic, openai, google, mistral, ollama, llamacpp,
#          openrouter, xai, vercel_ai_gateway, litert_lm,
#          apple_intelligence (requires building with --features apple-intelligence on macOS 26+ ARM)
provider = "anthropic"
system_prompt = """\
You are a terminal command generator. Given a natural language description, output ONLY \
the shell command appropriate for the user's OS and shell. No explanation, no markdown, no code blocks, \
no backticks. Just the raw command.\
"""

[anthropic]
api_key = ""
model = "claude-opus-4-6"

[openai]
api_key = ""
model = "gpt-5.4"

[google]
api_key = ""
model = "gemini-3-flash-preview"

[mistral]
api_key = ""
model = "mistral-small-latest"
# api_url = "https://api.mistral.ai/v1"  # default

[ollama]
model = "gemma3:1b"
# api_url = "http://localhost:11434"  # default, change if running elsewhere

[llamacpp]
model = "default"
# api_url = "http://localhost:8080"  # default, change if running elsewhere

[openrouter]
api_key = ""
model = "qwen/qwen3.6-plus:free"
# api_url = "https://openrouter.ai/api/v1"  # default

[xai]
api_key = ""
model = "grok-4.20-0309-reasoning"
# api_url = "https://api.x.ai/v1"  # default

[vercel_ai_gateway]
api_key = ""
model = "google/gemini-3-flash"
# api_url = "https://ai-gateway.vercel.sh/v1"  # default

[litert_lm]
model = "gemma-4-E2B-it.litertlm"
huggingface_repo = "litert-community/gemma-4-E2B-it-litert-lm"

[lmstudio]
model = "qwen/qwen3-coder-next"
# api_url = "http://localhost:1234"  # default, change if running elsewhere

[apple_intelligence]
model = "system"

Apple Intelligence (optional)

On macOS 26+ on Apple Silicon, commandOK can run prompts entirely on-device through Apple's FoundationModels framework. It is gated behind a Cargo feature so the default install does not require the Swift toolchain.

cargo install commandok --features apple-intelligence

Building the feature requires the Xcode Command Line Tools (xcode-select --install). At runtime, Apple Intelligence must be enabled in System Settings.

Usage

Run commandok in any terminal. A search bar appears inline below your cursor.

  1. Type a natural language description of the command you need
  2. Press Enter -- the command streams in token-by-token
  3. Press Enter again to accept (injects the command into your shell) or Esc to cancel

Keybindings

Key Action
Enter Submit prompt / Accept generated command
Esc Cancel and dismiss
Shift+Tab Cycle through configured providers
Up / Down Browse prompt history
Ctrl+U Clear input line
Ctrl+C Quit
Left / Right / Home / End Move cursor

Adding a new provider

  1. Create src/provider/yourprovider.rs with a pub async fn stream(...) function
  2. Add pub mod yourprovider; to src/provider/mod.rs
  3. Add a variant to the Provider enum and wire it in from_name() / stream()
  4. Add the section to Config in src/config.rs and PROVIDER_ORDER

License

MIT

Core symbols most depended-on inside this repo

stream
called by 12
src/provider/xai.rs
send_request
called by 10
src/provider/mod.rs
parse_sse_stream
called by 8
src/provider/mod.rs
push
called by 3
src/main.rs
next
called by 3
src/main.rs
reset_nav
called by 3
src/main.rs
config_dir
called by 2
src/config.rs
config_path
called by 2
src/config.rs

Shape

Function 29
Method 18
Class 5
Enum 3

Languages

Rust100%

Modules by API surface

src/main.rs24 symbols
src/config.rs10 symbols
src/provider/mod.rs6 symbols
src/provider/apple_intelligence.rs3 symbols
src/provider/xai.rs1 symbols
src/provider/vercel_ai_gateway.rs1 symbols
src/provider/openrouter.rs1 symbols
src/provider/openai.rs1 symbols
src/provider/ollama.rs1 symbols
src/provider/mistral.rs1 symbols
src/provider/lmstudio.rs1 symbols
src/provider/llamacpp.rs1 symbols

For agents

$ claude mcp add commandOK \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact