
Hotkey
- 1.5k installs
- 81.3k repo stars
- Updated August 5, 2026
- lobehub/lobe-chat
This is a copy of hotkey by lobehub - installs and ranking accrue to the original listing.
hotkey is an agent skill that adds, edits, and maintains keyboard shortcuts in the LobeChat interface for developers who need to register HotkeyEnum entries, default bindings, and conflict-safe Cmd/Ctrl combos.
About
hotkey is a LobeChat contributor skill that walks through the project's keyboard shortcut system step by step. It covers updating HotkeyEnum in src/types/hotkey.ts, registering defaults in src/const/hotkeys.ts via HOTKEYS_REGISTRATION, wiring combineKeys from @lobehub/ui, and connecting useHotkeyById hooks with tooltip labels. Developers reach for hotkey when extending LobeChat with new shortcuts, fixing scope conflicts, or maintaining Cmd versus Ctrl platform differences. The skill documents group assignments via HotkeyGroupEnum and the full registration shape so new hotkeys behave consistently across the chat interface without breaking existing bindings.
- 5-step process to add a new hotkey from enum to registration to i18n to hook
- Works with HotkeyEnum, HOTKEYS_REGISTRATION, combineKeys, useHotkeyById, and tooltip hotkeys
- Handles shortcut scope, conflicts, and Cmd/Ctrl key combos
- Registers hotkeys to specific scopes such as Chat
- Includes i18n support for titles and descriptions
Hotkey by the numbers
- 1,515 all-time installs (skills.sh)
- +83 installs in the week ending Aug 4, 2026 (Skillselion tracking)
- Security screen: LOW risk (skills.sh audit)
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/lobehub/lobe-chat --skill hotkeyAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1.5k |
|---|---|
| repo stars | ★ 81.3k |
| Security audit | 3 / 3 scanners passed |
| Last updated | August 5, 2026 |
| Repository | lobehub/lobe-chat ↗ |
How do you add keyboard shortcuts in LobeChat?
Add, edit, or maintain keyboard shortcuts inside the LobeChat interface.
Who is it for?
Developers contributing to the lobehub/lobe-chat repository who need to add or modify keyboard shortcuts using the project's HotkeyEnum and HOTKEYS_REGISTRATION system.
Skip if: Developers building keyboard shortcuts in unrelated React apps or any project that does not use LobeChat's @lobehub/ui hotkey infrastructure.
When should I use this skill?
The user mentions HotkeyEnum, HOTKEYS_REGISTRATION, combineKeys, useHotkeyById, hotkey conflicts, or adding shortcuts inside LobeChat.
What you get
New HotkeyEnum entry, HOTKEYS_REGISTRATION default binding, and useHotkeyById hook wired with tooltip hotkey display in LobeChat.
- HotkeyEnum constant
- HOTKEYS_REGISTRATION entry
- useHotkeyById hook binding
Files
Adding Keyboard Shortcuts Guide
Steps to Add a New Hotkey
1. Update Hotkey Constant
In src/types/hotkey.ts:
export const HotkeyEnum = {
// existing...
ClearChat: 'clearChat', // Add new
} as const;2. Register Default Hotkey
In src/const/hotkeys.ts:
import { KeyMapEnum as Key, combineKeys } from '@lobehub/ui';
export const HOTKEYS_REGISTRATION: HotkeyRegistration = [
{
group: HotkeyGroupEnum.Conversation,
id: HotkeyEnum.ClearChat,
keys: combineKeys([Key.Mod, Key.Shift, Key.Backspace]),
scopes: [HotkeyScopeEnum.Chat],
},
];3. Add i18n Translation
In src/locales/default/hotkey.ts:
const hotkey: HotkeyI18nTranslations = {
clearChat: {
desc: '清空当前会话的所有消息记录',
title: '清空聊天记录',
},
};4. Create and Register Hook
In src/hooks/useHotkeys/chatScope.ts:
export const useClearChatHotkey = () => {
const clearMessages = useChatStore((s) => s.clearMessages);
return useHotkeyById(HotkeyEnum.ClearChat, clearMessages);
};
export const useRegisterChatHotkeys = () => {
useClearChatHotkey();
// ...other hotkeys
};5. Add Tooltip (Optional)
const clearChatHotkey = useUserStore(settingsSelectors.getHotkeyById(HotkeyEnum.ClearChat));
<Tooltip hotkey={clearChatHotkey} title={t('clearChat.title', { ns: 'hotkey' })}>
<Button icon={<DeleteOutlined />} onClick={clearMessages} />
</Tooltip>;Best Practices
1. Scope: Choose global or chat scope based on functionality 2. Grouping: Place in appropriate group (System/Layout/Conversation) 3. Conflict check: Ensure no conflict with system/browser shortcuts 4. Platform: Use Key.Mod instead of hardcoded Ctrl or Cmd 5. Clear description: Provide title and description for users
Troubleshooting
- Not working: Check scope and RegisterHotkeys hook
- Not in settings: Verify HOTKEYS_REGISTRATION config
- Conflict: HotkeyInput component shows warnings
- Page-specific: Ensure correct scope activation
Related skills
How it compares
Use hotkey only for LobeChat's internal shortcut system; for generic React hotkey libraries in other codebases, use a framework-specific frontend skill instead.
FAQ
Which files does the hotkey skill modify in LobeChat?
The hotkey skill updates src/types/hotkey.ts for HotkeyEnum constants and src/const/hotkeys.ts for HOTKEYS_REGISTRATION default bindings. It also wires useHotkeyById hooks and combineKeys from @lobehub/ui where the shortcut is consumed.
How does hotkey handle macOS versus Windows key combos?
The hotkey skill uses combineKeys from @lobehub/ui to normalize Cmd on macOS and Ctrl on Windows. HOTKEYS_REGISTRATION entries define platform-aware defaults so tooltip labels and handlers stay consistent across operating systems.
Is Hotkey safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.