magicpath-ai 1.3.0-beta.8 → 1.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.
Files changed (54) hide show
  1. package/README.md +24 -26
  2. package/dist/cli.js +15 -8
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/add.d.ts +0 -3
  5. package/dist/commands/add.js +347 -246
  6. package/dist/commands/add.js.map +1 -1
  7. package/dist/commands/auth.js +14 -2
  8. package/dist/commands/auth.js.map +1 -1
  9. package/dist/commands/info.js +9 -5
  10. package/dist/commands/info.js.map +1 -1
  11. package/dist/commands/inspect.d.ts +53 -0
  12. package/dist/commands/inspect.js +122 -0
  13. package/dist/commands/inspect.js.map +1 -0
  14. package/dist/commands/list-installed.d.ts +2 -0
  15. package/dist/commands/list-installed.js +112 -0
  16. package/dist/commands/list-installed.js.map +1 -0
  17. package/dist/commands/list.js +6 -2
  18. package/dist/commands/list.js.map +1 -1
  19. package/dist/commands/schema.js +11 -24
  20. package/dist/commands/schema.js.map +1 -1
  21. package/dist/commands/search.js +2 -1
  22. package/dist/commands/search.js.map +1 -1
  23. package/dist/commands/setup-skills.d.ts +2 -0
  24. package/dist/commands/setup-skills.js +13 -0
  25. package/dist/commands/setup-skills.js.map +1 -0
  26. package/dist/commands/whoami.js +5 -13
  27. package/dist/commands/whoami.js.map +1 -1
  28. package/dist/util/auth.d.ts +19 -6
  29. package/dist/util/auth.js +70 -10
  30. package/dist/util/auth.js.map +1 -1
  31. package/dist/util/banner.d.ts +1 -0
  32. package/dist/util/banner.js +79 -0
  33. package/dist/util/banner.js.map +1 -0
  34. package/package.json +3 -5
  35. package/dist/commands/init.d.ts +0 -2
  36. package/dist/commands/init.js +0 -113
  37. package/dist/commands/init.js.map +0 -1
  38. package/dist/commands/integrate.d.ts +0 -2
  39. package/dist/commands/integrate.js +0 -202
  40. package/dist/commands/integrate.js.map +0 -1
  41. package/dist/commands/retheme.d.ts +0 -2
  42. package/dist/commands/retheme.js +0 -327
  43. package/dist/commands/retheme.js.map +0 -1
  44. package/dist/commands/skills.d.ts +0 -2
  45. package/dist/commands/skills.js +0 -55
  46. package/dist/commands/skills.js.map +0 -1
  47. package/dist/util/diff.d.ts +0 -13
  48. package/dist/util/diff.js +0 -63
  49. package/dist/util/diff.js.map +0 -1
  50. package/dist/util/integrate.d.ts +0 -84
  51. package/dist/util/integrate.js +0 -762
  52. package/dist/util/integrate.js.map +0 -1
  53. package/skills/cli-reference.md +0 -146
  54. package/skills/guide.md +0 -63
package/README.md CHANGED
@@ -1,16 +1,16 @@
1
1
  # MagicPath CLI
2
2
 
3
- A component platform for AI agents. Search, add, and integrate UI components from MagicPath directly into your projects — works with Claude Code, Cursor, and GitHub Copilot.
3
+ A component platform for AI agents. Search and add UI components from MagicPath directly into your projects — works with Claude Code, Cursor, and GitHub Copilot.
4
4
 
5
5
  ## Quick Start
6
6
 
7
7
  ```bash
8
8
  npm install -g magicpath-ai@beta
9
9
  magicpath-ai login
10
- magicpath-ai init # run in your project directory
10
+ magicpath-ai setup-skills # run in your project directory
11
11
  ```
12
12
 
13
- After `init`, Claude Code, Cursor, and GitHub Copilot automatically pick up MagicPath skills — just mention MagicPath in conversation and your agent knows what to do.
13
+ After `setup-skills`, Claude Code, Cursor, and GitHub Copilot automatically pick up MagicPath skills — just mention MagicPath in conversation and your agent knows what to do.
14
14
 
15
15
  ## Commands
16
16
 
@@ -95,51 +95,49 @@ magicpath-ai view <generatedName>
95
95
 
96
96
  ### Components
97
97
 
98
- #### `add`
98
+ #### `inspect`
99
+
100
+ View a component's source code, dependencies, and import info without installing anything. Read-only — no files are written, no `package.json` is required.
99
101
 
100
- Add a MagicPath component to your project. Fetches the component files, writes them to your project, and installs any required dependencies.
102
+ Works in any project type. For non-React projects (Swift, Python, etc.), use `inspect` to read MagicPath component source code as a reference for recreating the component in your target language.
101
103
 
102
104
  ```bash
103
- magicpath-ai add <generatedName>
104
- magicpath-ai add wispy-river-5234 --path src/components/ui
105
- magicpath-ai add wispy-river-5234 --inspect # view source without installing
106
- magicpath-ai add wispy-river-5234 --dry-run # preview file list only
105
+ magicpath-ai inspect <generatedName>
106
+ magicpath-ai inspect wispy-river-5234 -o json
107
107
  ```
108
108
 
109
109
  | Option | Description |
110
110
  |--------|-------------|
111
- | `-p, --path <path>` | Custom component path (default: `src/components/magicpath`) |
112
- | `--inspect` | Show full source code without installing |
113
- | `--dry-run` | Preview file list without writing |
114
- | `-y, --yes` | Skip confirmation prompts |
115
- | `--overwrite` | Overwrite existing files |
116
111
  | `-d, --debug` | Enable debug logging |
117
112
 
118
- #### `integrate`
113
+ #### `add`
114
+
115
+ Add a MagicPath component to your project. Fetches the component files, writes them to `src/components/magicpath/`, and installs any required npm dependencies.
119
116
 
120
- Integrate a MagicPath component into your project using AI. Offers two modes: integrate into a specific file, or retheme your entire project to match the component.
117
+ > **Note:** `add` is for React/TypeScript projects only it writes `.tsx` files and installs npm packages. For non-JS projects, use `inspect` to read the source code and translate it into your target language.
121
118
 
122
119
  ```bash
123
- magicpath-ai integrate <generatedName>
124
- magicpath-ai integrate wispy-river-5234 --target src/app/page.tsx
125
- magicpath-ai integrate wispy-river-5234 --dry-run
120
+ magicpath-ai add <generatedName>
121
+ magicpath-ai add wispy-river-5234 --path src/components/ui
122
+ magicpath-ai add wispy-river-5234 --dry-run # preview file list only
126
123
  ```
127
124
 
128
125
  | Option | Description |
129
126
  |--------|-------------|
130
- | `-t, --target <file>` | Target file to integrate into (skips interactive prompt) |
131
- | `--no-review` | Apply changes without review |
132
- | `--dry-run` | Show what would happen without writing |
127
+ | `-p, --path <path>` | Custom component path (default: `src/components/magicpath`) |
128
+ | `--dry-run` | Preview file list without writing |
129
+ | `-y, --yes` | Skip confirmation prompts |
130
+ | `--overwrite` | Overwrite existing files |
133
131
  | `-d, --debug` | Enable debug logging |
134
132
 
135
133
  ### AI Agent Setup
136
134
 
137
- #### `init`
135
+ #### `setup-skills`
138
136
 
139
137
  Set up MagicPath skills for AI agents. Creates rule/skill files for Claude Code, Cursor, and GitHub Copilot in your project.
140
138
 
141
139
  ```bash
142
- magicpath-ai init
140
+ magicpath-ai setup-skills
143
141
  ```
144
142
 
145
143
  #### `info`
@@ -190,13 +188,13 @@ The `-d, --debug` flag is available on `add`, `clone`, and `integrate` for verbo
190
188
 
191
189
  ## AI Agent Integration
192
190
 
193
- Running `magicpath-ai init` in your project creates skill files that teach AI agents how to use MagicPath:
191
+ Running `magicpath-ai setup-skills` in your project creates skill files that teach AI agents how to use MagicPath:
194
192
 
195
193
  - **Claude Code** — `.claude/skills/magicpath/SKILL.md`
196
194
  - **Cursor** — `.cursor/rules/magicpath.mdc`
197
195
  - **GitHub Copilot** — `.github/instructions/magicpath.instructions.md`
198
196
 
199
- Once set up, agents automatically know how to search for components, add them to your project, and integrate them into specific files.
197
+ Once set up, agents automatically know how to search for components and add them to your project.
200
198
 
201
199
  ## Requirements
202
200
 
package/dist/cli.js CHANGED
@@ -1,22 +1,29 @@
1
1
  #!/usr/bin/env node
2
+ import { readFileSync } from 'fs';
2
3
  import { program } from 'commander';
3
4
  import { setJsonMode } from './util/output.js';
5
+ import { showBanner } from './util/banner.js';
4
6
  import { registerCloneCommand } from './commands/clone.js';
5
7
  import { registerAddCommand } from './commands/add.js';
6
- import { registerIntegrateCommand } from './commands/integrate.js';
7
- // import { registerRethemeCommand } from './commands/retheme.js';
8
8
  import { registerAuthCommands } from './commands/auth.js';
9
9
  import { registerWhoamiCommand } from './commands/whoami.js';
10
10
  import { registerListCommands } from './commands/list.js';
11
11
  import { registerSchemaCommand } from './commands/schema.js';
12
- import { registerInitCommand } from './commands/init.js';
12
+ import { registerSetupSkillsCommand } from './commands/setup-skills.js';
13
13
  import { registerViewCommand } from './commands/view.js';
14
14
  import { registerInfoCommand } from './commands/info.js';
15
15
  import { registerSearchCommand } from './commands/search.js';
16
+ import { registerInspectCommand } from './commands/inspect.js';
17
+ import { registerListInstalledCommand } from './commands/list-installed.js';
18
+ const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
19
+ if (process.argv.length <= 2) {
20
+ showBanner(pkg.version);
21
+ process.exit(0);
22
+ }
16
23
  program
17
24
  .name('magicpath')
18
- .description('CLI for MagicPath AI')
19
- .version('1.3.0')
25
+ .description('')
26
+ .version(pkg.version)
20
27
  .option('-o, --output <format>', 'Output format: json')
21
28
  .hook('preAction', (thisCommand) => {
22
29
  const opts = thisCommand.optsWithGlobals();
@@ -26,15 +33,15 @@ program
26
33
  });
27
34
  registerCloneCommand(program);
28
35
  registerAddCommand(program);
29
- registerIntegrateCommand(program);
30
- // registerRethemeCommand(program);
31
36
  registerAuthCommands(program);
32
37
  registerWhoamiCommand(program);
33
38
  registerListCommands(program);
34
39
  registerSchemaCommand(program);
35
- registerInitCommand(program);
40
+ registerSetupSkillsCommand(program);
36
41
  registerViewCommand(program);
37
42
  registerInfoCommand(program);
38
43
  registerSearchCommand(program);
44
+ registerListInstalledCommand(program);
45
+ registerInspectCommand(program);
39
46
  program.parse();
40
47
  //# sourceMappingURL=cli.js.map
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,kEAAkE;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAA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M,CAAC,uBAAuB,EAAE,qBAAqB,CAAC;KACtD,IAAI,CAAC,WAAW,EAAE,CAAC,WAAW,EAAE,EAAE;IACjC,MAAM,IAAI,GAAG,WAAW,CAAC,eAAe,EAAE,CAAC;IAC3C,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;QAC3B,WAAW,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC9B,kBAAkB,CAAC,OAAO,CAAC,CAAC;AAC5B,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC9B,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAC/B,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC9B,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAC/B,0BAA0B,CAAC,OAAO,CAAC,CAAC;AACpC,mBAAmB,CAAC,OAAO,CAAC,CAAC;AAC7B,mBAAmB,CAAC,OAAO,CAAC,CAAC;AAC7B,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAC/B,4BAA4B,CAAC,OAAO,CAAC,CAAC;AACtC,sBAAsB,CAAC,OAAO,CAAC,CAAC;AAEhC,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -6,13 +6,11 @@ export declare const addOptionsSchema: z.ZodObject<{
6
6
  path: z.ZodOptional<z.ZodString>;
7
7
  debug: z.ZodDefault<z.ZodBoolean>;
8
8
  dryRun: z.ZodDefault<z.ZodBoolean>;
9
- inspect: z.ZodDefault<z.ZodBoolean>;
10
9
  }, "strip", z.ZodTypeAny, {
11
10
  debug: boolean;
12
11
  yes: boolean;
13
12
  overwrite: boolean;
14
13
  dryRun: boolean;
15
- inspect: boolean;
16
14
  path?: string | undefined;
17
15
  }, {
18
16
  debug?: boolean | undefined;
@@ -20,7 +18,6 @@ export declare const addOptionsSchema: z.ZodObject<{
20
18
  yes?: boolean | undefined;
21
19
  overwrite?: boolean | undefined;
22
20
  dryRun?: boolean | undefined;
23
- inspect?: boolean | undefined;
24
21
  }>;
25
22
  export type AddOptions = z.infer<typeof addOptionsSchema>;
26
23
  export declare const addOutputSchema: z.ZodObject<{