Skip to main content
Starting a task

Running Tasks

TUI mode

Run qodercn in any project root to enter the default TUI (interactive) mode. You can converse with the CLI in text, or run specific features through slash commands.

Input modes

The TUI provides several input modes:
CommandDescription
>Conversation mode (default). Type any text to converse with the CLI
!Bash mode. Type ! in conversation mode to run shell commands directly
/Slash mode. Type / in conversation mode to open and run built-in commands
\ Press Enter to start multi-line input

Built-in tools

Qoder CLI CN ships with tools such as Grep, Read, Write, and Bash for file/directory operations and shell command execution. For tool capabilities and control options, see Built-in Tools.

Slash commands

Quickly access features and settings with these built-in slash commands:
CommandDescription
/loginSign in to your Qoder account
/helpShow TUI help
/initInitialize or update the AGENTS.md memory file in the project
/memoryOpen the memory overview; manage user-level, project-level, local memory, and the auto-memory entry
/questSmart workflow orchestrator that guides you through feature development step by step with dedicated subagents
/reviewReview local code changes
/resumeView and resume sessions
/clearClear the current session's history context
/compactSummarize the current session's history context
/usageShow current Credits usage
/statusView CLI status, including version, model, account, API connectivity, tool status, etc.
/configView Qoder CLI CN's system configuration
/effortAdjust the current model's reasoning effort and related model parameters
/agentsSubagent commands: view, create, and manage subagents
/tasksView currently running background tasks
/release-notesShow the Qoder CLI CN changelog
/vimToggle Vim editing mode
/feedbackSend feedback about Qoder CLI CN
/quitExit the TUI
/logoutSign out of your Qoder account

Advanced startup options

When launching the CLI, you can control its behavior with these options:
CommandDescriptionExample
-wSpecify the working directoryqodercn -w /Users/demo/projects/nacos
-cContinue the last sessionqodercn -c
-rResume a specific sessionqodercn -r *******-c09a-40a9-82a7-a565413fa39
--allowed-toolsAllow only the specified toolsqodercn --allowed-tools=Read,Write
--disallowed-toolsDisallow the specified toolsqodercn --disallowed-tools=Read,Write
--toolsRestrict available built-in tools ("" disables all, default enables all)qodercn --tools=Read,Edit -p "Fix login"
--max-turnsMaximum conversation turnsqodercn --max-turns=10
--worktree [name]Start in a separate Git worktreeqodercn --worktree feature-a
--yoloSkip permission checksqodercn --yolo
For permission-related startup flags and settings, see Permissions and Directory Trust. Print mode is the non-interactive mode. Run qodercn --print to enter it; output is printed in the format specified by the --output-format flag.

Flags

Global flags can be used with any command:
FlagDescriptionExample
-pRun the Agent non-interactivelyqodercn -p hi
-o, --output-formatOutput format: text, json, stream-jsonqodercn --output-format=json
-wSpecify the working directoryqodercn -w /Users/qoder_user/projects/qoder_demo
-cContinue the last sessionqodercn -c
-rResume a specific sessionqodercn -r ********-c09a-40a9-82a7-a565413fa393
--allowed-toolsAllow only the specified toolsqodercn --allowed-tools=Read,Write
--disallowed-toolsDisallow the specified toolsqodercn --disallowed-tools=Read,Write
--max-turnsMaximum conversation turnsqodercn --max-turns=10
--worktree [name]Start in a separate Git worktreeqodercn --worktree feature-a -p "Fix login"
--yoloSkip permission checksqodercn --yolo

Worktree

Use --worktree [name] to start a Qoder CLI CN session in a separate Git worktree. This is great for working on multiple tasks in parallel within the same repository, avoiding multiple sessions sharing one working directory or touching the main checkout.
Requirements: run the command inside a Git repository, with Git installed locally.

Start in a worktree

qodercn --worktree feature-a
qodercn --worktree feature-a "Implement the login fix"
qodercn --worktree
If you don't pass a worktree name, Qoder CLI CN generates one automatically. Worktree names can be up to 256 characters and may contain letters, digits, dots, underscores, hyphens, and segments separated by /. Names containing / are converted to + in directory and branch names. When creating a new named worktree, Qoder CLI CN 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 CN reuses that directory instead of creating another one. New worktrees are preferentially created from the default branch ref pointed to by the local origin/HEAD. If origin/HEAD is not configured, Qoder CLI CN uses origin/main when it can be resolved or fetched; otherwise it falls back to the current HEAD. If you must start from the latest remote commit, run git fetch origin first.

Copying local files

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

Resuming and cleanup

When the session ends, Qoder CLI CN prints the worktree path and the command to resume that session:
cd <worktree-path> && qodercn --resume <session-id>
An interactive exit checks the worktree for uncommitted files and new commits. A clean worktree can be deleted automatically; if local files or commits exist, the exit prompt lets you choose to keep or delete. Deleting discards those changes and removes the temporary branch. To remove a worktree manually, run:
git worktree remove <worktree-path>
If you no longer need the worktree-<flattened-name> branch, delete it separately:
git branch -d worktree-<flattened-name>

Using worktrees within a session

Within an existing session, you can also ask Qoder CLI CN to handle a task in an isolated worktree. It creates and enters a worktree for the current session; when you want to leave, ask it to exit the worktree and restore the original working directory. Subagents can use worktree isolation too. When a Markdown Subagent needs to modify files in a separate checkout, add isolation: worktree to its definition. A clean Subagent worktree is deleted after the Subagent finishes; a worktree with changes is kept. For configuration, see Subagents. For worktrees created within a session and Subagents with worktree isolation enabled, the WorktreeCreate Hook can supply a custom worktree path. For the companion WorktreeRemove cleanup behavior, see Hooks. The --worktree startup flag itself requires running inside a Git repository and uses Git to create the worktree. If you need full manual control over the directory and branch, create the worktree directly with Git, then launch Qoder CLI CN in that directory:
git worktree add ../project-feature-a -b feature-a
cd ../project-feature-a && qodercn

Memory

Qoder CLI CN retains context across sessions through AGENTS.md files and optional auto-memory. Common files include the user-level ~/.qoder-cn/AGENTS.md, project-level ${project}/AGENTS.md, and local project-level ${project}/AGENTS.local.md.

Auto-generate

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

Manage manually

  • Create an AGENTS.md in the project and edit its content.
  • Type /memory in the TUI to manage user-level, project-level, and local memory files.
  • With auto-memory enabled, open the auto-memory folder from the /memory panel, or type /memory manage to manage automatically saved memory files.
See Memory for the full description.