opencode-mad 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/install.js CHANGED
@@ -1,67 +1,86 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * opencode-mad installer
5
- *
6
- * Usage:
7
- * npx opencode-mad install # Install to current project (.opencode/)
8
- * npx opencode-mad install -g # Install globally (~/.config/opencode/)
9
- */
10
-
11
- import { cpSync, existsSync, mkdirSync } from 'fs';
12
- import { join, dirname } from 'path';
13
- import { fileURLToPath } from 'url';
14
- import { homedir } from 'os';
15
-
16
- const __dirname = dirname(fileURLToPath(import.meta.url));
17
-
18
- const args = process.argv.slice(2);
19
- const command = args[0];
20
- const isGlobal = args.includes('-g') || args.includes('--global');
21
-
22
- if (command !== 'install') {
23
- console.log(`
24
- opencode-mad - Multi-Agent Dev plugin for OpenCode
25
-
26
- Usage:
27
- npx opencode-mad install Install to current project (.opencode/)
28
- npx opencode-mad install -g Install globally (~/.config/opencode/)
29
-
30
- More info: https://github.com/Nistro-dev/opencode-mad
31
- `);
32
- process.exit(0);
33
- }
34
-
35
- const targetDir = isGlobal
36
- ? join(homedir(), '.config', 'opencode')
37
- : join(process.cwd(), '.opencode');
38
-
39
- const folders = ['agents', 'commands', 'plugins', 'skills'];
40
-
41
- console.log(`\nšŸš€ Installing opencode-mad to ${targetDir}\n`);
42
-
43
- for (const folder of folders) {
44
- const src = join(__dirname, folder);
45
- const dest = join(targetDir, folder);
46
-
47
- if (!existsSync(src)) {
48
- console.log(`āš ļø Skipping ${folder} (not found)`);
49
- continue;
50
- }
51
-
52
- mkdirSync(dest, { recursive: true });
53
- cpSync(src, dest, { recursive: true });
54
- console.log(`āœ… Copied ${folder}/`);
55
- }
56
-
57
- console.log(`
58
- šŸŽ‰ Installation complete!
59
-
60
- ${isGlobal ? 'MAD is now available in all your projects.' : 'MAD is now available in this project.'}
61
-
62
- Just start talking to the orchestrator:
63
- "Create a full-stack app with Express and React"
64
-
65
- Or use the /mad command:
66
- /mad Create a Task Timer app
67
- `);
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * opencode-mad installer
5
+ *
6
+ * Usage:
7
+ * npx opencode-mad install # Install to current project (.opencode/)
8
+ * npx opencode-mad install -g # Install globally (~/.config/opencode/)
9
+ * npx opencode-mad update # Update in current project (alias for install)
10
+ * npx opencode-mad update -g # Update globally (alias for install -g)
11
+ * npx opencode-mad version # Show version
12
+ */
13
+
14
+ import { cpSync, existsSync, mkdirSync, readFileSync } from 'fs';
15
+ import { join, dirname } from 'path';
16
+ import { fileURLToPath } from 'url';
17
+ import { homedir } from 'os';
18
+
19
+ const __dirname = dirname(fileURLToPath(import.meta.url));
20
+
21
+ const args = process.argv.slice(2);
22
+ const command = args[0];
23
+ const isGlobal = args.includes('-g') || args.includes('--global');
24
+
25
+ // Handle version command
26
+ if (command === 'version' || command === '-v' || command === '--version') {
27
+ const pkg = JSON.parse(readFileSync(join(__dirname, 'package.json'), 'utf-8'));
28
+ console.log(`opencode-mad v${pkg.version}`);
29
+ process.exit(0);
30
+ }
31
+
32
+ // 'update' is an alias for 'install'
33
+ if (command !== 'install' && command !== 'update') {
34
+ console.log(`
35
+ opencode-mad - Multi-Agent Dev plugin for OpenCode
36
+
37
+ Usage:
38
+ npx opencode-mad install Install to current project (.opencode/)
39
+ npx opencode-mad install -g Install globally (~/.config/opencode/)
40
+ npx opencode-mad update Update in current project (alias for install)
41
+ npx opencode-mad update -g Update globally (alias for install -g)
42
+ npx opencode-mad version Show version
43
+
44
+ More info: https://github.com/Nistro-dev/opencode-mad
45
+ `);
46
+ process.exit(0);
47
+ }
48
+
49
+ const targetDir = isGlobal
50
+ ? join(homedir(), '.config', 'opencode')
51
+ : join(process.cwd(), '.opencode');
52
+
53
+ const folders = ['agents', 'commands', 'plugins', 'skills'];
54
+
55
+ // Check if it's an update (any of the folders already exist)
56
+ const isUpdate = folders.some(folder => existsSync(join(targetDir, folder)));
57
+
58
+ console.log(isUpdate
59
+ ? `\nšŸ”„ Updating opencode-mad in ${targetDir}\n`
60
+ : `\nšŸš€ Installing opencode-mad to ${targetDir}\n`);
61
+
62
+ for (const folder of folders) {
63
+ const src = join(__dirname, folder);
64
+ const dest = join(targetDir, folder);
65
+
66
+ if (!existsSync(src)) {
67
+ console.log(`āš ļø Skipping ${folder} (not found)`);
68
+ continue;
69
+ }
70
+
71
+ mkdirSync(dest, { recursive: true });
72
+ cpSync(src, dest, { recursive: true });
73
+ console.log(`āœ… Copied ${folder}/`);
74
+ }
75
+
76
+ console.log(`
77
+ šŸŽ‰ ${isUpdate ? 'Update' : 'Installation'} complete!
78
+
79
+ ${isGlobal ? 'MAD is now available in all your projects.' : 'MAD is now available in this project.'}
80
+
81
+ Just start talking to the orchestrator:
82
+ "Create a full-stack app with Express and React"
83
+
84
+ Or use the /mad command:
85
+ /mad Create a Task Timer app
86
+ `);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-mad",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Multi-Agent Dev - Parallel development orchestration plugin for OpenCode",
5
5
  "type": "module",
6
6
  "main": "plugins/mad-plugin.ts",