Skip to main content
Guides

Commands

Use slash commands (also known as Commands) to control the behavior of Qoder CN CLI and quickly trigger specific tasks. Commands are shortcuts in Qoder CN CLI for triggering specific tasks, prefixed with the slash symbol (/). In TUI mode, enter / to view the list of available commands and select one to execute.

Quick Start

Using Commands in TUI Mode

  1. Start Qoder CN CLI to enter TUI mode:
    qodercli
    
  2. Enter the / character in the input box to view the list of available commands
  3. Select the target command and press Enter to execute it. For example, /config views or modifies the Qoder CN CLI configuration:
    /config
    

Using Commands in Headless Mode

Headless mode supports executing commands that submit prompts. Commands that need to open an interactive selector or dialog should be used in TUI mode.
# Execute a command (with additional instructions)
qodercli -p '/review 重点检查注释覆盖情况'

# Execute a custom Prompt command
qodercli -p '/git-commit'

Command Types

Commands in Qoder CN CLI fall into two types:
TypeDescriptionApplicable ModesExtensibility
TUI typeProvides an interactive interface (such as a pop-up dialog or list selection)TUIBuilt-in; does not support customization
Prompt typeSubmits a preset prompt to the conversation to guide the CLI in completing a specific taskTUI + HeadlessSupports user-defined extensions

Built-in Commands

CommandTypePurpose
/agentsTUIView and manage the Subagent list; supports creating and editing Subagent configurations
/tasksTUIView and manage background tasks
/workflowsTUIOpen the dynamic workflow task panel. See Dynamic Workflows
/clearTUIClear the current conversation and start a new one
/commandsTUIView and manage custom commands; supports creating and editing command configurations
/compactPromptCompress the conversation history; you can specify a focus
/configTUIConfiguration management; view or modify Qoder CN CLI configuration items
/export [filename]TUIExport the current session to a file
/feedbackTUISubmit feedback or report issues
/helpTUIShow help information
/initTUIInitialize the project, analyze the project structure, and generate the AGENTS.md memory file
/loginTUILog in to your Qoder CN CLI account
/logoutTUILog out of your Qoder CN CLI account
/mcpTUIMCP service management
/memoryTUIOpen the memory overview; when auto-memory is enabled, you can open the auto-memory folder, or use /memory manage to manage topic files . See Memory
/modelTUIView and manage model tier settings
/effort [level]TUISet the thinking depth of the current model; when no level is passed, the model parameter panel opens
/context-windowTUISet the context window of the current model; when no parameter is passed, the model parameter panel opens
/fast [on|off]TUIToggle Fast mode for the current model; when no parameter is passed, the model parameter panel opens
/questPromptIntelligent workflow orchestrator; multiple agents work together to help you complete feature development
/quitTUIExit Qoder CN CLI
/release-notesTUIView release notes
/resumeTUIResume a previous session or conversation history; supports paging between sessions with the Tab key
/reviewPromptPerform a code review to check code quality and compliance
/setup-githubTUIGitHub integration configuration; set up GitHub-related features
/skillsTUIManage the Skill commands of the current workspace
/statusTUIView the current session status and system information
/upgradeTUIUpgrade the subscription plan
/usageTUIView usage statistics, including Token consumption and other information
/vimTUIEnable or configure Vim mode for a Vim-style editing experience

Creating Custom Commands

Qoder CN CLI supports creating Prompt-type custom commands. You define the command's name, description, and system prompt through a configuration file. Use the built-in AI-assisted feature in the TUI to quickly generate command configurations:
  1. Run /commands in the TUI to enter the command configuration panel
  2. Press Tab to switch to the target tab (User or Project)
  3. Use the up and down keys to select "Create new command..." and press Enter
    ------------------------------------------------------------------------------------------
    Extend Commands:  [User]  Project
    
    → Create new command...
    
    Command list:
    No project commands found.
    
    Press Enter to select · Esc to exit · Tab to cycle tabs · ↑↓ to navigate
    
  4. In the input box, describe the command functionality you want to create, for example:
    > View all git changes and make a good commit
    
  5. Qoder CN CLI automatically generates the command configuration file and saves it to the corresponding directory. After generation, you can find the configuration file to work with it:
    # Project-level (Project tab)
    .qoder/commands/
    
    # User-level (User tab)
    ~/.qoder/commands/
    

Method 2: Manually Writing the Configuration (Advanced)

Directly write a Markdown-format command configuration file to have full control over the command's prompt content.

Configuration File Format

The command configuration file is in Markdown format, containing frontmatter metadata and a system prompt:
---
name: command-name
description: 命令的作用描述,将在 TUI 命令清单中显示
---

这里是命令的系统提示词内容。
当用户执行该命令时,这段提示词会被提交到对话中,指导 CLI 完成特定任务。

可以使用多行文本,支持 Markdown 格式。
Field descriptions:
FieldRequiredDescription
nameYesThe unique name of the command, used for /command-name invocation
descriptionYesThe functional description of the command; supports multi-line text (using YAML syntax)
Naming conventions:
  • Use lowercase letters and hyphens (for example, git-commit)
  • Avoid spaces or special characters
  • We recommend keeping the file name consistent with the name field
  • Commands in subdirectories use : as the namespace separator; for example, commands/git/commit.md is registered as /git:commit frontmatter.name is used only as the display name in the TUI; the command invocation name is always derived from the file path
  • If a SKILL.md exists in the same directory, that directory is registered as a single command (such as /git), and other sibling .md files in the directory are ignored
  • Command name segments are preserved as-is without character substitution; we recommend consistently using easy-to-type characters in file names

Configuration Example

The following is an example command configuration for generating a Git commit message:
---
name: git-commit
description: Use this command when you need to review all git changes in the current repository and generate a well-structured commit message. This is particularly useful before committing code changes, especially after completing a feature or fixing a bug.
---

You are an expert Git commit message generator. Your role is to analyze all git changes in the repository and create clear, concise, and meaningful commit messages that follow conventional commit standards.

When analyzing changes, you will:
1. Examine all staged and unstaged changes using `git diff` and related commands
2. Identify the type of changes (feat, fix, chore, docs, style, refactor, test, etc.)
3. Determine the scope of changes (which component/module was affected)
4. Summarize the primary change in a clear subject line (50 characters or less)
5. Provide a detailed body explanation if the changes are complex
6. Follow conventional commit format: `<type>(<scope>): <subject>`

Your commit message structure should be:
- Subject line: Brief summary starting with change type
- Blank line
- Body (if needed): Detailed explanation of what changed and why
- Wrap lines at 72 characters

Best practices you follow:
- Use imperative mood ("add" not "added")
- Be specific about what was changed
- Reference issue numbers when relevant
- Keep subject line under 50 characters
- Explain the 'why' behind significant changes
- Group related changes logically

If you encounter unclear changes or need more context, ask clarifying questions. If there are no changes, inform the user accordingly. Always verify your analysis covers all modifications before generating the final commit message.

Storage Locations and Priority

Command configuration files can be stored in project-level or user-level directories:
LevelPathScopeCommitted to the Repository
Project-level.qoder/commands/<command_name>.mdCurrent project onlyRecommended (shared with the team)
User-level~/.qoder/commands/<command_name>.mdAll projectsNot committed (personal configuration)
Priority: If a command with the same name exists at both the project level and the user level, the project-level command takes precedence. While Qoder CN CLI is running, after adding or modifying a command configuration file, run /commands to reload and view the available commands.

Viewing and Using Custom Commands

Viewing Command Details

  1. Run /commands in the TUI to enter the command configuration panel
  2. Press Tab to switch to the target tab (User or Project)
  3. Use the up and down keys to select the target command and press Enter to enter the command details page:
    ------------------------------------------------------------------------------------------
    Extend Commands:  [User]  Project
    
    Name: git-commit
    
    Description
    [project] Use this command when you need to review all git changes in the current
    repository and generate a well-structured commit message. This is particularly useful
    before committing code changes, especially after completing a feature or fixing a bug.
    
    System Prompt
    You are an expert Git commit message generator. Your role is to analyze all git
    changes in the repository and create clear, concise, and meaningful commit messages
    that follow conventional commit standards.
    
    When analyzing changes, you will:
    ...
    
  4. Press Esc to exit the details page

Executing a Command

Enter the command name (starting with /) in the TUI input box, and the CLI automatically displays the list of matching commands:
╭───────────────────────────────────────────────────────╮
│ > /git-commit                                                                         │
╰───────────────────────────────────────────────────────╯
  /git-commit        [user] Use this command when you need to review all git changes ...
Press Enter to send the command, and the CLI starts executing the task according to the system prompt in the command configuration:
> /git-commit

● I'll help you create a commit message by analyzing the git changes in your repository.
  Let me first check the current status.

● Bash (git status)
...

FAQ

Custom Command Not Recognized

Problem: A custom command you created is not displayed or executed in the TUI Solution:
  1. Check that the configuration file path is correct (~/.qoder/commands/ or .qoder/commands/)
  2. Check that the frontmatter format is correct (starts and ends with ---)
  3. Run /commands to reload the command list. If it is still not recognized, restart the CLI (exit with /quit and then run qodercli again)

Frontmatter Parsing Failed

Problem: The YAML format of the command configuration is incorrect Solution:
  • Make sure the frontmatter starts and ends with ---
  • Use | syntax to define a multi-line description field
  • Check that the indentation is correct (YAML is sensitive to indentation)
---
name: my-command
description: |
  这是第一行描述
  这是第二行描述
---