Files
skill-runner/skill-runner-vscode/README.md
2026-01-19 03:32:49 +08:00

66 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Skill Runner
一个简单的 VS Code 扩展,允许您通过右键菜单或命令面板在终端中运行自定义命令,并将选中的文本作为参数传递。
## 功能
- **右键菜单运行** - 在编辑器中选中文本后,右键点击选择"运行技能"执行命令
- **命令面板运行** - 通过 `Ctrl+Shift+P` (或 `Cmd+Shift+P`) 打开命令面板,搜索"Runner: 运行命令"
- **自动处理选中文本** - 选中的文本会自动去除首尾空格,换行和多余空格会被替换为单个空格
- **可自定义命令** - 通过设置或命令面板配置要执行的命令
## 使用方法
### 方法一:右键菜单
1. 在编辑器中选中文本(例如技能名称或参数)
2. 右键点击
3. 选择"运行技能"
### 方法二:命令面板
1.`Ctrl+Shift+P` (Windows/Linux) 或 `Cmd+Shift+P` (macOS)
2. 输入 "Runner: 运行命令"
3. 按回车执行
### 配置命令
1.`Ctrl+Shift+P` (Windows/Linux) 或 `Cmd+Shift+P` (macOS)
2. 输入 "Runner: 配置命令"
3. 输入您想要执行的命令
4. 保存配置
或者在 VS Code 设置中搜索 `skill-runner.command` 进行配置。
## 扩展设置
* `skill-runner.command`: 要在终端中运行的命令(默认:`opencode run`
## 示例
假设配置命令为 `opencode run`
- 选中文本 `hello` → 执行 `opencode run hello`
- 选中文本 `foo bar` → 执行 `opencode run foo bar`
- 选中多行文本会自动合并为单行
## 开发
```bash
# 安装依赖
pnpm install
# 编译
pnpm run compile
# 监听模式
pnpm run watch
# 运行测试
pnpm run test
```
## License
MIT