Skip to main content
Starting a Task

Using the CLI

TUI mode

Run qodercli in any project root directory to enter the default TUI (interactive) mode. You can converse with the CLI via text or execute specific functions using slash commands.

Input Modes

The TUI provides multiple input modes:
CommandDescription
>Dialog mode (default). Enter any text to converse with the CLI
!Bash Mode. Enter ! in dialog mode to directly run shell commands
/Slash mode. Enter / in dialog mode to open and run built-in commands
\ Press Enter to start multiline input

Built-in Tools

Qoder CLI includes built-in tools such as Grep, Read, Write, and Bash for file/directory operations and shell command execution. For details on tool capabilities and control methods, see Tools.

Slash commands

Quickly access features and settings using the following built-in slash commands:
CommandDescription
/loginSign in to your Qoder account
/helpDisplay TUI help
/initInitialize or update the AGENTS.md memory file in the project
/memoryOpen Memory Overview to manage user-level, project-level, and local memory, as well as Auto-Memory entries
/questIntelligent workflow orchestrator that guides you through feature development step-by-step using dedicated subagents
/reviewReview local code changes
/resumeView and restore sessions
/clearClear the historical context of the current session
/compactSummarize the historical context of the current session
/usageDisplay current Credits usage
/statusView CLI status, including version, model, account, API Connectivity, tool status, etc.
/configView Qoder CLI system configuration
/effortAdjust the thinking depth and related Model Parameters for the current model
/agentsSubagent commands: view, create, and manage subagents
/tasksView currently running background tasks
/release-notesDisplay the Qoder CLI changelog
/vimToggle Vim edit mode
/feedbackSend feedback related to Qoder CLI
/quitExit the TUI
/logoutSign out of your Qoder account

Advanced Startup Options

When starting the CLI, you can use the following options to control its behavior:
CommandDescriptionExample
-wSpecify the working directoryqodercli -w /Users/demo/projects/nacos
-cResume the last sessionqodercli -c
-rRestore a specific sessionqodercli -r *******-c09a-40a9-82a7-a565413fa39
--allowed-toolsAllow only specified toolsqodercli --allowed-tools=Read,Write
--disallowed-toolsDeny specified toolsqodercli --disallowed-tools=Read,Write
--toolsRestrict available built-in tools ("" to disable all, default to enable all)qodercli --tools=Read,Edit -p "Fix login"
--max-turnsMaximum conversation turnsqodercli --max-turns=10
--worktree [name]Start in an isolated git worktreeqodercli --worktree feature-a
--yoloSkip permission checksqodercli --yolo
For permission-related startup arguments and settings, see Permissions. Print mode is a non-interactive mode. Run qodercli --print to enter it, and the output will be printed in the format specified by the --output-format parameter.

Parameters

Global parameters can be used with any command:
ParameterDescriptionExample
-pRun the agent non-interactivelyqodercli -p hi
-o, --output-formatOutput format: text, JSON, stream-jsonqodercli --output-format=json
-wSpecify the working directoryqodercli -w /Users/qoder_user/projects/qoder_demo
-cResume the last sessionqodercli -c
-rRestore a specific sessionqodercli -r ********-c09a-40a9-82a7-a565413fa393
--allowed-toolsAllow only specified toolsqodercli --allowed-tools=Read,Write
--disallowed-toolsDeny specified toolsqodercli --disallowed-tools=Read,Write
--max-turnsMaximum conversation turnsqodercli --max-turns=10
--worktree [name]Start in an isolated git worktreeqodercli --worktree feature-a -p "Fix login"
--yoloSkip permission checksqodercli --yolo

Shell command prefix

Set QODER_SHELL_PREFIX before starting Qoder CLI to route supported local shell commands through an executable wrapper. macOS and Linux
QODER_SHELL_PREFIX=/absolute/path/to/wrapper qodercli
Windows PowerShell
$env:QODER_SHELL_PREFIX = 'C:\absolute\path\to\wrapper.exe'
qodercli
Windows Command Prompt
set "QODER_SHELL_PREFIX=C:\absolute\path\to\wrapper.exe"
qodercli
A POSIX-compatible wrapper can implement the required dispatch as follows:
#!/usr/bin/env bash
exec bash -c "$1"
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

Using --worktree [name] allows you to start a Qoder CLI session in an isolated git worktree. This is ideal for handling multiple tasks in parallel within the same repository, preventing multiple sessions from sharing the same working directory or altering the main checkout.
Requirement: Run this command in a Git repository and ensure Git is installed locally.

Starting in a worktree

qodercli --worktree feature-a
qodercli --worktree feature-a "Implement the login fix"
qodercli --worktree
If no worktree name is provided, Qoder CLI will automatically generate one. A worktree name can be up to 256 characters long and may contain letters, numbers, dots, underscores, hyphens, and segments separated by /. Names containing / will be converted to + in both directory and branch names. When creating a new named worktree, Qoder CLI places it under <repo>/.qoder/worktrees/<flattened-name> and creates a temporary branch named worktree-<flattened-name>. If a worktree with the same name already exists, Qoder CLI reuses that directory directly instead of creating a new one. The new worktree is preferably created based on the default branch reference pointed to by the local origin/HEAD. If origin/HEAD is not configured, Qoder CLI will use origin/main if it can be resolved or fetched; otherwise, it falls back to the current HEAD. If you must start from the latest remote commit, execute git fetch origin first.

Copying Local Files

A new worktree is a clean checkout and does not include untracked files like .env by default. To copy local files to the new worktree, add .worktreeinclude in the repository root:
.env
.env.local
config/secrets.json
Only files that match .worktreeinclude and are already ignored by Git will be copied. The local project-level setting .qoder/settings.local.json is automatically copied if it exists.

Resuming and Cleaning Up

When the session ends, Qoder CLI prints the worktree path and the command to resume the session:
cd <worktree-path> && qodercli --resume <session-id>
An interactive exit checks for uncommitted files and new commits in the worktree. A clean worktree can be deleted automatically; if local files or commits exist, the exit prompt will ask you to choose whether to keep or delete them. Deletion discards these changes and removes the temporary branch. To manually delete a worktree, run:
git worktree remove <worktree-path>
If the worktree-<flattened-name> branch is no longer needed, you can delete it separately:
git branch -d worktree-<flattened-name>

Using worktrees in a session

In an existing session, you can also ask Qoder CLI to handle tasks in an isolated worktree. It will create and enter a worktree for the current session; when you need to leave, you can ask it to exit the worktree and restore the original working directory. Subagents can also use worktree isolation. When a Markdown Subagent needs to modify files in an isolated checkout, add isolation: worktree to its definition. A clean subagent worktree is deleted after the subagent finishes; worktrees with changes are retained. See Subagent for configuration details. For worktrees created during a session and subagents with worktree isolation enabled, the WorktreeCreate hook can provide a custom worktree path. See Hooks for the accompanying WorktreeRemove cleanup behavior. The --worktree startup argument itself requires usage within a Git repository and uses Git to create the worktree. If you need full manual control over directories and branches, you can directly use Git to create a worktree and then start Qoder CLI in that directory:
git worktree add ../project-feature-a -b feature-a
cd ../project-feature-a && qodercli

Memory

Qoder CLI retains context across sessions using AGENTS.md files and optional Auto-Memory. Commonly used files include the user-level ~/.qoder/AGENTS.md, project-level ${project}/AGENTS.md, and local project-level ${project}/AGENTS.local.md.

Automatic Generation

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

Manual Management

  • Create AGENTS.md in the project and edit its contents.
  • Enter /memory in the TUI to manage user-level, project-level, and local memory files.
  • When Auto-Memory is enabled, you can open the auto-memory folder in the /memory panel, or enter /memory manage to manage automatically saved memory files.
For complete instructions, see Memory.