> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qoder.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Command

Control Qoder CLI's behavior during an interactive session with slash commands.

Commands are shortcuts in Qoder CLI that trigger specific tasks, prefixed with a slash (`/`). Type `/` in TUI mode to view available commands and select one to execute.

## Quick Start

**In TUI mode:**

1. Start Qoder CLI:

   ```bash theme={null}
   qodercli
   ```
2. Type `/` to view the command list
3. Select a command and press Enter to execute:

   ```bash theme={null}
   /config
   ```

**In Headless mode:**

Prompt commands that submit instructions can be executed in Headless mode. Commands that open an interactive picker or dialog must be used in TUI mode.

```bash theme={null}
# Execute with additional instructions
qodercli -p '/review Focus on security vulnerabilities'

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

## Command Types

Qoder CLI commands are divided into two types:

| Type       | Description                                       | Mode           | Extensibility              |
| ---------- | ------------------------------------------------- | -------------- | -------------------------- |
| **TUI**    | Provides interactive UI (dialogs, list selection) | TUI            | Built-in, not customizable |
| **Prompt** | Submits preset prompts to guide CLI tasks         | TUI + Headless | User-customizable          |

## Built-in Commands

| Command              | Type   | Purpose                                                                                                     |
| -------------------- | ------ | ----------------------------------------------------------------------------------------------------------- |
| `/agents`            | TUI    | Manage Subagent configurations                                                                              |
| `/tasks`             | TUI    | List and manage background tasks                                                                            |
| `/workflows`         | TUI    | Open the workflow task panel. See [Dynamic workflows](/en/cli/workflows)                                    |
| `/clear`             | TUI    | Clear conversation history and free up context                                                              |
| `/commands`          | TUI    | Manage extend commands for current workspace                                                                |
| `/compact`           | Prompt | Summarize current session to compact the context, usage: /compact \[instructions]                           |
| `/config`            | TUI    | Manage Qoder CLI configurations                                                                             |
| `/export [filename]` | TUI    | Export current session to a file, usage: /export \[filename]                                                |
| `/feedback`          | TUI    | Submit feedback about Qoder CLI, usage: /feedback content                                                   |
| `/help`              | TUI    | Show help and available commands                                                                            |
| `/init`              | TUI    | Initialize a new `AGENTS.md` file with codebase documentation                                               |
| `/login`             | TUI    | Sign in with your Qoder account                                                                             |
| `/logout`            | TUI    | Sign out of your Qoder account                                                                              |
| `/mcp`               | TUI    | List and manage mcp servers                                                                                 |
| `/memory`            | TUI    | Open the memory overview; open the auto-memory folder or use `/memory manage` for topic files               |
| `/model`             | TUI    | List and manage settings of model level                                                                     |
| `/effort [level]`    | TUI    | Set reasoning effort for the current model, or open model options when no level is provided                 |
| `/context-window`    | TUI    | Set the context window for the current model, or open model options                                         |
| `/fast [on\|off]`    | TUI    | Toggle fast mode for the current model, or open model options                                               |
| `/quest`             | Prompt | Intelligent workflow orchestrator that guides users through feature development using specialized subagents |
| `/quit`              | TUI    | Quit the program, equivalent to /exit                                                                       |
| `/release-notes`     | TUI    | View release notes                                                                                          |
| `/resume`            | TUI    | Resume a previous conversation from history                                                                 |
| `/review`            | Prompt | Review local pending git changes, usage: /review \[instruction]                                             |
| `/setup-github`      | TUI    | Set up Qoder GitHub Actions                                                                                 |
| `/skills`            | TUI    | Manage Skill commands for current workspace                                                                 |
| `/status`            | TUI    | Show Qoder CLI status                                                                                       |
| `/upgrade`           | TUI    | Open browser to upgrade your Qoder account plan                                                             |
| `/usage`             | TUI    | Show current plan usage summary                                                                             |
| `/vim`               | TUI    | Open external editor for input                                                                              |

## Creating Commands

Custom commands allow you to define frequently used prompts as Markdown files that Qoder CLI can execute. Commands are organized by scope (project-specific or personal).

### Method 1: AI-Assisted Generation (Recommended)

Use TUI's built-in AI assistance to quickly generate command configurations:

1. Run `/commands` in TUI to open the commands panel
2. Press `Tab` to switch to User or Project tab
3. Select "Create new command..." and press `Enter`
4. Describe the command you want to create:

   ```
   > View all git changes and make a good commit
   ```
5. Qoder CLI auto-generates the configuration file
6. Find the generated file for fine-tuning:

   ```bash theme={null}
   # Project-level (Project tab)
   .qoder/commands/

   # User-level (User tab)
   ~/.qoder/commands/
   ```

### Method 2: Manual Configuration (Advanced)

Create Markdown configuration files directly for full control over command prompts.

#### Configuration Format

Command files use Markdown format with YAML frontmatter and a system prompt:

```markdown theme={null}
---
name: command-name
description: Brief description shown in command list
---

This is the system prompt content.
When a user executes this command, this prompt guides the CLI to complete the task.

Supports multi-line text and Markdown formatting.
```

#### Field Reference

| Field         | Required | Description                                               |
| ------------- | :------: | --------------------------------------------------------- |
| `name`        |    Yes   | Unique command name for `/command-name` invocation        |
| `description` |    Yes   | Command description, supports multi-line with YAML syntax |

#### Naming Conventions

* Use lowercase letters and hyphens (e.g., `git-commit`)
* Avoid spaces or special characters
* Filename should match the `name` field
* Commands inside subdirectories use `:` as the namespace separator (e.g., `commands/git/commit.md` registers as `/git:commit`)
* `frontmatter.name` is only used as the display label in the TUI; the slash-command identity is always derived from the file path
* If a directory contains `SKILL.md`, the directory registers as a single command (e.g., `/git`) and sibling `.md` files in the same directory are ignored
* Command name segments are preserved verbatim with no character substitution; stick to typeable characters in filenames for the best experience

#### Example

A command for generating Git commit messages:

```markdown theme={null}
---
name: git-commit
description: Review all git changes and generate a well-structured commit message following conventional commit standards.
---

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.
```

### Storage Locations and Priority

| Level             | Path                                  | Scope                | Version Control            |
| ----------------- | ------------------------------------- | -------------------- | -------------------------- |
| **Project-level** | `.qoder/commands/<command_name>.md`   | Current project only | Recommended (team sharing) |
| **User-level**    | `~/.qoder/commands/<command_name>.md` | All projects         | Not committed (personal)   |

**Priority:** Project-level commands take precedence over user-level commands with the same name.

Run `/commands` to reload and list available slash commands after creating or modifying command files while Qoder CLI is running.

## Using Custom Commands

### View Command Details

1. Run `/commands` in TUI to open the commands panel
2. Press `Tab` to switch between User and Project tabs
3. Select a command and press `Enter` to view details:

   ```
   ------------------------------------------------------------------------------------------
   Extend Commands:  [User]  Project

   Name: git-commit

   Description
   [project] Review all git changes and generate a well-structured commit message...

   System Prompt
   You are an expert Git commit message generator...
   ```
4. Press `Esc` to exit the details view

### Execute Commands

Type the command name (starting with `/`) in TUI. CLI auto-displays matching commands:

```
╭───────────────────────────────────────────────────────╮
│ > /git-commit                                                                         │
╰───────────────────────────────────────────────────────╯
  /git-commit        [user] Use this command when you need to review all git changes ...
```

Press `Enter` to execute. CLI follows the command's system prompt:

```
> /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:** Created command doesn't appear or execute in TUI

**Solution:**

1. Check file path (`~/.qoder/commands/` or `.qoder/commands/`)
2. Verify frontmatter format (starts and ends with `---`)
3. Run `/commands` to reload the command list. If the issue remains, restart CLI (`/quit` then run `qodercli` again).

### Frontmatter parsing failed

**Problem:** YAML format is incorrect

**Solution:**

* Ensure frontmatter starts and ends with `---`
* Use `|` syntax for multi-line `description` fields
* Check indentation (YAML is indentation-sensitive)

```yaml theme={null}
---
name: my-command
description: |
  First line of description
  Second line of description
---
```
