local keymaps = {
  aider = {
    ["<Up>"] = "Move cursor up one line in the current message (Emacs/Insert mode)",
    ["<Down>"] = "Move cursor down one line in the current message (Emacs/Insert mode)",
    ["<C-Up>"] = "Scroll back to previous sent message",
    ["<C-Down>"] = "Scroll forward to next sent message",
    ["<C-a>"] = "Move cursor to start of line",
    ["<C-b>"] = "Move cursor back one character",
    ["<C-d>"] = "Delete the character under the cursor",
    ["<C-e>"] = "Move cursor to end of line",
    ["<C-f>"] = "Move cursor forward one character",
    ["<C-k>"] = "Delete from cursor to end of line",
    ["<C-l>"] = "Clear the screen",
    ["<C-n>"] = "Move to next entry in history",
    ["<C-p>"] = "Move to previous entry in history",
    ["<C-r>"] = "Search backward through message history",
    ["<C-x><C-e>"] = "Open current input in external editor for editing",
    ["<C-y>"] = "Paste the last yanked text",
    ["<Esc>"] = "Switch to command mode (vi mode)",
    ["i"] = "Enter insert mode (vi mode)",
    ["a"] = "Enter insert mode after current character (vi mode)",
    ["A"] = "Enter insert mode at end of line (vi mode)",
    ["I"] = "Enter insert mode at beginning of line (vi mode)",
    ["h"] = "Move cursor left one character (vi normal mode)",
    ["j"] = "Move cursor down one line (vi normal mode)",
    ["k"] = "Move cursor up one line (vi normal mode)",
    ["l"] = "Move cursor right one character (vi normal mode)",
    ["w"] = "Jump forward to next word (vi normal mode)",
    ["b"] = "Jump backward to previous word (vi normal mode)",
    ["0"] = "Jump to beginning of line (vi normal mode)",
    ["$"] = "Jump to end of line (vi normal mode)",
    ["x"] = "Delete the character under the cursor (vi normal mode)",
    ["dd"] = "Delete the current line (vi normal mode)",
    ["u"] = "Undo last change (vi normal mode)",
  },
  claude = {
    ["<Esc><Esc>"] = "Rewind the code and conversation to a previous checkpoint",
    ["<Tab>"] = "Toggle extended thinking mode On/Off",
    ["<S-Tab>"] = "Toggle permission mode (cycle Auto-Accept, Plan, normal mode)",
    ["<Up>"] = "Recall previous command from history",
    ["<Down>"] = "Recall next command from history",
    ["<C-c>"] = "Cancel the current generation (interrupt Claude)",
    ["<C-d>"] = "Exit the Claude CLI session (EOF)",
    ["<C-l>"] = "Clear the terminal screen (history is retained)",
    ["<C-r>"] = "Search backward through command history",
  },
  codex = {
    ["<CR>"] = "Submit the prompt (send message to Codex)",
    ["<C-j>"] = "Insert a newline in the prompt without sending",
    ["<Up>"] = "Navigate to previous input in history",
    ["<Down>"] = "Navigate to next input in history",
    ["<C-h>"] = "Delete the character to the left (Backspace)",
    ["<C-b>"] = "Move cursor one character to the left",
    ["<C-f>"] = "Move cursor one character to the right",
    ["<C-a>"] = "Move cursor to the beginning of the line",
    ["<C-e>"] = "Move cursor to the end of the line",
    ["<C-d>"] = "Exit the Codex CLI (if input is empty) or delete char under cursor",
    ["<C-c>"] = "Cancel the current AI response",
    ["<C-l>"] = "Clear the screen (conversation state persists)",
    ["<C-r>"] = "Reverse-search through previous prompts/commands",
    ["<Tab>"] = "Auto-complete file paths or commands",
    ["<C-t>"] = "Toggle response detail level (switch between concise and detailed mode)",
  },
  copilot = {
    ["<Up>"] = "Move selection up (navigate through suggestion options)",
    ["<Down>"] = "Move selection down (navigate through suggestion options)",
    ["<CR>"] = "Confirm selection (execute chosen suggestion or action)",
    ["<Esc>"] = "Cancel the current Copilot CLI prompt or suggestion",
  },
  crush = {
    ["<C-p>"] = "Open the command palette (show available commands and actions)",
    ["<C-g>"] = "Focus the chat input (return focus to prompt)",
    ["<C-s>"] = "Open session management (list or switch sessions)",
    ["<C-f>"] = "Attach a file to the conversation context",
    ["<C-o>"] = "Open the current file or snippet in your editor",
    ["<C-c>"] = "Exit Crush (quit the CLI)",
    ["<Tab>"] = "Trigger auto-completion for paths or commands",
  },
  cursor = {
    ["<C-r>"] = "Preview the proposed changes or plan (toggle preview mode)",
    ["i"] = "Insert a follow-up message (exit preview or file navigation to type input)",
    ["<Up>"] = "Move up in the file list or suggestion list",
    ["<Down>"] = "Move down in the file list or suggestion list",
    ["<Esc>"] = "Close the current dialog or exit shell/tool mode back to chat",
    ["<C-c>"] = "Interrupt the current operation or generation",
    ["<C-d>"] = "Exit the Cursor CLI (if pressed on empty prompt, acts as EOF)",
  },
  gemini = {
    ["<Esc>"] = "Close any open dialog or suggestion popup",
    ["<C-c>"] = "Cancel the ongoing request or generation (press twice to quit)",
    ["<C-d>"] = "Exit the Gemini CLI (if input is empty, requires confirmation)",
    ["<C-l>"] = "Clear the terminal output",
    ["<C-o>"] = "Toggle the debug console display",
    ["<C-s>"] = "Allow long responses to fully print (disable output truncation)",
    ["<C-t>"] = "Toggle display of tool usage descriptions",
    ["<C-y>"] = "Toggle auto-approval (YOLO mode) for running tools",
    ["!"] = "Enter shell command mode (execute commands, output goes into chat context)",
    ["\\<CR>"] = "Insert a newline in the prompt without sending",
    ["<Up>"] = "Cycle to previous input in history",
    ["<Down>"] = "Cycle to next input in history",
    ["<Tab>"] = "Accept or auto-complete the current suggestion",
    ["<S-Tab>"] = "Toggle auto-apply mode for file edits (apply suggestions without confirmation)",
    ["<C-x>"] = "Open the current prompt in the default editor (for multi-line editing)",
  },
  grok = {
    ["<Up>"] = "Recall the previous prompt from history",
    ["<Down>"] = "Recall the next prompt from history",
    ["<C-c>"] = "Cancel the current query or exit Grok CLI",
  },
  opencode = {
    ["<C-x>"] = "Leader key for multi-key shortcuts (press before other keys)",
    ["<C-x>h"] = "Show the help menu (list available commands and keybinds)",
    ["<C-c>"] = "Interrupt generation or clear current input (press at empty prompt to exit)",
    ["<C-x>q"] = "Quit OpenCode (exit the CLI)",
    ["<C-x>e"] = "Open an external editor for the next message input",
    ["<C-x>t"] = "Open theme selector (choose a visual theme)",
    ["<C-x>i"] = "Initialize project (set up OpenCode in current directory)",
    ["<C-x>d"] = "Show details for available tools",
    ["<C-x>b"] = "Toggle display of AI thinking process (reasoning blocks)",
    ["<C-x>x"] = "Export the current session state to a file",
    ["<C-x>n"] = "Start a new chat session",
    ["<C-x>l"] = "List all sessions",
    ["<C-x>s"] = "Share the current session (generate sharable link or ID)",
    ["<Esc>"] = "Stop the current response (interrupt OpenCode's output)",
    ["<C-x>c"] = "Compact the session (reduce context size by summarizing)",
    ["<C-Right>"] = "Switch to the next child session or branch",
    ["<C-Left>"] = "Switch to the previous child session or branch",
    ["<PageUp>"] = "Scroll up one page in the conversation history",
    ["<PageDown>"] = "Scroll down one page in the conversation history",
    ["<C-M-u>"] = "Scroll up by half a page in history",
    ["<C-M-d>"] = "Scroll down by half a page in history",
    ["<C-g>"] = "Jump to the first message in the conversation",
    ["<C-M-g>"] = "Jump to the latest message in the conversation",
    ["<C-x>y"] = "Copy the last assistant reply to clipboard",
    ["<C-x>u"] = "Undo the last automated code edit",
    ["<C-x>r"] = "Redo an undone code edit",
    ["<C-x>m"] = "Open the model selection menu",
    ["<F2>"] = "Switch to the most recent model used",
    ["<S-F2>"] = "Switch to the previous model in use",
    ["<C-x>a"] = "Open the agent selection menu (if multiple agents are available)",
    ["<Tab>"] = "Cycle to the next active agent",
    ["<S-Tab>"] = "Cycle to the previous active agent",
    ["<C-v>"] = "Paste from clipboard into the input",
    ["<CR>"] = "Submit the current input message",
    ["<S-CR>"] = "Insert a newline in the input (when multiline mode is off)",
  },
  qwen = {
    ["<Esc>"] = "Close current dialog or suggestion",
    ["<C-c>"] = "Cancel current action or generation (press twice to exit Qwen CLI)",
    ["<C-d>"] = "Exit the Qwen CLI (press twice to confirm exit)",
    ["<C-l>"] = "Clear the screen output",
    ["<C-o>"] = "Toggle debug console view",
    ["<C-s>"] = "Prevent output truncation (allow long responses to print fully)",
    ["<C-t>"] = "Show or hide tool descriptions in output",
    ["<C-y>"] = "Toggle YOLO mode (auto-approve all tool actions)",
    ["!"] = "Enter shell mode to run a command (output is captured into chat)",
    ["\\<CR>"] = "Insert a line break in the prompt without sending",
    ["<Up>"] = "Retrieve previous command from history",
    ["<Down>"] = "Retrieve next command from history",
    ["<Tab>"] = "Accept or complete the current suggestion",
    ["<S-Tab>"] = "Toggle auto-apply mode for file changes",
    ["<C-x>"] = "Open the current prompt in an external editor",
  },
}

local all = {} ---@type table<string, string>
for _, km in pairs(keymaps) do
  for k, v in pairs(km) do
    all[k] = v
  end
end

local sorted = vim.tbl_keys(all)
table.sort(sorted)
print(table.concat(sorted, "\n"))

return keymaps
