apple-agent-kit 0.1.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/bin/install.js +49 -0
- package/package.json +15 -0
package/bin/install.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const { spawnSync } = require('child_process');
|
|
5
|
+
|
|
6
|
+
const REPO = 'caglarbaranbora/Apple-Agent-Kit';
|
|
7
|
+
const MARKETPLACE_NAME = 'apple-agent-kit-marketplace';
|
|
8
|
+
const PLUGIN_NAME = 'apple-agent-kit';
|
|
9
|
+
|
|
10
|
+
const dryRun = process.argv.includes('--dry-run');
|
|
11
|
+
|
|
12
|
+
const commands = [
|
|
13
|
+
['claude', ['plugin', 'marketplace', 'add', REPO]],
|
|
14
|
+
['claude', ['plugin', 'install', `${PLUGIN_NAME}@${MARKETPLACE_NAME}`]],
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
function checkClaudeInstalled() {
|
|
18
|
+
const result = spawnSync('claude', ['--version'], { stdio: 'ignore' });
|
|
19
|
+
if (result.error || result.status !== 0) {
|
|
20
|
+
console.error(
|
|
21
|
+
'Error: the `claude` CLI was not found on PATH. Install Claude Code first: https://code.claude.com/docs/en/quickstart'
|
|
22
|
+
);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function run() {
|
|
28
|
+
checkClaudeInstalled();
|
|
29
|
+
|
|
30
|
+
for (const [cmd, args] of commands) {
|
|
31
|
+
const printable = [cmd, ...args].join(' ');
|
|
32
|
+
if (dryRun) {
|
|
33
|
+
console.log(`[dry-run] ${printable}`);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
console.log(`Running: ${printable}`);
|
|
37
|
+
const result = spawnSync(cmd, args, { stdio: 'inherit' });
|
|
38
|
+
if (result.status !== 0) {
|
|
39
|
+
console.error(`Failed: ${printable}`);
|
|
40
|
+
process.exit(result.status || 1);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (!dryRun) {
|
|
45
|
+
console.log('Apple Agent Kit plugin installed.');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
run();
|
package/package.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "apple-agent-kit",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Installs the Apple Agent Kit Claude Code plugin via the claude CLI.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"apple-agent-kit": "bin/install.js"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/caglarbaranbora/Apple-Agent-Kit.git"
|
|
11
|
+
},
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=18"
|
|
14
|
+
}
|
|
15
|
+
}
|