Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions src/os-skills/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ A curated collection of operational skills for AI Agents, covering system admini
### Security
- **alinux-cve-query** — Query Alibaba Cloud Linux CVE vulnerability info

### Other
- **cosh-guide** - Copilot Shell user guide

## Skill Format

Each skill lives in its own directory with at least a `SKILL.md` file:
Expand Down
45 changes: 45 additions & 0 deletions src/os-skills/others/cosh-guide/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: cosh-guide
description: Copilot Shell (cosh) CLI 用户指南和帮助文档。用于回答关于 Copilot Shell 的使用、命令、配置、功能特性等问题。
当用户询问 Copilot Shell 的使用方法、命令参考、配置方式、功能说明时使用此 skill。
---

# Copilot Shell (COSH) 用户指南

你是 Copilot Shell (COSH) CLI 工具的用户帮助助手。当用户询问 Copilot Shell 的使用问题时,根据问题类型参考对应的文档来回答。

## 文档索引

根据用户问题的类别,参考以下对应的参考文档:

### 命令参考
- 斜杠命令 (`/`)、@文件引用、`!`shell 命令、自定义命令、快捷键
- 参考: [commands.md](reference/commands.md)

### 功能特性
- 审批模式 (Plan/Default/Auto-Edit/YOLO)
- Headless 模式 (非交互式/脚本化)
- MCP (Model Context Protocol) 外部工具集成
- Agent Skills (实验性扩展能力)
- Subagents (子代理/专业化AI助手)
- Checkpointing (检查点/状态恢复)
- LSP (语言服务器协议,代码智能)
- Token 缓存与成本优化
- 国际化与语言设置
- 参考: [features.md](reference/features.md)

### 配置
- settings.json 配置层级与选项
- 认证 (OAuth / API Key)
- 主题设置与自定义
- 可信文件夹
- 命令行参数
- 环境变量
- 参考: [configuration.md](reference/configuration.md)

## 回答规范

1. 根据用户问题判断属于哪个类别,读取对应的参考文档
2. 用简洁清晰的语言回答,提供具体的命令或配置示例
3. 如果问题涉及多个类别,综合多个参考文档的信息
4. 对于不确定的信息,建议用户使用 `/help` 命令或查看官方文档
191 changes: 191 additions & 0 deletions src/os-skills/others/cosh-guide/reference/commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
# Commands Reference

Qwen Code commands use three prefixes:

| Prefix | Function | Example |
|---|---|---|
| `/` (Slash) | Meta-level control of Qwen Code | `/help`, `/settings` |
| `@` (At) | Inject local file content into conversation | `@src/main.py explain this` |
| `!` (Exclamation) | Direct system shell interaction | `!git status`, `!ls` |

---

## 1. Slash Commands (`/`)

### 1.1 Session and Project Management

| Command | Description | Usage |
|---|---|---|
| `/init` | Analyze directory and create initial context file | `/init` |
| `/summary` | Generate project summary from conversation | `/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` or `/restore <ID>` |

### 1.2 Interface and Workspace Control

| Command | Description | Usage |
|---|---|---|
| `/clear` | Clear terminal screen | `/clear` (Ctrl+L) |
| `/theme` | Change visual theme | `/theme` |
| `/vim` | Toggle Vim editing mode | `/vim` |
| `/directory` | Manage multi-directory workspace | `/dir add ./src,./tests` |
| `/editor` | Select supported editor | `/editor` |

### 1.3 Language Settings

| Command | Description | Usage |
|---|---|---|
| `/language` | View/change language settings | `/language` |
| `/language ui [lang]` | Set UI language | `/language ui zh-CN` |
| `/language output [lang]` | Set LLM output language | `/language output Chinese` |

Built-in UI languages: `zh-CN`, `en-US`, `ru-RU`, `de-DE`, `ja-JP`
Aliases: `zh`, `en`, `ru`, `de`, `ja`

### 1.4 Tool and Model Management

| Command | Description | Usage |
|---|---|---|
| `/mcp` | List configured MCP servers/tools | `/mcp`, `/mcp desc` |
| `/tools` | Display available tool list | `/tools`, `/tools desc` |
| `/skills` | List/run available skills (experimental) | `/skills`, `/skills <name>` |
| `/approval-mode` | Change approval mode | `/approval-mode <mode> --project` |
| `/model` | Switch model in current session | `/model` |
| `/extensions` | List active extensions | `/extensions` |
| `/memory` | Manage AI instruction context | `/memory add Important Info` |

Approval modes: `plan` (read-only), `default` (manual approval), `auto-edit` (auto-approve edits), `yolo` (auto-approve all)

### 1.5 Information, Settings, and Help

| Command | Description | Usage |
|---|---|---|
| `/help` | Display help | `/help` or `/?` |
| `/about` | Display version info | `/about` |
| `/stats` | Session statistics | `/stats` |
| `/settings` | Open settings editor | `/settings` |
| `/auth` | Change authentication | `/auth` |
| `/bug` | Submit issue | `/bug Button unresponsive` |
| `/copy` | Copy last output to clipboard | `/copy` |
| `/quit` | Exit Qwen Code | `/quit` or `/exit` |

---

## 2. @ Commands (File References)

| Format | Description | Example |
|---|---|---|
| `@<file path>` | Inject file content | `@src/main.py Please explain this` |
| `@<directory>` | Read all text files recursively | `@docs/ Summarize this` |
| `@server: resource` | Reference MCP resources | `@github: repos/owner/repo/issues` |

Notes:
- Spaces in paths need backslash escaping: `@My\ Documents/file.txt`
- File paths can be relative or absolute
- `@` file references auto-load `QWEN.md` from the file's directory and parents
- Multiple files: `@file1.js and @file2.js`

---

## 3. Exclamation Commands (`!`) - Shell

| Format | Description | Example |
|---|---|---|
| `!<command>` | Execute in sub-shell | `!ls -la`, `!git status` |
| Standalone `!` | Toggle shell mode (all input as commands) | `!` (enter) -> commands -> `!` (exit) |

Environment: Commands via `!` set `QWEN_CODE=1`.

---

## 4. Custom Commands

Save frequently used prompts as shortcut commands.

### Storage Locations

| Type | Location | Priority |
|---|---|---|
| Global | `~/.qwen/commands/` | Low |
| Project | `<project>/.qwen/commands/` | High (overrides global) |

### Naming

File path maps to command name:
- `~/.qwen/commands/test.md` -> `/test`
- `<project>/.qwen/commands/git/commit.md` -> `/git:commit`

### Markdown Format (Recommended)

```markdown
---
description: Optional description (shown in /help)
---

Your prompt content here.
Use {{args}} for parameter injection.
```

### Dynamic Content Injection

| Type | Syntax | Purpose |
|---|---|---|
| File Content | `@{file path}` | Inject static reference files |
| Shell Commands | `!{command}` | Inject execution results (requires confirmation) |
| Parameters | `{{args}}` | Inject user parameters |

### Example: Git Commit Command

````markdown
---
description: Generate Commit message based on staged changes
---

Please generate a Commit message based on the following diff:

```diff
!{git diff --staged}
```
````

---

## 5. Keyboard Shortcuts

### General

| Shortcut | Description |
|---|---|
| `Esc` | Close dialogs/suggestions |
| `Ctrl+C` | Cancel request / clear input (press twice to exit) |
| `Ctrl+D` | Exit if input empty (press twice to confirm) |
| `Ctrl+L` | Clear screen |
| `Ctrl+O` | Toggle debug console |
| `Ctrl+S` | Allow long responses to print fully |
| `Ctrl+T` | Toggle tool descriptions |
| `Shift+Tab` | Cycle approval modes |

### Input Prompt

| Shortcut | Description |
|---|---|
| `!` | Toggle shell mode (empty input) |
| `?` | Toggle shortcuts display (empty input) |
| `\` + Enter | Insert newline |
| `Tab` | Autocomplete suggestion |
| Up/Down Arrow | Navigate input history |
| `Ctrl+R` | Reverse search history |
| `Ctrl+V` | Paste clipboard (supports images) |
| `Ctrl+X` / `Meta+Enter` | Open in external editor |
| `Ctrl+A` / `Home` | Beginning of line |
| `Ctrl+E` / `End` | End of line |
| `Ctrl+K` | Delete to end of line |
| `Ctrl+U` | Delete to beginning of line |
| `Ctrl+W` | Delete word left |

### IDE Integration

| Shortcut | Description |
|---|---|
| `Ctrl+G` | See context from IDE |
Loading