Skip to content

Commit 786bd97

Browse files
committed
Release dumplingai-cli v0.2.3
1 parent 3e827cd commit 786bd97

4 files changed

Lines changed: 73 additions & 3 deletions

File tree

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dumplingai-cli",
3-
"version": "0.2.2",
3+
"version": "0.2.3",
44
"description": "DumplingAI CLI — discover and execute Unified API Platform capabilities from the terminal",
55
"license": "MIT",
66
"type": "module",

packages/cli/src/commands/setup-skill.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ function detectEnvironments(cwd: string): AgentEnvironment[] {
1616
const claudeDir = path.join(cwd, '.claude');
1717
const cursorDir = path.join(cwd, '.cursor');
1818
const codexDir = path.join(cwd, '.codex');
19+
const agentsDir = path.join(cwd, '.agents');
1920

2021
return [
2122
{
@@ -33,6 +34,11 @@ function detectEnvironments(cwd: string): AgentEnvironment[] {
3334
skillDir: path.join(codexDir, 'skills', 'dumplingai-cli'),
3435
detected: fs.existsSync(codexDir),
3536
},
37+
{
38+
name: 'Agents',
39+
skillDir: path.join(agentsDir, 'skills', 'dumplingai-cli'),
40+
detected: fs.existsSync(agentsDir),
41+
},
3642
];
3743
}
3844

@@ -74,7 +80,7 @@ export function makeSetupSkillCommand(): Command {
7480
const targets = opts.all ? envs : envs.filter((env) => env.detected);
7581

7682
if (targets.length === 0) {
77-
printStatus('No agent environments detected (.claude, .cursor, .codex).');
83+
printStatus('No agent environments detected (.claude, .cursor, .codex, .agents).');
7884
printStatus('Use --all to install anyway, or --dir <path> for a custom location.');
7985
return;
8086
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
2+
import fs from 'node:fs';
3+
import os from 'node:os';
4+
import path from 'node:path';
5+
6+
vi.mock('../../src/generated/skills.js', () => ({
7+
SKILLS: [
8+
{
9+
slug: 'dumplingai-cli',
10+
files: {
11+
'SKILL.md': '# Test skill',
12+
},
13+
},
14+
],
15+
}));
16+
17+
describe('setup skill', () => {
18+
let tmpDir: string;
19+
let makeSetupSkillCommand: typeof import('../../src/commands/setup-skill.js').makeSetupSkillCommand;
20+
21+
beforeEach(async () => {
22+
vi.resetModules();
23+
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'dumplingai-setup-skill-'));
24+
vi.spyOn(process.stderr, 'write').mockImplementation(() => true);
25+
({ makeSetupSkillCommand } = await import('../../src/commands/setup-skill.js'));
26+
});
27+
28+
afterEach(() => {
29+
fs.rmSync(tmpDir, { recursive: true, force: true });
30+
vi.restoreAllMocks();
31+
});
32+
33+
it('installs bundled skills into the .agents skills directory when detected', async () => {
34+
fs.mkdirSync(path.join(tmpDir, '.agents'), { recursive: true });
35+
36+
const previousCwd = process.cwd();
37+
process.chdir(tmpDir);
38+
39+
try {
40+
await makeSetupSkillCommand().parseAsync(['skill'], { from: 'user' });
41+
} finally {
42+
process.chdir(previousCwd);
43+
}
44+
45+
const installedSkill = path.join(tmpDir, '.agents', 'skills', 'dumplingai-cli', 'SKILL.md');
46+
expect(fs.existsSync(installedSkill)).toBe(true);
47+
});
48+
49+
it('includes .agents in the no-environment hint', async () => {
50+
const stderrWrite = vi.spyOn(process.stderr, 'write');
51+
const previousCwd = process.cwd();
52+
process.chdir(tmpDir);
53+
54+
try {
55+
await makeSetupSkillCommand().parseAsync(['skill'], { from: 'user' });
56+
} finally {
57+
process.chdir(previousCwd);
58+
}
59+
60+
expect(stderrWrite).toHaveBeenCalledWith(
61+
expect.stringContaining('No agent environments detected (.claude, .cursor, .codex, .agents).'),
62+
);
63+
});
64+
});

0 commit comments

Comments
 (0)