MCPcopy Index your code
hub / github.com/anomalyco/opencode / useCommandShortcut

Function useCommandShortcut

packages/tui/src/keymap.tsx:250–258  ·  view source on GitHub ↗
(command: string)

Source from the content-addressed store, hash-verified

248}
249
250export function useCommandShortcut(command: string): Accessor<string> {
251 const config = useTuiConfig()
252 return useKeymapSelector((keymap: OpenTuiKeymap) =>
253 formatKeySequence(
254 keymap.getCommandBindings({ visibility: "registered", commands: [command] }).get(command)?.[0]?.sequence,
255 config,
256 ),
257 )
258}
259
260export function useCommandSlashes(): Accessor<readonly CommandSlashEntry[]> {
261 const keymap = useOpencodeKeymap()

Callers 13

DialogSessionListFunction · 0.90
DialogStashFunction · 0.90
DialogMoveSessionFunction · 0.90
PromptFunction · 0.90
PromptFunction · 0.90
SubagentFooterFunction · 0.90
SessionFunction · 0.90
AssistantMessageFunction · 0.90
DialogHelpFunction · 0.90
DialogPromptFunction · 0.90
TipsFunction · 0.90
DiffViewerFunction · 0.90

Calls 3

useTuiConfigFunction · 0.90
formatKeySequenceFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected