MoonshotAI / MoonshotAI/kimi-code

feat: support custom keybindings via config (e.g. switching permission modes)

Open
#1,524 1 comment 1 reaction 0 assignees View on GitHub

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 mode
  • Ctrl+G — external editor
  • Ctrl+S — inject input during streaming
  • Ctrl+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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.