惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
大猫的无限游戏
大猫的无限游戏
J
Java Code Geeks
罗磊的独立博客
雷峰网
雷峰网
G
Google Developers Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
爱范儿
爱范儿
B
Blog RSS Feed
腾讯CDC
Apple Machine Learning Research
Apple Machine Learning Research
D
Docker
Recent Announcements
Recent Announcements
T
Tailwind CSS Blog
博客园 - 聂微东
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Vercel News
Vercel News
小众软件
小众软件
人人都是产品经理
人人都是产品经理
云风的 BLOG
云风的 BLOG
IT之家
IT之家
Blog — PlanetScale
Blog — PlanetScale
I
InfoQ
S
SegmentFault 最新的问题

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
feat(cli): support installing skills to shared global dir...
clawsweeper · 2026-05-19 · via Recent Commits to openclaw:main

@@ -152,6 +152,11 @@ vi.mock("../runtime.js", () => ({

152152

defaultRuntime: mocks.defaultRuntime,

153153

}));

154154155+

vi.mock("../utils.js", async (importOriginal) => ({

156+

...(await importOriginal<typeof import("../utils.js")>()),

157+

CONFIG_DIR: "/tmp/openclaw-config",

158+

}));

159+155160

vi.mock("../config/config.js", () => ({

156161

getRuntimeConfig: () => mocks.loadConfigMock(),

157162

loadConfig: () => mocks.loadConfigMock(),

@@ -353,6 +358,44 @@ describe("skills cli commands", () => {

353358

);

354359

});

355360361+

it("installs a skill into the shared global skills directory", async () => {

362+

installSkillFromClawHubMock.mockResolvedValue({

363+

ok: true,

364+

slug: "calendar",

365+

version: "1.2.3",

366+

targetDir: "/tmp/openclaw-config/skills/calendar",

367+

});

368+369+

await runCommand(["skills", "install", "calendar", "--global"]);

370+371+

expect(resolveAgentIdByWorkspacePathMock).not.toHaveBeenCalled();

372+

expect(resolveDefaultAgentIdMock).not.toHaveBeenCalled();

373+

expect(resolveAgentWorkspaceDirMock).not.toHaveBeenCalled();

374+

expect(installSkillFromClawHubMock).toHaveBeenCalledWith(

375+

expect.objectContaining({

376+

workspaceDir: "/tmp/openclaw-config",

377+

}),

378+

);

379+

});

380+381+

it("rejects using --global and --agent together for installs", async () => {

382+

await expect(

383+

runCommand(["skills", "install", "calendar", "--global", "--agent", "main"]),

384+

).rejects.toThrow("__exit__:1");

385+386+

expect(runtimeErrors).toContain("Use either --global or --agent, not both.");

387+

expect(installSkillFromClawHubMock).not.toHaveBeenCalled();

388+

});

389+390+

it("rejects using parent --agent with install --global", async () => {

391+

await expect(

392+

runCommand(["skills", "--agent", "writer", "install", "calendar", "--global"]),

393+

).rejects.toThrow("__exit__:1");

394+395+

expect(runtimeErrors).toContain("Use either --global or --agent, not both.");

396+

expect(installSkillFromClawHubMock).not.toHaveBeenCalled();

397+

});

398+356399

it("updates all tracked ClawHub skills", async () => {

357400

readTrackedClawHubSkillSlugsMock.mockResolvedValue(["calendar"]);

358401

updateSkillsFromClawHubMock.mockResolvedValue([

@@ -438,6 +481,78 @@ describe("skills cli commands", () => {

438481

expectLogger(updateOverrideArgs.logger);

439482

});

440483484+

it("updates tracked ClawHub skills in the shared global skills directory", async () => {

485+

readTrackedClawHubSkillSlugsMock.mockResolvedValue(["calendar"]);

486+

updateSkillsFromClawHubMock.mockResolvedValue([

487+

{

488+

ok: true,

489+

slug: "calendar",

490+

previousVersion: "1.2.2",

491+

version: "1.2.3",

492+

changed: true,

493+

targetDir: "/tmp/openclaw-config/skills/calendar",

494+

},

495+

]);

496+497+

await runCommand(["skills", "update", "--all", "--global"]);

498+499+

expect(resolveAgentIdByWorkspacePathMock).not.toHaveBeenCalled();

500+

expect(resolveDefaultAgentIdMock).not.toHaveBeenCalled();

501+

expect(resolveAgentWorkspaceDirMock).not.toHaveBeenCalled();

502+

expect(readTrackedClawHubSkillSlugsMock).toHaveBeenCalledWith("/tmp/openclaw-config");

503+

expect(updateSkillsFromClawHubMock).toHaveBeenCalledWith({

504+

workspaceDir: "/tmp/openclaw-config",

505+

slug: undefined,

506+

logger: expect.any(Object),

507+

});

508+

});

509+510+

it("updates a single tracked ClawHub skill in the shared global skills directory", async () => {

511+

readTrackedClawHubSkillSlugsMock.mockResolvedValue(["calendar"]);

512+

updateSkillsFromClawHubMock.mockResolvedValue([

513+

{

514+

ok: true,

515+

slug: "calendar",

516+

previousVersion: "1.2.2",

517+

version: "1.2.3",

518+

changed: true,

519+

targetDir: "/tmp/openclaw-config/skills/calendar",

520+

},

521+

]);

522+523+

await runCommand(["skills", "update", "calendar", "--global"]);

524+525+

expect(resolveAgentIdByWorkspacePathMock).not.toHaveBeenCalled();

526+

expect(resolveDefaultAgentIdMock).not.toHaveBeenCalled();

527+

expect(resolveAgentWorkspaceDirMock).not.toHaveBeenCalled();

528+

expect(readTrackedClawHubSkillSlugsMock).toHaveBeenCalledWith("/tmp/openclaw-config");

529+

expect(updateSkillsFromClawHubMock).toHaveBeenCalledWith({

530+

workspaceDir: "/tmp/openclaw-config",

531+

slug: "calendar",

532+

logger: expect.any(Object),

533+

});

534+

});

535+536+

it("rejects using --global and --agent together for updates", async () => {

537+

await expect(

538+

runCommand(["skills", "update", "--all", "--global", "--agent", "main"]),

539+

).rejects.toThrow("__exit__:1");

540+541+

expect(runtimeErrors).toContain("Use either --global or --agent, not both.");

542+

expect(readTrackedClawHubSkillSlugsMock).not.toHaveBeenCalled();

543+

expect(updateSkillsFromClawHubMock).not.toHaveBeenCalled();

544+

});

545+546+

it("rejects using parent --agent with update --global", async () => {

547+

await expect(

548+

runCommand(["skills", "--agent", "writer", "update", "--all", "--global"]),

549+

).rejects.toThrow("__exit__:1");

550+551+

expect(runtimeErrors).toContain("Use either --global or --agent, not both.");

552+

expect(readTrackedClawHubSkillSlugsMock).not.toHaveBeenCalled();

553+

expect(updateSkillsFromClawHubMock).not.toHaveBeenCalled();

554+

});

555+441556

it.each([

442557

{

443558

label: "list",