designkit-ai 1.3.0 → 1.5.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 +23 -21
- package/bin/designkit.js +34 -7
- package/package.json +1 -1
- package/src/commands/autogen.js +297 -264
- package/src/commands/config.js +55 -0
- package/src/commands/studio.js +1162 -0
- package/src/lib/config.js +66 -0
- package/src/lib/providers.js +3 -1
package/README.md
CHANGED
|
@@ -8,6 +8,29 @@
|
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
+
## CLI
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g designkit-ai
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
| Command | Description |
|
|
18
|
+
|---------|-------------|
|
|
19
|
+
| `designkit list` | Browse all 502 components |
|
|
20
|
+
| `designkit search <query>` | Search by name or tag |
|
|
21
|
+
| `designkit add <id>` | Copy a component to your project |
|
|
22
|
+
| `designkit init` | Add design tokens (css / js / ts / json) |
|
|
23
|
+
| `designkit design "<prompt>"` | Generate UI with AI (Claude / Gemini / GPT-4o) |
|
|
24
|
+
| `designkit convert <file> --to <framework>` | Convert HTML to any framework with AI |
|
|
25
|
+
| `designkit autogen "<prompt>"` | Generate a full multi-screen design project with gallery |
|
|
26
|
+
| `designkit imagine "<prompt>"` | Generate images with Gemini Imagen 3 or DALL-E 3 |
|
|
27
|
+
|
|
28
|
+
**→ Full CLI reference: [CLI.md](CLI.md)**
|
|
29
|
+
|
|
30
|
+

|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
11
34
|
## Why DesignKit?
|
|
12
35
|
|
|
13
36
|
### Design-first, then build
|
|
@@ -388,27 +411,6 @@ then build this as a React Native app.
|
|
|
388
411
|
|
|
389
412
|
---
|
|
390
413
|
|
|
391
|
-
## CLI
|
|
392
|
-
|
|
393
|
-
```bash
|
|
394
|
-
npm install -g designkit-ai
|
|
395
|
-
```
|
|
396
|
-
|
|
397
|
-
| Command | Description |
|
|
398
|
-
|---------|-------------|
|
|
399
|
-
| `designkit list` | Browse all 502 components |
|
|
400
|
-
| `designkit search <query>` | Search by name or tag |
|
|
401
|
-
| `designkit add <id>` | Copy a component to your project |
|
|
402
|
-
| `designkit init` | Add design tokens (css / js / ts / json) |
|
|
403
|
-
| `designkit design "<prompt>"` | Generate UI with AI (Claude / Gemini / GPT-4o) |
|
|
404
|
-
| `designkit convert <file> --to <framework>` | Convert HTML to any framework with AI |
|
|
405
|
-
| `designkit autogen "<prompt>"` | Generate a full multi-screen design project with gallery |
|
|
406
|
-
| `designkit imagine "<prompt>"` | Generate images with Gemini Imagen 3 or DALL-E 3 |
|
|
407
|
-
|
|
408
|
-
**→ Full CLI reference: [CLI.md](CLI.md)**
|
|
409
|
-
|
|
410
|
-
---
|
|
411
|
-
|
|
412
414
|
## How to use
|
|
413
415
|
|
|
414
416
|
### 1. Copy a component
|
package/bin/designkit.js
CHANGED
|
@@ -9,6 +9,9 @@ import { convertCommand } from '../src/commands/convert.js'
|
|
|
9
9
|
import { imagineCommand } from '../src/commands/imagine.js'
|
|
10
10
|
import { projectCommand } from '../src/commands/project.js'
|
|
11
11
|
import { autogenCommand } from '../src/commands/autogen.js'
|
|
12
|
+
import { configCommand } from '../src/commands/config.js'
|
|
13
|
+
import { studioCommand } from '../src/commands/studio.js'
|
|
14
|
+
import { getDefaultProvider, getDefaultPlatform } from '../src/lib/config.js'
|
|
12
15
|
import { readFileSync } from 'fs'
|
|
13
16
|
import { fileURLToPath } from 'url'
|
|
14
17
|
import { dirname, join } from 'path'
|
|
@@ -51,17 +54,17 @@ program
|
|
|
51
54
|
.command('design <prompt>')
|
|
52
55
|
.description('Generate a UI component with AI')
|
|
53
56
|
.option('-s, --skill <skill>', 'Skill: design, react, nextjs, vue, svelte, tailwind, flutter, swiftui, react-native', 'design')
|
|
54
|
-
.option('-p, --provider <provider>',
|
|
57
|
+
.option('-p, --provider <provider>', `AI provider: anthropic, gemini, openai (default: ${getDefaultProvider()})`)
|
|
55
58
|
.option('-o, --output <file>', 'Save output to file')
|
|
56
|
-
.action(designCommand)
|
|
59
|
+
.action((prompt, opts) => designCommand(prompt, { ...opts, provider: opts.provider || getDefaultProvider() }))
|
|
57
60
|
|
|
58
61
|
program
|
|
59
62
|
.command('convert <file>')
|
|
60
63
|
.description('Convert an HTML component to another framework with AI')
|
|
61
64
|
.requiredOption('--to <framework>', 'Target: react, nextjs, vue, svelte, tailwind, flutter, swiftui, react-native')
|
|
62
|
-
.option('-p, --provider <provider>',
|
|
65
|
+
.option('-p, --provider <provider>', `AI provider: anthropic, gemini, openai (default: ${getDefaultProvider()})`)
|
|
63
66
|
.option('-o, --output <file>', 'Save output to file (default: same name, new extension)')
|
|
64
|
-
.action(convertCommand)
|
|
67
|
+
.action((file, opts) => convertCommand(file, { ...opts, provider: opts.provider || getDefaultProvider() }))
|
|
65
68
|
|
|
66
69
|
program
|
|
67
70
|
.command('project')
|
|
@@ -87,11 +90,35 @@ program
|
|
|
87
90
|
program
|
|
88
91
|
.command('autogen <project>')
|
|
89
92
|
.description('Generate a full design project: color spec + HTML files for every screen')
|
|
90
|
-
.option('-p, --provider <provider>',
|
|
91
|
-
.option('--platform <platform>',
|
|
93
|
+
.option('-p, --provider <provider>', `AI provider: anthropic, gemini, openai (default: ${getDefaultProvider()})`)
|
|
94
|
+
.option('--platform <platform>', `Target platform: mobile, web (default: ${getDefaultPlatform()})`)
|
|
92
95
|
.option('--screens <list>', 'Comma-separated screen/page names (auto-generated if omitted)')
|
|
93
96
|
.option('--images <folder>', 'Path to local image assets folder (uses placehold.jp if omitted)')
|
|
94
97
|
.option('-o, --output <dir>', 'Output directory (default: output/<project-slug>)')
|
|
95
|
-
.action(autogenCommand
|
|
98
|
+
.action((project, opts) => autogenCommand(project, {
|
|
99
|
+
...opts,
|
|
100
|
+
provider: opts.provider || getDefaultProvider(),
|
|
101
|
+
platform: opts.platform || getDefaultPlatform()
|
|
102
|
+
}))
|
|
103
|
+
|
|
104
|
+
program
|
|
105
|
+
.command('config [action] [args...]')
|
|
106
|
+
.description('Get or set default config values (provider, platform)')
|
|
107
|
+
.addHelpText('after', `
|
|
108
|
+
Examples:
|
|
109
|
+
designkit config # show all config
|
|
110
|
+
designkit config set provider gemini # set default provider
|
|
111
|
+
designkit config set provider anthropic
|
|
112
|
+
designkit config set platform web
|
|
113
|
+
designkit config get provider`)
|
|
114
|
+
.action(configCommand)
|
|
115
|
+
|
|
116
|
+
program
|
|
117
|
+
.command('studio')
|
|
118
|
+
.description('Open DesignKit Studio — local web UI with live code + preview')
|
|
119
|
+
.option('-p, --provider <provider>', `AI provider: anthropic, gemini, openai (default: ${getDefaultProvider()})`)
|
|
120
|
+
.option('--platform <platform>', `Target platform: mobile, web (default: ${getDefaultPlatform()})`)
|
|
121
|
+
.option('--port <port>', 'Port to listen on', '3333')
|
|
122
|
+
.action(studioCommand)
|
|
96
123
|
|
|
97
124
|
program.parse()
|