Title: feat: add configurable keybinds for slash commands by al4xdev · Pull Request #214 · lessweb/deepcode-cli · GitHub
Open Graph Title: feat: add configurable keybinds for slash commands by al4xdev · Pull Request #214 · lessweb/deepcode-cli
X Title: feat: add configurable keybinds for slash commands by al4xdev · Pull Request #214 · lessweb/deepcode-cli
Description: feat: add configurable keybinds for slash commands Summary Add a keybinds settings field that maps keyboard shortcuts directly to slash command actions, so users can trigger commands like /exit, /new, /skills without typing /. Also adds a /keybind slash command for runtime management (add/remove/list). Motivation Currently, all slash commands require typing /command + Enter. For frequent operations (exiting, starting a new session, opening the skills list), a keyboard shortcut is faster and more ergonomic. This feature lets users configure their own shortcuts and manage them at runtime without editing JSON by hand. Design Configuration New top-level field settings.keybinds: { "keybinds": { "ctrl+e": "exit", "ctrl+n": "new", "ctrl+s": "skills", "ctrl+m": "model" } } Shortcut format: ctrl+key, ctrl+shift+key, or meta+key Action value: any slash command name or skill name Project settings override user settings per shortcut key Custom keybinds only fire when no dropdown/menu is open (avoids conflicts) Runtime management The /keybind slash command supports three subcommands: /keybind add ctrl+e exit /keybind remove ctrl+e /keybind list Changes are persisted to settings.json immediately and take effect without restarting. Architecture The feature follows the same pattern as statusline and enabledSkills: Core layer (packages/core/src/settings.ts): KeybindMap type, normalizeKeybinds(), mergeKeybinds(), integration into resolveSettingsSources() Parser (packages/cli/src/ui/core/keybinds.ts): matchKeybind() converts shortcut strings (e.g. "ctrl+shift+g") into exact-modifier predicates against InputKey; buildKeybindMatchers() pre-compiles a map for fast per-keystroke lookup Input integration (PromptInput.tsx): keybinds are checked before hardcoded shortcuts, resolving the action name to a SlashCommandItem and dispatching via handleSlashSelection() Slash command (slash-commands.ts): new "keybind" kind with subcommand parsing in handleKeybindCommand(), reading/writing settings with project-over-user fallback Files Changed File Description packages/core/src/settings.ts +26 — KeybindMap type, normalize/merge, resolved settings packages/core/src/index.ts +1 — export KeybindMap packages/core/src/tests/settings-and-notify.test.ts +47 — 4 keybind merge/normalize tests packages/cli/src/ui/core/keybinds.ts New — parser module (42 lines) packages/cli/src/ui/core/slash-commands.ts +7 — "keybind" kind + built-in command packages/cli/src/ui/views/PromptInput.tsx +130 — keybind matchers memo, input integration, /keybind handler packages/cli/src/ui/views/App.tsx +7 — pass keybinds prop + onKeybindsChanged callback packages/cli/src/ui/index.ts +5 — barrel exports packages/cli/src/tests/keybinds.test.ts New — 19 unit tests packages/cli/src/tests/slash-commands.test.ts +1 — add "keybind" to built-in names docs/configuration.md +21 — Chinese docs docs/configuration_en.md +21 — English docs Verification npm run check — typecheck 0 errors, lint 0 errors (1 pre-existing warning), format clean npm test — 269 tests, 0 fail npm run build — successful
Open Graph Description: feat: add configurable keybinds for slash commands Summary Add a keybinds settings field that maps keyboard shortcuts directly to slash command actions, so users can trigger commands like /exit, /n...
X Description: feat: add configurable keybinds for slash commands Summary Add a keybinds settings field that maps keyboard shortcuts directly to slash command actions, so users can trigger commands like /exit, /n...
Opengraph URL: https://github.com/lessweb/deepcode-cli/pull/214
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:02fd00fa-299a-f80c-944b-f6088af53030 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A176:4EB5C:728E9:98385:6A4D8F2D |
| html-safe-nonce | 80a0688dd626f5f47af4275413a2dfc16f1f34758afe2f5338eb773199e01543 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTc2OjRFQjVDOjcyOEU5Ojk4Mzg1OjZBNEQ4RjJEIiwidmlzaXRvcl9pZCI6IjQyNjEyNzI2ODIzNDU4OTM2NzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | cc94fd76a79d905ed3b551a010645d12404420a984a93fe0edcc2a5f80b7c67c |
| hovercard-subject-tag | pull_request:3967141616 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/lessweb/deepcode-cli/pull/214/files |
| twitter:image | https://avatars.githubusercontent.com/u/76815370?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/76815370?s=400&v=4 |
| og:image:alt | feat: add configurable keybinds for slash commands Summary Add a keybinds settings field that maps keyboard shortcuts directly to slash command actions, so users can trigger commands like /exit, /n... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/lessweb/deepcode-cli git https://github.com/lessweb/deepcode-cli.git |
| octolytics-dimension-user_id | 118287711 |
| octolytics-dimension-user_login | lessweb |
| octolytics-dimension-repository_id | 1223512305 |
| octolytics-dimension-repository_nwo | lessweb/deepcode-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1223512305 |
| octolytics-dimension-repository_network_root_nwo | lessweb/deepcode-cli |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 74e2a9c78f1e38588de4f25885878349d721eedf |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width