Skip to main content

TUI Mode

Run qodercli from any project root to enter the default TUI (interactive) mode. You can chat with the CLI by text or execute special functions via slash commands.

Input modes

Multiple input modes are available in the TUI:

Built-in tools

Qoder CLI ships with tools like Grep, Read, Write, and Bash for file/directory operations and shell command execution. For more details about tool capabilities and controls, see Tools.

Slash commands

Quickly access features and settings with these built-in slash commands:

Advanced startup options

When launching the CLI, use the following options to control its behavior: For permission-related flags and settings, see Permissions. Print mode is non-interactive. Run qodercli --print to enter. Output is printed according to --output-format.

Flags

Global options can be used with any command:

Shell command prefix

Set QODER_SHELL_PREFIX before starting Qoder CLI to route supported local shell commands through an executable wrapper. macOS and Linux
Windows PowerShell
Windows Command Prompt
A POSIX-compatible wrapper can implement the required dispatch as follows:
The wrapper receives the complete generated command line as one shell-quoted first argument ($1 in a POSIX wrapper). It must re-evaluate that argument with a POSIX-compatible shell rather than treat the entire argument as an executable path. Using exec as shown above preserves stdin, stdout, stderr, the exit status, and signals. On Windows, the wrapper must pass its first argument to Git Bash as bash.exe -c <argument> and preserve the same process behavior; PowerShell and cmd.exe do not parse this quoted command format correctly. Use a single executable path as the variable value; do not append shell arguments. For consistent behavior across all prefixed entry points, the executable path must not contain a space followed by a hyphen ( -), which the POSIX shell prefix parser reserves. The prefix applies to Bash mode (!), the Bash tool, bash-compatible shell-form command hooks and custom status line commands, and stdio MCP servers. It does not apply to exec-form hooks, PowerShell hooks or status line commands, URL-based MCP transports, or interactive PTY commands. If Qoder CLI inherits a shell prefix from its startup environment, set QODER_SHELL_PREFIX explicitly to an empty value to disable it. Existing permission, trust, and sandbox checks still apply.

Worktree

Use --worktree [name] to start a Qoder CLI session in a separate Git worktree. This is useful when you want to run parallel sessions against the same repository without sharing the same working directory or touching the main checkout.
Requirements: run the command inside a Git repository and make sure Git is installed locally.

Start in a worktree

If you omit the worktree name, Qoder CLI generates one automatically. Worktree names can contain letters, digits, dots, underscores, dashes, and slash-separated segments, up to 256 characters total. Slash-separated names are flattened with + for the worktree directory and branch name. When a new named worktree is created, Qoder CLI stores it under <repo>/.qoder/worktrees/<flattened-name> and uses a temporary branch named worktree-<flattened-name>. If a worktree with the same name already exists, Qoder CLI reuses it and resumes in that directory instead of creating another one. New worktrees start from the local origin/HEAD default-branch ref when it is available. If origin/HEAD is not configured, Qoder CLI uses origin/main when it can resolve or fetch it; otherwise it falls back to the current HEAD. Run git fetch origin first when the worktree must start from the latest remote commit.

Copy local files

A new worktree is a clean checkout, so untracked files such as .env are not present by default. To copy local files into new worktrees, add a .worktreeinclude file at the repository root:
Only files that both match .worktreeinclude and are already ignored by Git are copied. Project-local settings in .qoder/settings.local.json are copied automatically when present.

Resume and clean up

When the session ends, Qoder CLI prints the worktree path and the command for resuming the session:
Interactive exits check for uncommitted files and commits created in the worktree. Clean worktrees can be removed automatically. Worktrees with local files or commits are kept or removed based on the exit prompt; removing a worktree discards those changes and deletes the temporary branch. To remove a worktree manually, run:
Delete the worktree-<flattened-name> branch separately if you no longer need it:

Use worktrees during a session

During an active session, you can ask Qoder CLI to work in an isolated worktree. It creates and enters a worktree for the current session, then can leave that worktree and restore the original working directory when asked. Subagents can also use worktree isolation. Add isolation: worktree to a Markdown Subagent definition when that Subagent should edit files in a separate checkout. Clean Subagent worktrees are removed after the Subagent finishes; changed worktrees are preserved. See Subagents for Subagent configuration. For in-session worktrees and worktree-isolated Subagents, WorktreeCreate hooks can provide a custom worktree path. See Hooks for the matching WorktreeRemove cleanup behavior. The --worktree startup flag itself expects a Git repository and uses Git for creation. For full manual control, create a worktree with Git and run Qoder CLI from that directory:

Memory

Qoder CLI carries context across sessions with AGENTS.md files and optional auto-memory. Common files include user-level ~/.qoder/AGENTS.md, project-level ${project}/AGENTS.md, and local project-level ${project}/AGENTS.local.md.

Automatically generate

Start TUI in the target project and enter /init to generate AGENTS.md in the project directory.

Manually manage

  • Create AGENTS.md in the project and edit its content.
  • In TUI, enter /memory to manage user, project, and local memory files.
  • When auto-memory is enabled, use /memory to open the auto-memory folder, or enter /memory manage to manage automatically saved memory files.
For details, see Memory.