MCPcopy Create free account
hub / github.com/codeaashu/claude-code / generateActionsTable

Function generateActionsTable

src/skills/bundled/keybindings.ts:33–56  ·  view source on GitHub ↗

* Build a markdown table of all actions with their default bindings and context.

()

Source from the content-addressed store, hash-verified

31 * Build a markdown table of all actions with their default bindings and context.
32 */
33function generateActionsTable(): string {
34 // Build a lookup: action -> { keys, context }
35 const actionInfo: Record<string, { keys: string[]; context: string }> = {}
36 for (const block of DEFAULT_BINDINGS) {
37 for (const [key, action] of Object.entries(block.bindings)) {
38 if (action) {
39 if (!actionInfo[action]) {
40 actionInfo[action] = { keys: [], context: block.context }
41 }
42 actionInfo[action].keys.push(key)
43 }
44 }
45 }
46
47 return markdownTable(
48 ['Action', 'Default Key(s)', 'Context'],
49 KEYBINDING_ACTIONS.map(action => {
50 const info = actionInfo[action]
51 const keys = info ? info.keys.map(k => `\`${k}\``).join(', ') : '(none)'
52 const context = info ? info.context : inferContextFromAction(action)
53 return [`\`${action}\``, keys, context]
54 }),
55 )
56}
57
58/**
59 * Infer context from action prefix when not in DEFAULT_BINDINGS.

Callers 1

getPromptForCommandFunction · 0.85

Calls 4

markdownTableFunction · 0.85
inferContextFromActionFunction · 0.85
entriesMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected