Skip to main content

Coding Workspace (IDE Mode)

Mercury includes a CLI IDE-style workspace mode for repository-focused coding.

Enter Workspace Mode

You can enter workspace mode in multiple ways:

  • /code and choose workspace
  • /code workspace
  • /ws open <path>

Once active, Mercury switches to coding context for that repository. Agent responses appear in the normal scrollable chat view so you can always see full output.

Modes

Use programming modes to control behavior:

  • /code plan — analysis/planning first, minimal code changes
  • /code execute — implementation mode
  • /code off — return to normal conversation behavior

Keyboard Shortcuts

ShortcutAction
Ctrl+PPlan mode
Ctrl+XExecute mode
Ctrl+EFocus explorer pane
Ctrl+GFocus git pane
Ctrl+JToggle right panel between chat and git
TabCycle focus: explorer → code → right panel
EscReturn to explorer (or exit workspace from explorer)
Ctrl+QExit workspace
Shift+EnterInsert newline (multi-line input)
Alt+EnterInsert newline (fallback for terminals that don't distinguish Shift+Enter)
FocusKeysAction
Explorer Move selection
Explorer Collapse / expand folder
ExplorerEnterOpen selected file
Code Scroll code ±1 line
CodePgUp PgDnScroll code ±15 lines
CodeCtrl+U Ctrl+DScroll code ±10 lines (vim-style)
Chat Scroll agent output ±1 line
ChatPgUp PgDnScroll agent output ±10 lines
ChatCtrl+U Ctrl+DScroll agent output ±8 lines
Git Move through changed files
GitEnterStage selected file

Workspace Commands

CommandDescription
/ws open <path>Open a directory in workspace mode
/ws refreshRefresh file tree + git status
/ws focus <area>Focus a panel: explorer, code, git, or chat
/ws stage <file|all>Stage one file or all changes
/ws commit <message>Commit staged changes
/ws undo <file>Revert file changes
/ws toggle-chatToggle right panel between chat and git
/ws chat-scroll <n>Scroll agent output by n lines
/ws exitExit workspace mode back to general chat

Sub-Agents + Background in Coding

Workspace mode supports explicit delegation and backgrounding:

  • /code agent <task> — delegate coding work to a sub-agent
  • /bg current — move active in-flight work to background
  • /bg list — inspect all background tasks (shell + sub-agent)
  • /bg <id> — view task details/output (IDs use friendly names like swift-fox)
  • /bg cancel <id> — cancel running background work
  • /bg stop <id> / /bg kill <id> — aliases for cancel
  • /bg killall / /bg stopall — cancel all running background tasks

This lets you continue coding/chatting while long operations run asynchronously.

Progress Tracking

During long-running tasks, Mercury shows real-time progress:

  • The status bar displays the current tool/action (e.g., ● step 5 · ✂️ Editing App.tsx)
  • Heartbeat messages escalate timing (20s → 30s → 45s → 60s) to reduce noise
  • Use /progress to see the last 10 completed steps with timing
  • Consecutive identical tool calls are collapsed (e.g., "Read 3 files")