MoonshotAI / MoonshotAI/kimi-code
feat: support custom keybindings via config (e.g. switching permission modes)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
Problem
Currently, switching permission modes (yolo / auto / manual) in the TUI requires typing slash commands like /yolo or /perm yolo. There is no keyboard shortcut for this, and the TUI does not support user-customizable keybindings.
Only a few shortcuts are hardcoded:
Shift+Tab— toggle Plan modeCtrl+G— external editorCtrl+S— inject input during streamingCtrl+O— collapse/expand tool output
Feature Request
Add a [keybindings] section to tui.toml (or a similar config mechanism) that allows users to define custom keyboard shortcuts for built-in actions, at minimum:
- "switch-permission" — cycle through yolo / auto / manual
- "toggle-yolo" — jump directly to yolo mode
- "toggle-auto" — jump directly to auto mode
- "toggle-plan" — toggle plan mode (currently Shift+Tab is hardcoded; should be overridable)
Example config:
[keybindings]
switch_permission = "ctrl+shift+y"
toggle_plan = "ctrl+shift+p"
Use Case
Power users frequently switch between permission modes during a session (e.g. yolo for known-safe batch tasks, manual for risky operations). A single keystroke is significantly faster than typing /yolo every time, especially in fast-paced workflows.
Additional Context
This is a quality-of-life improvement. The TUI already supports a few hardcoded shortcuts, so the infrastructure for keybinding dispatch exists — this request is about making it extensible and user-configurable.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the TUI's existing hardcoded shortcuts and the permission-mode commands for their keybinding dispatch and configuration entry points. Add configurable bindings for the listed permission and plan actions, then verify that the example tui.toml mappings override the current shortcuts and trigger the intended mode changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100