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:
| Command | Description |
|---|---|
> | 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:
| Command | Description |
|---|---|
/login | Sign in to your Qoder account |
/help | Show TUI help |
/init | Initialize or update the AGENTS.md memory file in the project |
/memory | Open the memory overview; manage user-level, project-level, local memory, and the auto-memory entry |
/quest | Smart workflow orchestrator that guides you through feature development step by step with dedicated subagents |
/review | Review local code changes |
/resume | View and resume sessions |
/clear | Clear the current session's history context |
/compact | Summarize the current session's history context |
/usage | Show current Credits usage |
/status | View CLI status, including version, model, account, API connectivity, tool status, etc. |
/config | View Qoder CLI CN's system configuration |
/effort | Adjust the current model's reasoning effort and related model parameters |
/agents | Subagent commands: view, create, and manage subagents |
/tasks | View currently running background tasks |
/release-notes | Show the Qoder CLI CN changelog |
/vim | Toggle Vim editing mode |
/feedback | Send feedback about Qoder CLI CN |
/quit | Exit the TUI |
/logout | Sign out of your Qoder account |
Advanced startup options
When launching the CLI, you can control its behavior with these options:
| Command | Description | Example |
|---|---|---|
-w | Specify the working directory | qodercn -w /Users/demo/projects/nacos |
-c | Continue the last session | qodercn -c |
-r | Resume a specific session | qodercn -r *******-c09a-40a9-82a7-a565413fa39 |
--allowed-tools | Allow only the specified tools | qodercn --allowed-tools=Read,Write |
--disallowed-tools | Disallow the specified tools | qodercn --disallowed-tools=Read,Write |
--tools | Restrict available built-in tools ("" disables all, default enables all) | qodercn --tools=Read,Edit -p "Fix login" |
--max-turns | Maximum conversation turns | qodercn --max-turns=10 |
--worktree [name] | Start in a separate Git worktree | qodercn --worktree feature-a |
--yolo | Skip permission checks | qodercn --yolo |
Print mode
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:
| Flag | Description | Example |
|---|---|---|
-p | Run the Agent non-interactively | qodercn -p hi |
-o, --output-format | Output format: text, json, stream-json | qodercn --output-format=json |
-w | Specify the working directory | qodercn -w /Users/qoder_user/projects/qoder_demo |
-c | Continue the last session | qodercn -c |
-r | Resume a specific session | qodercn -r ********-c09a-40a9-82a7-a565413fa393 |
--allowed-tools | Allow only the specified tools | qodercn --allowed-tools=Read,Write |
--disallowed-tools | Disallow the specified tools | qodercn --disallowed-tools=Read,Write |
--max-turns | Maximum conversation turns | qodercn --max-turns=10 |
--worktree [name] | Start in a separate Git worktree | qodercn --worktree feature-a -p "Fix login" |
--yolo | Skip permission checks | qodercn --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
/. 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:
.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:
worktree-<flattened-name> branch, delete it separately:
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:
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.mdin the project and edit its content. - Type
/memoryin the TUI to manage user-level, project-level, and local memory files. - With auto-memory enabled, open the auto-memory folder from the
/memorypanel, or type/memory manageto manage automatically saved memory files.