27th registry variant, 2nd subscription-OAuth provider. Log in with a Claude
Pro/Max subscription via PKCE authorization-code + S256 (loopback callback on
127.0.0.1:53692, with a manual code-paste fallback), then use it against
api.anthropic.com — reusing the existing Anthropic Messages wire + Anthropic
listing + the multi-provider OAuth foundation (dbce6bf). Sourced from Pi
(earendil-works/pi auth/oauth/anthropic.ts): client 9d1c250a..., authorize
claude.ai/oauth/authorize, token platform.claude.com/v1/oauth/token, scope
'…user:inference user:sessions:claude_code…'.
New machinery (foundation handles token routing — claude-pro-max is a
uses_oauth platform so its bearer/refresh/api_key already route to its own
pooled manager, never Kimi):
- OAuthConfig gains flow{DeviceCode|PkceLocalhost} + token_host + token_body
{Form|JSON}; xai/kimi rows unchanged (DeviceCode/Form).
- auth/oauth_pkce.rs: PKCE S256 wire — loopback listener with STRICT state
validation (CSRF, fail-closed), manual-paste fallback, JSON code→token
exchange + rotating-refresh. Never logs code/verifier/tokens.
- Messages OAuth adaptation gated on SamplerConfig.anthropic_oauth (true only
for a claude-pro-max managed key): Authorization: Bearer + anthropic-beta
oauth + user-agent claude-cli + x-app cli, and the required 'You are Claude
Code' system prefix. API-key anthropic/minimax Messages requests are
BYTE-IDENTICAL (regression-guarded).
- Live /models under the OAuth Bearer + oauth-beta headers (Anthropic listing,
enriched from models.dev anthropic); persistent 401 → 0 models + WARN, NO
hardcoded fallback list (honest failure).
Adversarial review: no blocking findings (secret handling, CSRF/state, the
anthropic_oauth gate, token routing, non-regression all CONFIRMED). Full gate
green. Registry at 27; picker updated. Residual (unverifiable without a real
Claude Pro/Max account): whether GET /v1/models accepts the OAuth bearer, and
the real endpoint's acceptance of the OAuth Messages request.
kigi-tui
Terminal UI (TUI) for Kigi. Provides the interactive full-screen interface including the scrollback view, prompt input, session management, and all modal dialogs.
Architecture
src/
├── app/ # Application state and event handling
│ ├── app_view.rs # Top-level state (welcome screen, agents, config)
│ ├── agent_view/ # Per-session agent view (struct in mod.rs + per-domain impl modules)
│ ├── dispatch/ # Action → Effect dispatcher (router + per-domain modules)
│ ├── effects.rs # Async side effects (ACP calls, file I/O)
│ └── event_loop.rs # Main event loop (input, ticks, ACP messages)
├── views/ # UI components
│ ├── prompt_widget.rs # Text editor with file search, slash, history
│ ├── welcome/ # Welcome screen (logo, menu, prompt)
│ ├── extensions_modal.rs # Extensions modal (hooks, plugins, marketplace, skills, MCP servers)
│ ├── file_search/ # @-completion dropdown and line viewer
│ ├── slash_dropdown.rs# /command completion dropdown
│ └── ... # Scrollback, status bar, panes, etc.
├── scrollback/ # Message history rendering
├── slash/ # Slash command registry and built-in commands
├── appearance/ # Theme and pager.toml config
├── acp/ # Agent Communication Protocol client state
└── render/ # Low-level rendering helpers (color, wrapping, etc.)
Key Concepts
- AppView — owns the welcome screen, agent sessions, and global config
- AgentView — one per session; owns the prompt, scrollback, tool panes, and modals
- PromptWidget — text editor component with file search (
@), slash commands (/), history search, and paste elements - Action/Effect — Elm-style architecture: input → Action → dispatch → Effect → state update
Keyboard Shortcuts
| Key | Context | Action |
|---|---|---|
Ctrl+P or ? |
Agent screen | Open command palette |
Ctrl+L |
Any (non–VS Code family) | Open plugins/hooks modal; on VS Code / Cursor / Windsurf / Zed use /plugins or /hooks (Ctrl+L is mid-turn interject) |
Tab |
Prompt | Switch to scrollback |
Esc |
Turn running | No-op (does not cancel; use Ctrl+C) |
Esc Esc |
Idle, non-empty prompt | Clear prompt (within 800ms; first press shows hint) |
Esc Esc |
Idle, empty prompt + messages | Open rewind picker (silent first press) |
Ctrl+M |
Prompt | Toggle multiline mode |
Shift+Enter |
Prompt | Insert newline |
/ |
Prompt | Start slash command |
@ |
Prompt | Start file search |
! |
Prompt (empty) | Enter bash mode |
Ctrl+C |
Prompt (with text) | Clear prompt (even while turn running) |
Ctrl+C |
Prompt (empty) + turn running | Cancel running turn |
Docs
- Terminal Support & Troubleshooting — tmux/SSH truecolor, clipboard, mouse, diagnostics, /terminal-setup
- Hooks & Plugins Guide — managing hooks, plugins, and marketplace sources
- Custom Hooks Guide — creating, configuring, and writing your own hooks
- Hook Examples — sample hooks for common workflows
- Hooks Crate (
kigi-hooks) — hook runtime, event types, and execution engine - Plugin Marketplace Crate (
kigi-plugin-marketplace) — marketplace source loading, scanning, and install