Skip to content
Closed
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 61 additions & 10 deletions docs/users/features/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ Slash commands are used to manage Qwen Code sessions, interface, and basic behav

These commands help you save, restore, and summarize work progress.

| Command | Description | Usage Examples |
| ----------- | --------------------------------------------------------- | ------------------------------------ |
| `/init` | Analyze current directory and create initial context file | `/init` |
| `/summary` | Generate project summary based on conversation history | `/summary` |
| `/compress` | Replace chat history with summary to save Tokens | `/compress` |
| `/resume` | Resume a previous conversation session | `/resume` |
| `/restore` | Restore files to state before tool execution | `/restore` (list) or `/restore <ID>` |
| Command | Description | Usage Examples |
| ------------ | --------------------------------------------------------- | ------------------------------------ |
| `/init` | Analyze current directory and create initial context file | `/init` |
| `/summary` | Generate project summary based on conversation history | `/summary` |
| `/compress` | Replace chat history with summary to save Tokens | `/compress` |
| `/resume` | Resume a previous conversation session | `/resume` |
| `/restore` | Restore files to state before tool execution | `/restore` (list) or `/restore <ID>` |
| `/thinkback` | Review session timeline of key decisions, changes & fixes | `/thinkback --topic "auth"` |

### 1.2 Interface and Workspace Control

Expand Down Expand Up @@ -139,7 +140,57 @@ The `/btw` command allows you to ask quick side questions without interrupting o
>
> Use `/btw` when you need a quick answer without derailing your main task. It's especially useful for clarifying concepts, checking facts, or getting quick explanations while staying focused on your primary workflow.

### 1.6 Information, Settings, and Help
### 1.6 Session Timeline Review (`/thinkback`)

The `/thinkback` command analyzes the current conversation history and generates a structured timeline of key events — decisions made, files modified, and bugs fixed during the session.

| Command | Description |
| -------------------------------------- | ----------------------------------------------- |
| `/thinkback` | Generate a full session timeline |
| `/thinkback --from "30 min ago"` | Only include events from a specific time range |
| `/thinkback --topic "auth"` | Only include events related to a specific topic |
| `/thinkback --from "1h ago" --topic X` | Combine time range and topic filters |

**How It Works:**

- The curated conversation history is sent to the LLM with a prompt to extract key events
- The LLM returns a structured Markdown timeline with numbered steps
- Each step is categorized as a Decision, Fix, or Change, with affected files noted
- The command blocks the main conversation while generating (unlike `/btw`)

**Example:**

```
> /thinkback

# Timeline Review
- **Step 1** — [Change] Updated auth middleware to fix session token storage (auth.ts)
- **Step 2** — [Decision] Switched to JWT-based tokens for compliance (config.ts, auth.ts)
- **Step 3** — [Fix] Resolved token refresh race condition (tokenManager.ts)
```

With filtering:

```
> /thinkback --from "30 min ago" --topic "auth"

# Timeline Review
- **Step 1** — [Fix] Fixed session token storage format for compliance (auth.ts)
```

**Supported Execution Modes:**

| Mode | Behavior |
| -------------------- | ----------------------------------------------- |
| Interactive | Shows pending indicator, then displays timeline |
| Non-interactive | Returns timeline as text result |
| ACP (Agent Protocol) | Returns stream_messages async generator |

> [!tip]
>
> Use `/thinkback` at the end of a long session to get a quick recap of everything that happened. It's especially useful before creating a commit message, writing a PR description, or handing off work to a colleague.

### 1.7 Information, Settings, and Help

Commands for obtaining information and performing system settings.

Expand All @@ -154,7 +205,7 @@ Commands for obtaining information and performing system settings.
| `/copy` | Copy last output content to clipboard | `/copy` |
| `/quit` | Exit Qwen Code immediately | `/quit` or `/exit` |

### 1.7 Common Shortcuts
### 1.8 Common Shortcuts

| Shortcut | Function | Note |
| ------------------ | ----------------------- | ---------------------- |
Expand All @@ -164,7 +215,7 @@ Commands for obtaining information and performing system settings.
| `Ctrl/cmd+Z` | Undo input | Text editing |
| `Ctrl/cmd+Shift+Z` | Redo input | Text editing |

### 1.8 CLI Auth Subcommands
### 1.9 CLI Auth Subcommands

In addition to the in-session `/auth` slash command, Qwen Code provides standalone CLI subcommands for managing authentication directly from the terminal:

Expand Down
12 changes: 12 additions & 0 deletions packages/cli/src/i18n/locales/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,18 @@ export default {
'Generating project summary...': 'Projektzusammenfassung wird generiert...',
'Failed to generate summary - no text content received from LLM response':
'Fehler beim Generieren der Zusammenfassung - kein Textinhalt von LLM-Antwort erhalten',
// Thinkback
'Review the key decisions, modifications, and bug fixes in the current session timeline.':
'Überprüfen Sie die wichtigsten Entscheidungen, Änderungen und Fehlerbehebungen in der aktuellen Sitzungszeitleiste.',
'No chat client available to generate thinkback.':
'Kein Chat-Client verfügbar, um Thinkback zu generieren.',
'Already generating thinkback, wait for previous request to complete':
'Thinkback wird bereits generiert, warten Sie auf Abschluss der vorherigen Anfrage',
'No conversation found to review.':
'Keine Unterhaltung zum Überprüfen gefunden.',
'Generating thinkback timeline...': 'Thinkback-Zeitleiste wird generiert...',
'Failed to generate thinkback - no text content received from LLM response':
'Fehler beim Generieren von Thinkback - kein Textinhalt von der LLM-Antwort erhalten',

// ============================================================================
// Commands - Model
Expand Down
14 changes: 14 additions & 0 deletions packages/cli/src/i18n/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,20 @@ export default {
'Failed to generate summary - no text content received from LLM response':
'Failed to generate summary - no text content received from LLM response',

// ============================================================================
// Commands - Thinkback
// ============================================================================
'Review the key decisions, modifications, and bug fixes in the current session timeline.':
'Review the key decisions, modifications, and bug fixes in the current session timeline.',
'No chat client available to generate thinkback.':
'No chat client available to generate thinkback.',
'Already generating thinkback, wait for previous request to complete':
'Already generating thinkback, wait for previous request to complete',
'No conversation found to review.': 'No conversation found to review.',
'Generating thinkback timeline...': 'Generating thinkback timeline...',
'Failed to generate thinkback - no text content received from LLM response':
'Failed to generate thinkback - no text content received from LLM response',

// ============================================================================
// Commands - Model
// ============================================================================
Expand Down
11 changes: 11 additions & 0 deletions packages/cli/src/i18n/locales/ja.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,17 @@ export default {
'Generating project summary...': 'プロジェクトサマリーを生成中...',
'Failed to generate summary - no text content received from LLM response':
'サマリーの生成に失敗 - LLMレスポンスからテキストコンテンツを受信できませんでした',
// Thinkback
'Review the key decisions, modifications, and bug fixes in the current session timeline.':
'現在のセッションタイムラインの主要な決定、変更、バグ修正を振り返ります。',
'No chat client available to generate thinkback.':
'振り返りを生成するためのチャットクライアントが利用できません。',
'Already generating thinkback, wait for previous request to complete':
'振り返り生成中です。前のリクエストの完了をお待ちください',
'No conversation found to review.': '振り返る会話が見つかりません。',
'Generating thinkback timeline...': '振り返りタイムラインを生成中...',
'Failed to generate thinkback - no text content received from LLM response':
'振り返りの生成に失敗 - LLMレスポンスからテキストコンテンツを受信できませんでした',
// Model
'Switch the model for this session': 'このセッションのモデルを切り替え',
'Set fast model for background tasks':
Expand Down
12 changes: 12 additions & 0 deletions packages/cli/src/i18n/locales/pt.js
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,18 @@ export default {
'Generating project summary...': 'Gerando resumo do projeto...',
'Failed to generate summary - no text content received from LLM response':
'Falha ao gerar resumo - nenhum conteúdo de texto recebido da resposta do LLM',
// Thinkback
'Review the key decisions, modifications, and bug fixes in the current session timeline.':
'Revise as principais decisões, modificações e correções de bugs na linha do tempo da sessão atual.',
'No chat client available to generate thinkback.':
'Nenhum cliente de chat disponível para gerar o thinkback.',
'Already generating thinkback, wait for previous request to complete':
'Já gerando o thinkback, aguarde a conclusão da solicitação anterior',
'No conversation found to review.':
'Nenhuma conversa encontrada para revisar.',
'Generating thinkback timeline...': 'Gerando linha do tempo do thinkback...',
'Failed to generate thinkback - no text content received from LLM response':
'Falha ao gerar o thinkback - nenhum conteúdo de texto recebido da resposta do LLM',

// ============================================================================
// Commands - Model
Expand Down
11 changes: 11 additions & 0 deletions packages/cli/src/i18n/locales/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,17 @@ export default {
'Generating project summary...': 'Генерация сводки проекта...',
'Failed to generate summary - no text content received from LLM response':
'Не удалось сгенерировать сводку - не получен текстовый контент из ответа LLM',
// Thinkback
'Review the key decisions, modifications, and bug fixes in the current session timeline.':
'Просмотрите ключевые решения, изменения и исправления ошибок в хронологии текущей сессии.',
'No chat client available to generate thinkback.':
'Нет доступного чат-клиента для генерации thinkback.',
'Already generating thinkback, wait for previous request to complete':
'Генерация thinkback уже выполняется, дождитесь завершения предыдущего запроса',
'No conversation found to review.': 'Не найдено диалогов для просмотра.',
'Generating thinkback timeline...': 'Генерация хронологии thinkback...',
'Failed to generate thinkback - no text content received from LLM response':
'Не удалось сгенерировать thinkback — не получен текстовый контент из ответа LLM',

// ============================================================================
// Команды - Модель
Expand Down
14 changes: 14 additions & 0 deletions packages/cli/src/i18n/locales/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,20 @@ export default {
'Failed to generate summary - no text content received from LLM response':
'生成摘要失败 - 未从 LLM 响应中接收到文本内容',

// ============================================================================
// Commands - Thinkback
// ============================================================================
'Review the key decisions, modifications, and bug fixes in the current session timeline.':
'回顾当前会话时间线中的关键决策、修改和 Bug 修复。',
'No chat client available to generate thinkback.':
'没有可用的聊天客户端来生成回顾。',
'Already generating thinkback, wait for previous request to complete':
'正在生成回顾,请等待上一个请求完成',
'No conversation found to review.': '未找到可回顾的对话。',
'Generating thinkback timeline...': '正在生成回顾时间线...',
'Failed to generate thinkback - no text content received from LLM response':
'生成回顾失败 - 未从 LLM 响应中接收到文本内容',

// ============================================================================
// Commands - Model
// ============================================================================
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/nonInteractiveCliCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const ALLOWED_BUILTIN_COMMANDS_NON_INTERACTIVE = [
'compress',
'btw',
'bug',
'thinkback',
] as const;

/**
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/services/BuiltinCommandLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import { statsCommand } from '../ui/commands/statsCommand.js';
import { summaryCommand } from '../ui/commands/summaryCommand.js';
import { terminalSetupCommand } from '../ui/commands/terminalSetupCommand.js';
import { themeCommand } from '../ui/commands/themeCommand.js';
import { thinkbackCommand } from '../ui/commands/thinkbackCommand.js';
import { toolsCommand } from '../ui/commands/toolsCommand.js';
import { vimCommand } from '../ui/commands/vimCommand.js';
import { setupGithubCommand } from '../ui/commands/setupGithubCommand.js';
Expand Down Expand Up @@ -112,6 +113,7 @@ export class BuiltinCommandLoader implements ICommandLoader {
statsCommand,
summaryCommand,
themeCommand,
thinkbackCommand,
toolsCommand,
settingsCommand,
vimCommand,
Expand Down
Loading
Loading