ancoder-skill-cli 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -11
- package/bin/skill-cli.js +27 -3
- package/bin/targets/skill-cli-darwin-arm64 +0 -0
- package/bin/targets/skill-cli-darwin-x64 +0 -0
- package/bin/targets/skill-cli-linux-arm64 +0 -0
- package/bin/targets/skill-cli-linux-x64 +0 -0
- package/bin/targets/skill-cli-win32-x64.exe +0 -0
- package/package.json +3 -2
- package/scripts/check-bin.js +17 -5
- package/scripts/postinstall.js +10 -69
package/README.md
CHANGED
|
@@ -2,17 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
CLI for managing and testing [Anthropic Agent Skills](https://agentskills.io) (e.g. [anthropics/skills](https://github.com/anthropics/skills)).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Install (npm)
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
# Global
|
|
9
|
-
npm install -g skill-cli
|
|
9
|
+
npm install -g ancoder-skill-cli
|
|
10
10
|
|
|
11
11
|
# Or run without installing
|
|
12
|
-
npx skill-cli --help
|
|
13
|
-
```
|
|
12
|
+
npx ancoder-skill-cli --help
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The npm package is self-contained and includes prebuilt binaries for:
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
- macOS arm64
|
|
18
|
+
- macOS x64
|
|
19
|
+
- Linux arm64
|
|
20
|
+
- Linux x64
|
|
21
|
+
- Windows x64
|
|
22
|
+
|
|
23
|
+
After install, the wrapper selects the correct bundled binary for the current platform automatically.
|
|
16
24
|
|
|
17
25
|
## Build from source (Go)
|
|
18
26
|
|
|
@@ -34,19 +42,25 @@ go build -o bin/skill-cli .
|
|
|
34
42
|
|
|
35
43
|
## Publish to npm
|
|
36
44
|
|
|
37
|
-
1. Set `repository.url` in `package.json` to your GitHub repo (e.g. `https://github.com/your-org/skill-cli.git`).
|
|
38
|
-
2.
|
|
45
|
+
1. Set `repository.url` in `package.json` to your GitHub repo (e.g. `git+https://github.com/your-org/skill-cli.git`).
|
|
46
|
+
2. Build binaries per platform before publishing the npm package:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
bash scripts/build-all.sh
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
3. Optionally attach the same binaries to a GitHub Release with names:
|
|
39
53
|
- `skill-cli-darwin-arm64`, `skill-cli-darwin-x64`
|
|
40
54
|
- `skill-cli-linux-x64`, `skill-cli-linux-arm64`
|
|
41
55
|
- `skill-cli-win32-x64.exe`
|
|
42
|
-
|
|
56
|
+
4. Publish the package:
|
|
43
57
|
|
|
44
58
|
```bash
|
|
45
|
-
npm login
|
|
46
|
-
npm publish
|
|
59
|
+
npm login --registry=https://registry.npmjs.org/
|
|
60
|
+
npm publish --access public --registry=https://registry.npmjs.org/ --userconfig ~/.npmrc
|
|
47
61
|
```
|
|
48
62
|
|
|
49
|
-
Users who `npm install -g skill-cli`
|
|
63
|
+
Users who `npm install -g ancoder-skill-cli` get a fully bundled package. No extra binary download is required during install.
|
|
50
64
|
|
|
51
65
|
## License
|
|
52
66
|
|
package/bin/skill-cli.js
CHANGED
|
@@ -6,14 +6,38 @@ const { spawn } = require('child_process');
|
|
|
6
6
|
const fs = require('fs');
|
|
7
7
|
|
|
8
8
|
const isWindows = process.platform === 'win32';
|
|
9
|
-
const
|
|
10
|
-
const
|
|
9
|
+
const key = `${process.platform}-${process.arch}`;
|
|
10
|
+
const targetMap = {
|
|
11
|
+
'darwin-arm64': 'skill-cli-darwin-arm64',
|
|
12
|
+
'darwin-x64': 'skill-cli-darwin-x64',
|
|
13
|
+
'linux-arm64': 'skill-cli-linux-arm64',
|
|
14
|
+
'linux-x64': 'skill-cli-linux-x64',
|
|
15
|
+
'win32-x64': 'skill-cli-win32-x64.exe',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const bundledName = targetMap[key];
|
|
19
|
+
const bundledPath = bundledName ? path.join(__dirname, 'targets', bundledName) : null;
|
|
20
|
+
const fallbackName = isWindows ? 'skill-cli.exe' : 'skill-cli';
|
|
21
|
+
const fallbackPath = path.join(__dirname, fallbackName);
|
|
22
|
+
|
|
23
|
+
const binPath = bundledPath && fs.existsSync(bundledPath) ? bundledPath : fallbackPath;
|
|
11
24
|
|
|
12
25
|
if (!fs.existsSync(binPath)) {
|
|
13
|
-
console.error(
|
|
26
|
+
console.error(
|
|
27
|
+
'skill-cli: binary not found for ' + key + '. ' +
|
|
28
|
+
'Expected bundled binary: ' + (bundledName || 'unsupported-platform') + '.'
|
|
29
|
+
);
|
|
14
30
|
process.exit(1);
|
|
15
31
|
}
|
|
16
32
|
|
|
33
|
+
if (!isWindows) {
|
|
34
|
+
try {
|
|
35
|
+
fs.chmodSync(binPath, 0o755);
|
|
36
|
+
} catch (_) {
|
|
37
|
+
// ignore chmod failures on readonly installs
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
17
41
|
const child = spawn(binPath, process.argv.slice(2), {
|
|
18
42
|
stdio: 'inherit',
|
|
19
43
|
shell: false,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ancoder-skill-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "CLI for managing everything-claude-code (ECC) components — agents, skills, commands, rules, hooks, MCP configs. Single binary, all assets embedded.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"skill-cli": "bin/skill-cli.js"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
|
-
"url": "https://github.com/AncoderAI/Ancoder_SkillsCreator.git"
|
|
15
|
+
"url": "git+https://github.com/AncoderAI/Ancoder_SkillsCreator.git"
|
|
16
16
|
},
|
|
17
17
|
"homepage": "https://github.com/AncoderAI/Ancoder_SkillsCreator#readme",
|
|
18
18
|
"bugs": {
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
39
39
|
"bin/skill-cli.js",
|
|
40
|
+
"bin/targets",
|
|
40
41
|
"scripts/postinstall.js",
|
|
41
42
|
"scripts/check-bin.js",
|
|
42
43
|
"README.md",
|
package/scripts/check-bin.js
CHANGED
|
@@ -5,10 +5,22 @@ const path = require('path');
|
|
|
5
5
|
const fs = require('fs');
|
|
6
6
|
|
|
7
7
|
const binDir = path.join(__dirname, '..', 'bin');
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const targetsDir = path.join(binDir, 'targets');
|
|
9
|
+
const expected = [
|
|
10
|
+
'skill-cli-darwin-arm64',
|
|
11
|
+
'skill-cli-darwin-x64',
|
|
12
|
+
'skill-cli-linux-arm64',
|
|
13
|
+
'skill-cli-linux-x64',
|
|
14
|
+
'skill-cli-win32-x64.exe',
|
|
15
|
+
];
|
|
10
16
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
17
|
+
const missing = expected.filter((name) => !fs.existsSync(path.join(targetsDir, name)));
|
|
18
|
+
|
|
19
|
+
if (missing.length > 0) {
|
|
20
|
+
console.error('skill-cli: missing bundled binaries for npm publish:');
|
|
21
|
+
for (const name of missing) {
|
|
22
|
+
console.error(' - ' + name);
|
|
23
|
+
}
|
|
24
|
+
console.error('Run: bash scripts/build-all.sh');
|
|
25
|
+
process.exit(1);
|
|
14
26
|
}
|
package/scripts/postinstall.js
CHANGED
|
@@ -3,12 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
const fs = require('fs');
|
|
5
5
|
const path = require('path');
|
|
6
|
-
const https = require('https');
|
|
7
|
-
const http = require('http');
|
|
8
|
-
|
|
9
|
-
const pkg = require(path.join(__dirname, '..', 'package.json'));
|
|
10
|
-
const version = pkg.version;
|
|
11
|
-
const repo = 'AncoderAI/Ancoder_SkillsCreator';
|
|
12
6
|
|
|
13
7
|
const platform = process.platform;
|
|
14
8
|
const arch = process.arch;
|
|
@@ -23,73 +17,20 @@ const assetNames = {
|
|
|
23
17
|
};
|
|
24
18
|
|
|
25
19
|
const key = `${platform}-${arch}`;
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const binName = isWindows ? 'skill-cli.exe' : 'skill-cli';
|
|
29
|
-
const binPath = path.join(binDir, binName);
|
|
20
|
+
const bundledName = assetNames[key];
|
|
21
|
+
const bundledPath = bundledName ? path.join(__dirname, '..', 'bin', 'targets', bundledName) : null;
|
|
30
22
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
try {
|
|
34
|
-
fs.accessSync(binPath, fs.constants.X_OK);
|
|
35
|
-
process.exit(0);
|
|
36
|
-
} catch (_) {
|
|
37
|
-
fs.chmodSync(binPath, 0o755);
|
|
38
|
-
process.exit(0);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (!assetName) {
|
|
43
|
-
console.warn(`skill-cli: no prebuilt binary for ${key}`);
|
|
44
|
-
console.warn(`Build from source: go build -o bin/${binName} .`);
|
|
23
|
+
if (!bundledName || !bundledPath || !fs.existsSync(bundledPath)) {
|
|
24
|
+
console.warn(`skill-cli: bundled binary missing for ${key}`);
|
|
45
25
|
process.exit(0);
|
|
46
26
|
}
|
|
47
27
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
process.exit(1);
|
|
28
|
+
if (!isWindows) {
|
|
29
|
+
try {
|
|
30
|
+
fs.chmodSync(bundledPath, 0o755);
|
|
31
|
+
} catch (_) {
|
|
32
|
+
// ignore chmod failures
|
|
54
33
|
}
|
|
55
|
-
|
|
56
|
-
const proto = url.startsWith('https') ? https : http;
|
|
57
|
-
|
|
58
|
-
proto.get(url, {
|
|
59
|
-
headers: { 'User-Agent': 'skill-cli-npm-postinstall' }
|
|
60
|
-
}, (res) => {
|
|
61
|
-
// Follow redirects (GitHub releases always redirect)
|
|
62
|
-
if (res.statusCode === 301 || res.statusCode === 302 || res.statusCode === 307) {
|
|
63
|
-
const location = res.headers.location;
|
|
64
|
-
if (location) {
|
|
65
|
-
res.resume(); // consume response to free socket
|
|
66
|
-
fetch(location, dest, redirects + 1);
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (res.statusCode !== 200) {
|
|
72
|
-
console.warn(`skill-cli: HTTP ${res.statusCode} downloading ${url}`);
|
|
73
|
-
console.warn(`Build from source: go build -o bin/${binName} .`);
|
|
74
|
-
process.exit(0);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const file = fs.createWriteStream(dest, { mode: 0o755 });
|
|
78
|
-
res.pipe(file);
|
|
79
|
-
file.on('finish', () => {
|
|
80
|
-
file.close();
|
|
81
|
-
console.log(`skill-cli: installed binary for ${key} (v${version})`);
|
|
82
|
-
});
|
|
83
|
-
file.on('error', (err) => {
|
|
84
|
-
fs.unlink(dest, () => {});
|
|
85
|
-
console.warn('skill-cli: write error:', err.message);
|
|
86
|
-
});
|
|
87
|
-
}).on('error', (err) => {
|
|
88
|
-
console.warn('skill-cli: download error:', err.message);
|
|
89
|
-
console.warn(`Build from source: go build -o bin/${binName} .`);
|
|
90
|
-
});
|
|
91
34
|
}
|
|
92
35
|
|
|
93
|
-
|
|
94
|
-
console.log(`skill-cli: downloading binary for ${key}...`);
|
|
95
|
-
fetch(url, binPath, 0);
|
|
36
|
+
console.log(`skill-cli: bundled binary ready for ${key}`);
|