Skip to content

JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.

Python

fix:将/skills import合入到/skills install命令中

openJiuwen-botd823878e198b
diff --git a/docs/en/SlashCommands.md b/docs/en/SlashCommands.md
index 9b677411ff..c2f0865a66 100644
--- a/docs/en/SlashCommands.md
+++ b/docs/en/SlashCommands.md
@@ -40,7 +40,7 @@ Identified by Gateway and forwarded to AgentServer and other backend capabilitie
| `/new_session` | Create new session (IM only) |
| `/mode` | Mode switching (supports first-level entry and direct syntax) |
| `/switch` | Switch second-level mode within current mode family |
-| `/skills` | Skills management (list, install, import, uninstall, marketplace) (see below) |
+| `/skills` | Skills management (list, install, uninstall, marketplace) (see below) |
| `/model` | Model view, add, switch (see below) |
| `/mcp` | MCP server management (see below) |
| `/diff` | View session changes by turn (see below) |
@@ -269,15 +269,14 @@ Manages directories AI can access for file read, edit, and execute operations.
### `/skills` (Skills Management)
-Manage skills lifecycle: listing, installing, importing, uninstalling, and marketplace source management.
+Manage skills lifecycle: listing, installing, uninstalling, and marketplace source management.
#### Subcommands
| Command | Description |
|---|---|
| `/skills` or `/skills list` | List skills (grouped: Installed / Available to install) |
-| `/skills install <skill>` or `/skills install <skill@marketplace>` | Install a skill: builtin skills accept bare name, marketplace skills use `<name>@<marketplace>` format |
-| `/skills import <path>` | Import a custom skill from a local path or remote URL |
+| `/skills install <skill>` or `/skills install <skill@marketplace>` or `/skills install <path_or_url>` | Install a skill: builtin skills accept bare name, marketplace skills use `<name>@<marketplace>` format, local paths and remote URLs are auto-detected |
| `/skills uninstall <name>` | Uninstall a skill by name |
| `/skills marketplace` or `/skills marketplace list` | List marketplace sources (name, URL, enabled status, last updated) |
| `/skills marketplace add <name> <url>` | Add a new marketplace source |
@@ -291,7 +290,7 @@ Manage skills lifecycle: listing, installing, importing, uninstalling, and marke
- **Builtin skill**: A preset skill shipped with the software. Install using bare skill name (e.g., `/skills install advanced-daily-report`); no marketplace source needed.
- **Marketplace source**: A remote repository (typically a Git URL) that hosts available skills. Each source has a name, URL, and enabled/disabled state.
- **Spec**: The install identifier format `<skill>@<marketplace>` used when installing from a marketplace; for builtin skills, omit `@` and the system auto-detects as `@builtin`.
-- **Import**: Copy a local directory (must contain `SKILL.md`) or remote archive URL into the workspace as a custom skill.
+- **Local install**: Use `/skills install <path>` to install from a local directory (must contain `SKILL.md`) or remote archive URL; paths/URLs are auto-detected and routed to the local import flow.
- **Install location**: The directory where a skill is stored after installation (`~/.jiuwenclaw/agent/jiuwenclaw_workspace/skills/`).
- **Source tag**: Each skill in the list is tagged with its source: `[builtin]` = builtin, `[local]` = imported, `[project]` or marketplace name = other.
@@ -300,7 +299,7 @@ Manage skills lifecycle: listing, installing, importing, uninstalling, and marke
`/skills list` returns skills in two groups:
1. **Installed**: Skills already in the user's skills directory, ready to use.
-2. **Available to install**: Builtin skills not yet installed, plus marketplace skills available for installation. Use `/skills install` or `/skills import` first.
+2. **Available to install**: Builtin skills not yet installed, plus marketplace skills available for installation. Use `/skills install` first.
#### IM vs TUI Differences
@@ -311,12 +310,13 @@ Both ultimately request `skills.list`, but trigger methods and display differ.
| IM (Feishu etc. controlled channel) | Exact match `/skills list` (whitespace normalized first) | Gateway intercepts control message and requests `skills.list`, results shown as IM notification/card; standalone `/skills` doesn't go through this control path. |
| TUI (CLI built-in) | Input `/skills` | Locally executes built-in command and calls `skills.list`, displays as grouped list view in session (titles `Installed Skills` and `Available Skills`); shows `No installed skills` when empty. |
-For other subcommands (`/skills install`, `/skills import`, `/skills uninstall`, `/skills marketplace add/remove/toggle`, `/skills use`), Gateway does **not** intercept them — on the IM side they are treated as regular chat messages. These subcommands are only functional on the TUI (CLI built-in) and Web UI paths, where they send RPC requests directly to AgentServer.
+For other subcommands (`/skills install`, `/skills uninstall`, `/skills marketplace add/remove/toggle`, `/skills use`), Gateway does **not** intercept them — on the IM side they are treated as regular chat messages. These subcommands are only functional on the TUI (CLI built-in) and Web UI paths, where they send RPC requests directly to AgentServer.
#### Notes
-- **Timeout**: `install`, `import`, `uninstall`, and `marketplace toggle` requests have a 120-second timeout on the TUI side; other subcommands have no explicit timeout.
+- **Timeout**: `install`, `uninstall`, and `marketplace toggle` requests have a 120-second timeout on the TUI side; other subcommands have no explicit timeout.
- **Builtin auto-detection**: When installing with `/skills install <skill>` (no `@`), the system checks if it matches a builtin skill and redirects to the builtin install flow; if not, a format hint is returned.
+- **Path/URL auto-detection**: When installing with `/skills install <path>` (local path like `/path/to/skill` or `C:\skill`, or remote URL `https://...`), the system automatically routes to the local import flow.
- **Cache cleanup**: `marketplace remove` sends `{ name, remove_cache: true }` to also clear the local cache for that source.
- **Auto-refresh**: `marketplace add`, `marketplace remove`, and `marketplace toggle` automatically re-list marketplace sources after a successful operation.
- **Offline handling**: `/skills use` checks connection status; if offline, shows `offline: waiting for reconnect before sending /skills use request`.
@@ -328,8 +328,8 @@ For other subcommands (`/skills install`, `/skills import`, `/skills uninstall`,
- `/skills install advanced-daily-report` — Install a builtin skill (bare name auto-detect)
- `/skills install advanced-daily-report@builtin` — Install a builtin skill (explicit format)
- `/skills install my-skill@marketplace` — Install a skill from marketplace
-- `/skills import /path/to/my-skill` — Import a skill from local directory
-- `/skills import https://example.com/skill.zip` — Import a skill from remote URL
+- `/skills install /path/to/my-skill` — Install a skill from local directory
+- `/skills install https://example.com/skill.zip` — Install a skill from remote URL
- `/skills uninstall my-skill` — Uninstall a skill
- `/skills marketplace list` — List marketplace sources
- `/skills marketplace add community https://github.com/user/skills-repo` — Add a marketplace source named "community"
diff --git "a/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md" "b/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md"
index c4419df3ac..7b813494fa 100644
--- "a/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md"
+++ "b/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md"
@@ -40,7 +40,7 @@
| `/new_session` | 新建会话(仅 IM 生效) |
| `/mode` | 模式切换(支持一级入口与直达写法) |
| `/switch` | 在当前模式族内切换二级模式 |
-| `/skills` | 技能管理(列表、安装、导入、卸载、市场源) |
+| `/skills` | 技能管理(列表、安装、卸载、市场源) |
| `/model` | 模型查看、新增、切换(见下文) |
| `/mcp` | MCP 服务管理(见下文) |
| `/diff` | 查看当前会话按轮次改动(见下文) |
@@ -291,15 +291,14 @@
### `/skills`(技能管理)
-管理技能的完整生命周期:列表查看、安装、导入、卸载以及市场源管理。
+管理技能的完整生命周期:列表查看、安装、卸载以及市场源管理。
#### 子命令
| 命令 | 说明 |
|---|---|
| `/skills` 或 `/skills list` | 列出技能(分两组:已安装 / 可安装) |
-| `/skills install <skill>` 或 `/skills install <skill@marketplace>` | 安装技能:内置技能可直接用名称,市场技能需用 `<名称>@<市场源>` 格式 |
-| `/skills import <path>` | 从本地路径或远程 URL 导入自定义技能 |
+| `/skills install <skill>` 或 `/skills install <skill@marketplace>` 或 `/skills install <path_or_url>` | 安装技能:内置技能可直接用名称,市场技能需用 `<名称>@<市场源>` 格式,本地路径或远程 URL 可直接传入路径 |
| `/skills uninstall <name>` | 按名称卸载技能 |
| `/skills marketplace` 或 `/skills marketplace list` | 列出市场源(名称、URL、启用状态、最后更新时间) |
| `/skills marketplace add <name> <url>` | 添加新的市场源 |
@@ -313,7 +312,7 @@
- **内置技能(Builtin skill)**:随软件打包发布的预置技能,安装时可直接使用技能名称(如 `/skills install advanced-daily-report`),无需指定市场源。
- **市场源(Marketplace source)**:托管可用技能的远程仓库(通常为 Git URL),每个源包含名称、URL 和启用/禁用状态。
- **规格标识(Spec)**:从市场源安装时使用的标识格式 `<技能名>@<市场源名>`;内置技能安装时可不带 `@`,自动识别为 `@builtin`。
-- **本地导入(Import)**:将本地目录(需包含 `SKILL.md`)或远程归档 URL 导入为自定义技能。
+- **本地安装(Local install)**:通过 `/skills install <path>` 将本地目录(需包含 `SKILL.md`)或远程归档 URL 安装为自定义技能;路径/URL 会自动识别并走本地导入流程。
- **安装位置(Install location)**:技能安装后的存储目录(`~/.jiuwenclaw/agent/jiuwenclaw_workspace/skills/`)。
- **来源标签(Source tag)**:列表中每项技能标注来源,`[builtin]` 表示内置、`[local]` 表示本地导入、`[project]` 或市场源名表示其他来源。
@@ -322,7 +321,7 @@
`/skills list` 返回的技能列表分为两组:
1. **已安装(Installed)**:已存在于用户 skills 目录的技能,可直接使用。
-2. **可安装(Available to install)**:内置但尚未安装的技能,以及市场源中可安装的技能,需先执行 `/skills install` 或 `/skills import` 才能使用。
+2. **可安装(Available to install)**:内置但尚未安装的技能,以及市场源中可安装的技能,需先执行 `/skills install` 才能使用。
#### IM 与 TUI 的差异
@@ -333,12 +332,13 @@
| IM(飞书等受控通道) | 整行精确匹配 `/skills list`(会先做空白规范化) | Gateway 拦截控制消息并请求 `skills.list`,结果以 IM 通知/卡片等形式展示;单独输入 `/skills` 不走该控制路径。 |
| TUI(CLI 内置) | 输入 `/skills` | 本地执行内置命令并调用 `skills.list`,在会话内以分组列表视图展示(标题 `Installed Skills` 与 `Available Skills`);无数据时提示 `No installed skills`。 |
-对于其他子命令(`/skills install`、`/skills import`、`/skills uninstall`、`/skills marketplace add/remove/toggle`、`/skills use`),Gateway **不会拦截**——在 IM 侧输入时会被当作普通聊天消息发送给 Agent。这些子命令仅在 TUI(CLI 内置)和 Web UI 路径下可用,通过 RPC 直连 AgentServer。
+对于其他子命令(`/skills install`、`/skills uninstall`、`/skills marketplace add/remove/toggle`、`/skills use`),Gateway **不会拦截**——在 IM 侧输入时会被当作普通聊天消息发送给 Agent。这些子命令仅在 TUI(CLI 内置)和 Web UI 路径下可用,通过 RPC 直连 AgentServer。
#### 备注
-- **超时**:`install`、`import`、`uninstall`、`marketplace toggle` 请求在 TUI 侧有 120 秒超时;其余子命令无显式超时设置。
+- **超时**:`install`、`uninstall`、`marketplace toggle` 请求在 TUI 侧有 120 秒超时;其余子命令无显式超时设置。
- **内置技能自动识别**:使用 `/skills install <skill>` 安装时,若技能名称不带 `@`,系统会自动检查是否为内置技能并重定向到内置安装流程;若不是内置技能则返回格式提示。
+- **路径/URL 自动识别**:使用 `/skills install <path>` 安装时,若参数为本地路径(如 `/path/to/skill`、`C:\skill`)或远程 URL(`https://...`),系统自动走本地导入流程。
- **缓存清理**:`marketplace remove` 发送 `{ name, remove_cache: true }` 以同时清理该源的本地缓存。
- **自动刷新**:`marketplace add`、`marketplace remove`、`marketplace toggle` 在操作成功后会自动重新列出市场源。
- **离线处理**:`/skills use` 会检查连接状态;离线时显示 `offline: waiting for reconnect before sending /skills use request`。
@@ -350,8 +350,8 @@
- `/skills install advanced-daily-report` — 安装内置技能(裸名自动识别)
- `/skills install advanced-daily-report@builtin` — 安装内置技能(显式指定)
- `/skills install my-skill@marketplace` — 从市场源安装技能
-- `/skills import /path/to/my-skill` — 从本地目录导入技能
-- `/skills import https://example.com/skill.zip` — 从远程 URL 导入技能
+- `/skills install /path/to/my-skill` — 从本地目录安装技能
+- `/skills install https://example.com/skill.zip` — 从远程 URL 安装技能
- `/skills uninstall my-skill` — 卸载技能
- `/skills marketplace list` — 列出市场源
- `/skills marketplace add community https://github.com/user/skills-repo` — 添加名为"community"的市场源
diff --git a/jiuwenclaw/channels/tui/frontend/src/core/commands/builtins/skills.ts b/jiuwenclaw/channels/tui/frontend/src/core/commands/builtins/skills.ts
index d872950099..d0edd6e4a8 100644
--- a/jiuwenclaw/channels/tui/frontend/src/core/commands/builtins/skills.ts
+++ b/jiuwenclaw/channels/tui/frontend/src/core/commands/builtins/skills.ts
@@ -84,9 +84,9 @@ async function listSkills(ctx: import("../types.js").CommandContext): Promise<vo
export function createSkillsCommand(): SlashCommand {
return {
name: "skills",
- description: "Manage skills (list, install, import, uninstall, marketplace, use)",
- usage: "/skills [list|install|import|uninstall|marketplace|use]",
- example: "/skills list",
+ description: "Manage skills (list, install, uninstall, marketplace, use)",
+ usage: "/skills [list|install|uninstall|marketplace|use]",
+ example: "/skills install my-skill | /skills install /path/to/skill",
kind: CommandKind.BUILT_IN,
action: async (ctx) => {
await listSkills(ctx);
@@ -105,17 +105,40 @@ export function createSkillsCommand(): SlashCommand {
},
{
name: "install",
- description: "Install a skill (builtin name or plugin@marketplace)",
- usage: "/skills install <skill> or <skill@marketplace>",
- example: "/skills install my-skill",
+ description: "Install a skill (builtin name, plugin@marketplace, or local path/URL)",
+ usage: "/skills install <skill> | <skill@marketplace> | <path_or_url>",
+ example: "/skills install my-skill | /skills install /path/to/skill",
kind: CommandKind.BUILT_IN,
takesArgs: true,
action: async (ctx, args) => {
const spec = args.trim();
if (!spec) {
- ctx.addItem(makeItem(ctx.sessionId, "error", "Usage: /skills install <skill> or <skill@marketplace>"));
+ ctx.addItem(makeItem(ctx.sessionId, "error", "Usage: /skills install <skill> | <skill@marketplace> | <path_or_url>"));
return;
}
+
+ // Detect local path / URL — delegate to import_local
+ const isLocalPath = /^([A-Za-z]:[\\/]|\/|\.\/|\.\.\/)/.test(spec);
+ const isUrl = /^https?:\/\/.+/i.test(spec);
+ if (isLocalPath || isUrl) {
+ ctx.addItem(makeItem(ctx.sessionId, "info", `Importing skill from: ${spec}`));
+ const payload = await ctx.request<{ success?: boolean; detail?: string; skill?: { name?: string } }>(
+ "skills.import_local",
+ { path: spec, force: false },
+ 120_000,
+ );
+ if (payload.success) {
+ const skillName = payload.skill?.name || spec;
+ ctx.addItem(makeItem(ctx.sessionId, "info", `Skill imported: ${skillName}`));
+ } else {
+ ctx.addItem(
+ makeItem(ctx.sessionId, "error", payload.detail || `Import failed: ${spec}`),
+ );
+ }
+ return;
+ }
+
+ // Marketplace / builtin install flow
let finalSpec = spec;
// Bare skill name without @ — auto-detect if it's a builtin
if (!spec.includes("@")) {
@@ -178,35 +201,6 @@ export function createSkillsCommand(): SlashCommand {
}
},
},
- {
- name: "import",
- description: "Import a skill from local path or remote URL",
- usage: "/skills import <path>",
- example: "/skills import /path/to/my-skill",
- kind: CommandKind.BUILT_IN,
- takesArgs: true,
- action: async (ctx, args) => {
- const path = args.trim();
- if (!path) {
- ctx.addItem(makeItem(ctx.sessionId, "error", "Usage: /skills import <path_or_url>"));
- return;
- }
- ctx.addItem(makeItem(ctx.sessionId, "info", `Importing skill from: ${path}`));
- const payload = await ctx.request<{ success?: boolean; detail?: string; skill?: { name?: string } }>(
- "skills.import_local",
- { path, force: false },
- 120_000,
- );
- if (payload.success) {
- const skillName = payload.skill?.name || path;
- ctx.addItem(makeItem(ctx.sessionId, "info", `Skill imported: ${skillName}`));
- } else {
- ctx.addItem(
- makeItem(ctx.sessionId, "error", payload.detail || `Import failed: ${path}`),
- );
- }
- },
- },
{
name: "marketplace",
description: "Manage marketplace sources",