{"id":47300584,"url":"https://github.com/codeitlikemiley/waz","last_synced_at":"2026-04-01T17:31:40.986Z","repository":{"id":341952523,"uuid":"1172179080","full_name":"codeitlikemiley/waz","owner":"codeitlikemiley","description":"Bring Warp Intelligence to your terminal","archived":false,"fork":false,"pushed_at":"2026-03-04T05:44:43.000Z","size":81,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-04T06:43:08.884Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeitlikemiley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-04T02:48:24.000Z","updated_at":"2026-03-04T05:44:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/codeitlikemiley/waz","commit_stats":null,"previous_names":["codeitlikemiley/waz"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/codeitlikemiley/waz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeitlikemiley%2Fwaz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeitlikemiley%2Fwaz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeitlikemiley%2Fwaz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeitlikemiley%2Fwaz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeitlikemiley","download_url":"https://codeload.github.com/codeitlikemiley/waz/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeitlikemiley%2Fwaz/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31223288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-31T04:08:55.938Z","status":"ssl_error","status_checked_at":"2026-03-31T04:08:47.883Z","response_time":111,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-17T01:38:19.993Z","updated_at":"2026-03-31T06:00:46.878Z","avatar_url":"https://github.com/codeitlikemiley.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# waz 🔮\n\n**Warp-style command prediction and command palette for any terminal.**\n\nA Rust-powered command prediction engine with ghost-text autosuggestions, an interactive **command palette TUI**, and **AI-powered command assistance** — works in any terminal emulator (Ghostty, Alacritty, Kitty, iTerm2, WezTerm, etc.).\n\nInspired by [Warp's multi-tier prediction approach](https://x.com/BHolmesDev/status/2025588198571757892).\n\n## How It Works\n\nWaz uses a **multi-tier prediction system** (same approach as Warp terminal):\n\n| Tier | Strategy | Confidence | Description |\n|------|----------|------------|-------------|\n| 0 | **Output Hint** | Highest | Parses command output for suggested follow-up commands (like Warp's ghost text from `npm install` → `npm start`). |\n| 1 | **Sequence** | High | Predicts based on command patterns. If you always run `git push` after `git commit`, it learns that. |\n| 2 | **CWD History** | Medium | Falls back to your most recently used commands in the current directory. |\n| 3 | **LLM** | Low | Uses an LLM to predict based on shell context. Supports multiple providers with key rotation. |\n\n**Proactive prediction**: Ghost text appears even on an **empty prompt** — right after a command finishes, waz suggests what you'll probably run next.\n\n## Quick Start\n\n### Build \u0026 Install\n\n```bash\nmake install\n```\n\nThis builds the release binary, installs it to `~/.cargo/bin` and `~/.local/bin`, and reminds you to reload your shell.\n\nOr manually:\n\n```bash\ncargo build --release\ncp target/release/waz ~/.local/bin/\n```\n\n### Shell Integration\n\nAdd to your shell config (**quotes are required** for Zsh/Bash):\n\n**Zsh** (`~/.zshrc`):\n```bash\neval \"$(waz init zsh)\"\n```\n\n**Bash** (`~/.bashrc`):\n```bash\neval \"$(waz init bash)\"\n```\n\n**Fish** (`~/.config/fish/config.fish`):\n```fish\nwaz init fish | source\n```\n\n### Ghostty Keybinding (Recommended)\n\nFor Ghostty users, add this to your config to launch the TUI with **Cmd+I**:\n\n```\nkeybind = super+i=text:\\x1b[119;97;122~\n```\n\nThis sends a custom escape sequence that the waz shell integration picks up.\n\n### Import Existing History\n\nBootstrap predictions from your existing shell history:\n\n```bash\nwaz import              # auto-detect all shells\nwaz import --shell zsh  # import from specific shell\n```\n\nSupports custom `$HISTFILE` locations (e.g., `~/.config/zsh/.zsh_history`).\n\n## Usage\n\nOnce installed, waz works automatically:\n\n### Zsh (Full Ghost Text)\n- **Ghost text appears** as you type — dim gray suggestions\n- **Ghost text appears on empty prompt** — proactive next-command prediction\n- **Right arrow** → Accept full suggestion\n- **Alt+F** → Accept next word\n\n### Bash / Fish\n- **Ctrl+Space** → Fill in the predicted command\n\n### CLI Commands\n\n```bash\nwaz predict --cwd .                        # Proactive prediction (no prefix)\nwaz predict --prefix \"git\" --format json   # Prediction with prefix\nwaz record -- \"git push\"                   # Manually record a command\nwaz stats                                  # Show database statistics\nwaz generate brew                          # Generate TMP schema for a CLI tool\nwaz generate brew --verify                 # Review \u0026 approve schema in TUI\nwaz generate brew --history                # Show schema version history\nwaz schema list                            # List all installed schemas\nwaz schema share cargo                     # Export shareable schema\nwaz schema import ./brew-schema.json       # Install shared schema\nwaz schema keywords psql postgres database # Set custom AI trigger keywords\nwaz resolve \"run the backend\" --tool cargo # AI + TMP grounded command\nwaz session-id                             # Generate a new session ID\n```\n\n---\n\n## Command Palette (TUI)\n\nA **Warp-like unified command palette** built with `ratatui`. Launch it with:\n\n| Trigger | Where |\n|---------|-------|\n| **Cmd+I** | Ghostty (via custom escape sequence) |\n| **Ctrl+T** | Any terminal |\n| `waz tui` | Manual launch |\n\nThe TUI starts in an **Empty** state showing mode hints. Type a prefix to enter a mode:\n\n### Three Modes\n\n| Mode | Prefix | What it does |\n|------|--------|------|\n| **TMP** | `/` | Context-aware command palette with token forms |\n| **Shell** | `!` | Direct shell command input |\n| **AI** | *(any text)* | Natural language → AI suggests runnable commands |\n\n### Navigation\n\n| Key | Action |\n|-----|--------|\n| **Esc** | Go back one layer (see below) |\n| **Backspace** (empty input) | Return to Empty mode |\n| **Cmd+Backspace** / **Ctrl+U** | Clear entire input line |\n| **↑ / ↓** | Navigate command list |\n| **Tab** | Select command / next token field |\n| **Shift+Tab** | Previous token field |\n| **Enter** | Run selected command |\n| **1-9** | Quick-select AI command by number |\n\n### Layered Escape\n\nEach Esc press peels back one layer — never dumps you out unexpectedly:\n\n```\nPlaceholder editing → Command selection → AI conversation → Empty mode → Quit\n```\n\n---\n\n### TMP Mode (`/`)\n\nContext-aware command palette powered by **unified JSON schemas**. On first launch, curated schemas are auto-installed. Additional schemas can be AI-generated or imported.\n\n#### Built-in Curated Schemas (6)\n\n| Schema | Commands | Dynamic Data Sources |\n|--------|----------|---------------------|\n| `cargo` | 12 | bins, features, packages, profiles, tests, benches from `Cargo.toml` |\n| `git` | 12 | branches, remotes from local repo |\n| `npm` | 8 | scripts from `package.json` |\n| `bun` | 8 | scripts from `package.json` |\n| `npx` | 1 | — |\n| `bunx` | 1 | — |\n\nSchemas are **contextual** — cargo commands only appear when `Cargo.toml` exists, npm/bun when `package.json` exists. Git is always available.\n\n#### AI-Generated Schemas\n\n| Source | Commands Loaded |\n|--------|----------------|\n| `~/.config/waz/schemas/*.json` | **Any CLI tool** — AI-generated or imported schemas (see [Schema Generation](#schema-generation)) |\n\n#### Smart Filtering\n\nType to filter — uses **score-based ranking** that prioritizes subcommand names:\n\n```\n/commit   → git commit (exact match, ranked first)\n/git com  → git commit (full command match)\n/build    → cargo build (subcommand match)\n/install  → brew install (from generated schema)\n```\n\nDescription-only matches are excluded to avoid false positives.\n\n#### Token Form\n\nWhen selecting a command with arguments:\n- **Boolean tokens** → toggle with `Space`/`y`/`n`, `Tab` cycles\n- **Enum tokens** → `Tab` cycles through values (packages, scripts, branches)\n- **String tokens** → free-text input\n- **Live preview** → shows the resolved command as you fill tokens\n\n---\n\n### AI Mode (natural language)\n\nJust start typing a question — waz auto-detects natural language:\n\n```\nhow to create a new database in psql\nfind large files over 100mb\nrun my rust app\n```\n\nThe AI responds with an explanation and **numbered command suggestions**.\n\n#### Smart TMP Integration\n\nAI mode automatically uses **TMP schemas for grounded results** when it detects a relevant tool:\n\n| Detection Method | Priority | Example |\n|-----------------|----------|--------|\n| **Query keywords** | Highest | \"list psql tables\" → uses psql schema |\n| **Custom keywords** | High | \"show database tables\" → psql (if \"database\" is a keyword) |\n| **CWD project files** | Medium | Cargo.toml present → uses cargo schema |\n| **General AI** | Fallback | \"what is rust?\" → plain AI answer |\n\nWhen TMP is used, results show a `[TMP]` tag and commands are grounded in real data (actual package names, branches, etc.).\n\n```\n🔮 waz:\n  [TMP] Runs the 'waz' binary from the current workspace.\n\nCommands:\n▸ [1] cargo run --bin waz\n       bin = waz (from Cargo.toml)\n```\n\n#### Selecting Commands\n\n- Press **1-9** to quick-select by number\n- Use **↑/↓** and **Enter** to select\n\n#### Placeholder Editing\n\nIf the AI suggests a command with placeholders (e.g., `psql -U \u003cusername\u003e -c \"CREATE DATABASE \u003cdb_name\u003e\"`), waz detects them and shows an **inline editing form**:\n\n```\n⌨ Fill in placeholders:\n\n→ psql -U postgres -c \"CREATE DATABASE \u003cdb_name\u003e\"\n\n  username: postgres█\n  db_name:\n```\n\n- **Tab** / **Shift+Tab** → navigate between fields\n- **Live preview** updates as you type\n- **Enter** → run the resolved command\n- **Esc** → back to command selection (pick a different command)\n\n#### Continuing the Conversation\n\nAfter getting AI results:\n- Press **Esc** once → exit command selection, type a new question\n- Press **Esc** twice → clear AI conversation, start fresh\n- Just start typing → clears old response, asks new question\n\n---\n\n### Shell Mode (`!`)\n\nDirect shell command input — type `!` followed by any command:\n\n```\n!docker compose up -d\n!kubectl get pods\n```\n\nPress **Enter** to execute immediately.\n\n---\n\n## Schema System\n\nWaz uses a **unified JSON schema system** for all CLI tool commands. Six curated schemas ship built-in, and you can generate schemas for any tool using AI, or import schemas shared by others.\n\n### Curated Schemas\n\nOn first TUI launch (or manually with `--init`), curated schemas are auto-installed:\n\n```bash\nwaz generate cargo --init    # Install all 6 curated schemas\n```\n\n### AI-Powered Generation\n\nGenerate schemas for **any CLI tool** using AI:\n\n```bash\nwaz generate brew                              # Generate with default model\nwaz generate kubectl --model gemini-2.5-pro    # Use specific AI model\nwaz generate docker --force                    # Regenerate (versions old first)\n```\n\nHow it works:\n1. Runs `\u003ctool\u003e --help` and recursively `\u003ctool\u003e \u003csubcommand\u003e --help` (up to 20 subcommands)\n2. Sends the help output to your configured LLM (Gemini by default)\n3. AI extracts commands, flags, and argument types into a structured `SchemaFile`\n4. Schema is saved to `~/.config/waz/schemas/\u003ctool\u003e.json` with metadata\n5. Next TUI launch, the commands appear alongside curated ones\n\n### Schema Verification TUI\n\nReview and approve schemas before using them:\n\n```bash\nwaz generate brew --verify\n```\n\nOpens a **two-pane TUI** for human-in-the-loop review:\n\n| Key | Action |\n|-----|--------|\n| `j`/`k` or `↑`/`↓` | Navigate commands/tokens |\n| `Space` | Toggle command verified ✅ |\n| `Tab` | Switch between Commands / Tokens panes |\n| `n`/`d`/`f` | Edit token name / description / flag |\n| `r` | Toggle required / optional |\n| `t` | Cycle token type (String → Boolean → Enum → File → Number) |\n| `x` | Test data source live (runs resolver, shows results) |\n| `a` / `Del` | Add / delete token |\n| `Ctrl+V` | Verify all commands at once |\n| `s` | Save changes to JSON |\n| `q` | Quit |\n\n### Schema Management\n\nList, share, import, and configure schemas:\n\n```bash\nwaz schema list                      # Show all installed schemas\nwaz schema share cargo               # Export portable .json to CWD\nwaz schema import ./brew-schema.json  # Install from file\nwaz schema import https://example.com/schema.json  # Install from URL\nwaz schema keywords psql             # Show current keywords for psql\nwaz schema keywords psql postgres postgresql database db  # Set keywords\n```\n\n### Schema Keywords\n\nKeywords tell AI mode which schema to use when you mention certain words in your query:\n\n```bash\nwaz schema keywords psql postgres postgresql database db tables\nwaz schema keywords cargo rust crate package\nwaz schema keywords brew homebrew formula\n```\n\n**How matching works:**\n1. **Exact tool name** — \"install with brew\" → brew schema (always works)\n2. **Custom keywords** — \"show database tables\" → psql schema (if \"database\" is a keyword)\n3. **Built-in aliases** — \"install with homebrew\" → brew (hardcoded alias)\n4. **CWD project files** — Cargo.toml exists → cargo schema\n\nKeywords are stored in the schema's `meta.keywords` field and persist across regenerations.\n\n`waz schema list` output:\n```\nTool         Ver    Status     Cmds     Source Coverage\n────────────────────────────────────────────────────────\nbun          v1    ✅ verified 8/8      curated full\ncargo        v1    ✅ verified 12/12    curated full\ngit          v1    ✅ verified 12/12    curated full\nnpm          v1    ✅ verified 8/8      curated full\n```\n\n**Share** strips runtime-resolved values (keeps data source definitions so importers resolve locally).  \n**Import** auto-backups existing schemas before overwriting.\n\n### Export Built-in Schemas\n\nExport the battle-tested Rust-based cargo/git/npm schemas to JSON:\n\n```bash\nwaz generate cargo --export   # From a Cargo project directory\nwaz generate git --export\nwaz generate npm --export\n```\n\n### Schema Versioning\n\nEvery `--force` regeneration auto-versions the old schema. Full version history:\n\n```bash\nwaz generate brew --history\n# 📋 Version history for 'brew' (3 versions):\n# ─────────────────────────────────────────\n#   v1   │ 2h ago          │ 15 commands\n#   v2   │ 1h ago          │ 12 commands\n#   v3   │ 5m ago          │ 14 commands ← latest\n```\n\nRollback to any version:\n\n```bash\nwaz generate brew --rollback       # Restore latest versioned backup\nwaz generate brew --rollback 1     # Restore specific version\n```\n\nOn `--force`, a **colorized diff** is shown:\n- 🟢 `+ brew search` — new command added\n- 🔴 `- brew cleanup` — command removed\n- 🟡 `~ brew install` — tokens changed\n\nIf generation fails, the previous version is **auto-restored**.\n\n### Dynamic Data Sources\n\nSchemas support two kinds of dynamic data sources:\n\n**Shell commands** — run at TUI load time:\n```json\n{\n  \"name\": \"formula\",\n  \"token_type\": \"Enum\",\n  \"data_source\": { \"command\": \"brew list --formula\", \"parse\": \"lines\" }\n}\n```\n\n**Built-in resolvers** — use waz's optimized Rust parsers:\n```json\n{\n  \"name\": \"feature\",\n  \"token_type\": \"Enum\",\n  \"data_source\": { \"resolver\": \"cargo:features\", \"parse\": \"lines\" }\n}\n```\n\nAvailable resolvers: `cargo:bins`, `cargo:examples`, `cargo:packages`, `cargo:features`, `cargo:profiles`, `cargo:tests`, `cargo:benches`, `git:branches`, `git:remotes`, `npm:scripts`.\n\n### SchemaFile Format\n\nAll schemas use a unified `SchemaFile` format with metadata:\n\n```json\n{\n  \"meta\": {\n    \"tool\": \"cargo\",\n    \"version\": 1,\n    \"generated_by\": \"human\",\n    \"verified\": true,\n    \"coverage\": \"full\",\n    \"requires_file\": \"Cargo.toml\",\n    \"requires_binary\": \"cargo\",\n    \"keywords\": [\"rust\", \"crate\", \"package\"]\n  },\n  \"commands\": [ ... ]\n}\n```\n\n### Storage Layout\n\n```\n~/.config/waz/schemas/\n├── cargo.json                ← active curated schema\n├── git.json\n├── npm.json\n├── bun.json\n├── brew.json                 ← AI-generated\n├── versions/\n│   ├── brew/\n│   │   ├── v1.json\n│   │   └── v2.json\n│   └── cargo/\n│       └── v1.json\n```\n\n---\n\n## AI Assistant (CLI)\n\nAsk natural language questions directly from the command line:\n\n```bash\n# Just type a question as a command — waz intercepts it automatically\nhow to find large files\n\n# Or use the ask command explicitly\nwaz ask \"how to uninstall a package with homebrew\"\nwaz ask --json \"how to search in files\"   # Structured JSON output\n```\n\n### Grounded Resolve (AI + TMP)\n\nFor **precise, non-hallucinated commands**, use `waz resolve` which combines AI with TMP schemas:\n\n```bash\nwaz resolve \"run the backend package\" --tool cargo\n# 🎯 Runs the waz binary from the workspace.\n# cargo run --bin waz\n#    bin = waz (from Cargo.toml)\n#    confidence: high\n\nwaz resolve \"list all tables\" --tool psql\nwaz resolve \"switch to main branch\"   # auto-detects git\nwaz resolve \"install react\" --json    # structured JSON output\n```\n\n**How it works:**\n1. Loads the specified (or auto-detected) TMP schema\n2. Resolves data sources (`cargo:packages`, `git:branches`, etc.) for real values\n3. Builds a schema-aware prompt with actual valid values\n4. AI picks the best command and fills tokens using only real data\n\nThis prevents hallucination — the AI can only use values that actually exist in your project.\n\n### History Management\n\n```bash\nwaz clear            # Clear history for current directory\nwaz clear --all      # Clear ALL history across all directories\n```\n\n---\n\n## LLM Providers\n\nTier 3 uses an LLM when local history can't produce a prediction. Waz supports **6 providers**:\n\n| Provider | Default Model | Base URL | Free Tier |\n|----------|---------------|----------|-----------|\n| **Gemini** | `gemini-3.1-flash-lite-preview` | `generativelanguage.googleapis.com` | 50 req/day |\n| **GLM (z.ai)** | `glm-4.7` | `api.z.ai` | Free for dev use |\n| **Qwen (Alibaba)** | `qwen3.5-plus` | `dashscope-intl.aliyuncs.com` | 1M tokens free |\n| **MiniMax** | `MiniMax-M2.5` | `api.minimax.io` | Free credits |\n| **OpenAI** | `gpt-4o-mini` | `api.openai.com` | Paid only |\n| **Ollama** | `llama3.2` | `localhost:11434` | Local, always free |\n\n### Zero-Config Setup\n\nJust export your API key — waz auto-detects it:\n\n```bash\n# Any ONE of these is enough to enable LLM predictions:\nexport GEMINI_API_KEY=\"your-key\"       # Google Gemini\nexport GLM_API_KEY=\"your-key\"          # z.ai GLM\nexport DASHSCOPE_API_KEY=\"your-key\"    # Alibaba Qwen\nexport MINIMAX_API_KEY=\"your-key\"      # MiniMax\nexport OPENAI_API_KEY=\"your-key\"       # OpenAI\n```\n\nMultiple env vars? Waz creates a provider for each and uses **fallback** strategy by default.\n\n---\n\n## Multi-Provider Configuration\n\nFor advanced control, create `~/.config/waz/config.toml`:\n\n### Single Provider (Simplest)\n\nUse only Gemini, nothing else:\n\n```toml\n[llm]\nstrategy = \"single\"\ndefault = \"gemini\"\n\n[[llm.providers]]\nname = \"gemini\"\nkeys = [\"your-gemini-key\"]\n```\n\n### Fallback Strategy (Default)\n\nTry providers in order — if one fails (rate limit, timeout), try the next:\n\n```toml\n[llm]\nstrategy = \"fallback\"\norder = [\"gemini\", \"glm\", \"qwen\", \"minimax\"]\ntimeout_secs = 3\n\n[[llm.providers]]\nname = \"gemini\"\nkeys = [\"gemini-key-1\"]\n\n[[llm.providers]]\nname = \"glm\"\nkeys = [\"glm-key-1\"]\n\n[[llm.providers]]\nname = \"qwen\"\nkeys = [\"dashscope-key-1\"]\nmodel = \"qwen3.5-plus\"\n```\n\n\u003e If Gemini hits its 50 req/day limit → automatically falls back to GLM → then Qwen.\n\n### Round-Robin Strategy\n\nSpread requests evenly across providers:\n\n```toml\n[llm]\nstrategy = \"round-robin\"\norder = [\"gemini\", \"glm\", \"qwen\"]\n\n[[llm.providers]]\nname = \"gemini\"\nkeys = [\"key-1\"]\n\n[[llm.providers]]\nname = \"glm\"\nkeys = [\"key-1\"]\n\n[[llm.providers]]\nname = \"qwen\"\nkeys = [\"key-1\"]\n```\n\n\u003e Request 1 → Gemini, Request 2 → GLM, Request 3 → Qwen, Request 4 → Gemini...\n\n### Multiple Keys Per Provider\n\nRotate keys within a single provider (useful for multiple free-tier accounts):\n\n```toml\n[llm]\nstrategy = \"single\"\ndefault = \"gemini\"\n\n[[llm.providers]]\nname = \"gemini\"\nkeys = [\"account-1-key\", \"account-2-key\", \"account-3-key\"]\nmodel = \"gemini-3.1-flash-lite-preview\"\n```\n\n\u003e Each request uses the next key: key1 → key2 → key3 → key1...\n\n### Combo: Multiple Providers + Multiple Keys\n\nMaximum free-tier usage — rotate keys AND providers:\n\n```toml\n[llm]\nstrategy = \"fallback\"\norder = [\"gemini\", \"glm\", \"qwen\", \"minimax\"]\n\n[[llm.providers]]\nname = \"gemini\"\nkeys = [\"gemini-acct-1\", \"gemini-acct-2\"]\nmodel = \"gemini-3.1-flash-lite-preview\"\n\n[[llm.providers]]\nname = \"glm\"\nbase_url = \"https://api.z.ai/api/paas/v4\"\nkeys = [\"glm-key-1\", \"glm-key-2\"]\nmodel = \"glm-4.7\"\n\n[[llm.providers]]\nname = \"qwen\"\nbase_url = \"https://dashscope-intl.aliyuncs.com/compatible-mode/v1\"\nkeys = [\"qwen-key-1\"]\nmodel = \"qwen3.5-plus\"\n\n[[llm.providers]]\nname = \"minimax\"\nbase_url = \"https://api.minimax.io/v1\"\nkeys = [\"mm-key-1\"]\nmodel = \"MiniMax-M2.5\"\n```\n\n### How Env Vars Interact with Config\n\nEnv vars are **additive** — they add to the key pool, never override:\n\n| Setup | Key Pool |\n|-------|----------|\n| Only `GEMINI_API_KEY=\"A\"` | `[\"A\"]` — 1 key |\n| Only config `keys = [\"A\", \"B\"]` | `[\"A\", \"B\"]` — 2 keys |\n| Env `\"C\"` + config `[\"A\", \"B\"]` | `[\"A\", \"B\", \"C\"]` — 3 keys |\n| Env `\"A\"` + config `[\"A\", \"B\"]` | `[\"A\", \"B\"]` — deduped |\n\n### Custom Provider (Any OpenAI-Compatible API)\n\nAny service with an OpenAI-compatible `/v1/chat/completions` endpoint works:\n\n```toml\n[[llm.providers]]\nname = \"custom\"\nbase_url = \"https://your-api-endpoint.com/v1\"\nkeys = [\"your-key\"]\nmodel = \"your-model-name\"\n```\n\n---\n\n## Architecture\n\n```\n┌─────────────────────────────────────────────────────┐\n│              Shell Integration Layer                │\n│  ┌─────────┐  ┌──────────┐  ┌────────────┐         │\n│  │   Zsh   │  │   Bash   │  │    Fish    │         │\n│  │  (ZLE)  │  │(readline)│  │  (events)  │         │\n│  └────┬────┘  └────┬─────┘  └─────┬──────┘         │\n│       │            │              │                 │\n│  Cmd+I / Ctrl+T launches unified TUI                │\n│  Ghost-text autosuggestions via predictions          │\n│  Output capture → hint suggestions (Tier 0)         │\n└───────┼────────────┼───────────────┼────────────────┘\n        └────────────┼───────────────┘\n                     │\n         ┌───────────▼───────────┐\n         │    waz binary (Rust)  │\n         │                       │\n         │  ┌─ Prediction ───────┤\n         │  │  Tier 0: Output   │\n         │  │  Tier 1: Sequence  │\n         │  │  Tier 2: CWD      │\n         │  │  Tier 3: LLM      │\n         │  ├─ Unified TUI ─────┤\n         │  │  / → TMP mode     │\n         │  │  ! → Shell mode   │\n         │  │  text → AI mode   │\n         │  │  Placeholder edit │\n         │  │  Score filtering  │\n         │  ├─ Schema System ───┤\n         │  │  6 curated JSON   │\n         │  │  AI-powered gen   │\n         │  │  Verify TUI       │\n         │  │  Share/import     │\n         │  │  Version control  │\n         │  │  Built-in resolvers│\n         │  ├─ AI Assistant ────┤\n         │  │  Structured JSON  │\n         │  │  Command resolver │\n         │  └────────────────────┤\n         │                       │\n         │     SQLite History    │\n         └───────────────────────┘\n```\n\n## Data Storage\n\n- **History DB**: `~/Library/Application Support/waz/history.db` (macOS) / `~/.local/share/waz/history.db` (Linux)\n- **Rotation state**: `~/Library/Application Support/waz/rotation.json`\n- **Config**: `~/.config/waz/config.toml`\n- **Curated Schemas**: `schemas/curated/*.json` (bundled in repo, auto-copied on first run)\n- **Active Schemas**: `~/Library/Application Support/waz/schemas/*.json` (installed schemas)\n- **Schema Versions**: `~/Library/Application Support/waz/schemas/versions/\u003ctool\u003e/v1.json ...`\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeitlikemiley%2Fwaz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeitlikemiley%2Fwaz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeitlikemiley%2Fwaz/lists"}