@astralkit/cli 3.0.5 → 4.0.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/index.js +155 -156
- package/package.json +42 -48
- package/src/commands/add.js +162 -444
- package/src/commands/diff.js +57 -107
- package/src/commands/init.js +177 -205
- package/src/commands/list.js +46 -186
- package/src/commands/login.js +133 -157
- package/src/commands/remove.js +42 -118
- package/src/commands/search.js +58 -156
- package/src/commands/update.js +90 -120
- package/src/lib/ai-rules.js +49 -50
- package/src/lib/api.js +152 -197
- package/src/lib/auth.js +98 -142
- package/src/lib/config.js +156 -163
- package/src/lib/pkg-manager.js +25 -65
- package/src/lib/validators.js +50 -87
package/src/commands/diff.js
CHANGED
|
@@ -1,107 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const localContent = fs.readFileSync(localPath, 'utf8');
|
|
59
|
-
const remoteContent = remoteFile.content;
|
|
60
|
-
|
|
61
|
-
if (localContent === remoteContent) {
|
|
62
|
-
console.log(chalk.gray(` ${remoteFile.path}`), chalk.green('(up to date)'));
|
|
63
|
-
} else {
|
|
64
|
-
hasChanges = true;
|
|
65
|
-
console.log(chalk.yellow(`~ ${remoteFile.path}`), chalk.yellow('(modified)'));
|
|
66
|
-
|
|
67
|
-
// Show simple line count diff
|
|
68
|
-
const localLines = localContent.split('\n').length;
|
|
69
|
-
const remoteLines = remoteContent.split('\n').length;
|
|
70
|
-
const diff = remoteLines - localLines;
|
|
71
|
-
if (diff > 0) {
|
|
72
|
-
console.log(chalk.gray(` Remote has ${diff} more line(s)`));
|
|
73
|
-
} else if (diff < 0) {
|
|
74
|
-
console.log(chalk.gray(` Local has ${Math.abs(diff)} more line(s)`));
|
|
75
|
-
} else {
|
|
76
|
-
console.log(chalk.gray(` Same line count, content differs`));
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Check for local files not on remote
|
|
82
|
-
{
|
|
83
|
-
const localFiles = fs.readdirSync(targetDir);
|
|
84
|
-
const remoteFilenames = new Set(data.files.map(f => f.path));
|
|
85
|
-
for (const localFile of localFiles) {
|
|
86
|
-
if (!remoteFilenames.has(localFile)) {
|
|
87
|
-
console.log(chalk.red(`- ${localFile}`), chalk.gray('(local only, not on remote)'));
|
|
88
|
-
hasChanges = true;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
console.log();
|
|
94
|
-
if (hasChanges) {
|
|
95
|
-
console.log(chalk.yellow('Changes detected.'));
|
|
96
|
-
console.log(chalk.gray(`Run ${chalk.cyan(`astralkit update ${componentSlug}`)} to update.`));
|
|
97
|
-
} else {
|
|
98
|
-
console.log(chalk.green('All files are up to date.'));
|
|
99
|
-
}
|
|
100
|
-
} catch (err) {
|
|
101
|
-
spinner.fail('Diff failed.');
|
|
102
|
-
console.error(chalk.red(err.message));
|
|
103
|
-
process.exit(1);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
module.exports = { diffCommand };
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import pc from 'picocolors';
|
|
4
|
+
import * as p from '@clack/prompts';
|
|
5
|
+
import { getComponent } from '../lib/api.js';
|
|
6
|
+
import { getProjectConfig, detectFramework } from '../lib/config.js';
|
|
7
|
+
|
|
8
|
+
export async function diffCommand(componentSlug, options) {
|
|
9
|
+
const ora = (await import('ora')).default;
|
|
10
|
+
const config = getProjectConfig();
|
|
11
|
+
const framework = options.framework || config?.framework || detectFramework();
|
|
12
|
+
const componentsDir = options.dir || config?.componentsDir || 'src/components/ui';
|
|
13
|
+
|
|
14
|
+
const spinner = ora(`Fetching latest ${pc.cyan(componentSlug)}...`).start();
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
const data = await getComponent(componentSlug, framework);
|
|
18
|
+
spinner.stop();
|
|
19
|
+
|
|
20
|
+
if (!data.files?.length) {
|
|
21
|
+
p.log.warn(`No ${framework} version available for "${componentSlug}".`);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
let hasDiff = false;
|
|
26
|
+
|
|
27
|
+
for (const file of data.files) {
|
|
28
|
+
const localPath = path.resolve(process.cwd(), componentsDir, file.path);
|
|
29
|
+
if (!fs.existsSync(localPath)) {
|
|
30
|
+
console.log(pc.yellow(` Not installed: ${file.path}`));
|
|
31
|
+
hasDiff = true;
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const localContent = fs.readFileSync(localPath, 'utf8');
|
|
36
|
+
if (localContent !== file.content) {
|
|
37
|
+
console.log(pc.yellow(` Modified: ${file.path}`));
|
|
38
|
+
hasDiff = true;
|
|
39
|
+
} else {
|
|
40
|
+
console.log(pc.green(` Up to date: ${file.path}`));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (!hasDiff) {
|
|
45
|
+
console.log();
|
|
46
|
+
p.log.success(`${componentSlug} is up to date.`);
|
|
47
|
+
} else {
|
|
48
|
+
console.log();
|
|
49
|
+
p.log.info(`Run ${pc.cyan(`astralkit update ${componentSlug}`)} to update.`);
|
|
50
|
+
}
|
|
51
|
+
} catch (err) {
|
|
52
|
+
spinner.fail('Failed to fetch component.');
|
|
53
|
+
if (err.code === 'AUTH_REQUIRED' || err.code === 'PRO_REQUIRED') p.log.warn(err.message);
|
|
54
|
+
else console.error(pc.red(err.message));
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
}
|
package/src/commands/init.js
CHANGED
|
@@ -1,205 +1,177 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (options.apiKey) {
|
|
29
|
-
if (!options.apiKey.startsWith('ak_')) {
|
|
30
|
-
|
|
31
|
-
console.log(
|
|
32
|
-
process.exit(1);
|
|
33
|
-
}
|
|
34
|
-
saveApiKey(options.apiKey);
|
|
35
|
-
|
|
36
|
-
} else if (!
|
|
37
|
-
|
|
38
|
-
console.log(
|
|
39
|
-
console.log(
|
|
40
|
-
console.log();
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
{
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
} else {
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
console.log(
|
|
174
|
-
console.log(
|
|
175
|
-
console.log(
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
const rulesFile = 'astralkit-ai-rules.md';
|
|
179
|
-
const rulesPath = path.join(process.cwd(), rulesFile);
|
|
180
|
-
if (!fs.existsSync(rulesPath)) {
|
|
181
|
-
fs.writeFileSync(rulesPath, getAiRulesContent());
|
|
182
|
-
console.log(chalk.green(' Created'), chalk.cyan(rulesFile));
|
|
183
|
-
console.log(chalk.gray(' Paste into your AI tool\'s config (.cursorrules, CLAUDE.md, etc.)'));
|
|
184
|
-
} else {
|
|
185
|
-
console.log(chalk.gray(` ${rulesFile} already exists`));
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
console.log();
|
|
189
|
-
console.log(chalk.green('Next steps:'));
|
|
190
|
-
console.log(chalk.gray(' astralkit add sidebar-expanded-light Add a component'));
|
|
191
|
-
console.log(chalk.gray(' astralkit list Browse components'));
|
|
192
|
-
console.log(chalk.gray(' astralkit login Unlock pro components'));
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Detect which package manager the project uses.
|
|
197
|
-
*/
|
|
198
|
-
function detectPackageManager(dir = process.cwd()) {
|
|
199
|
-
if (fs.existsSync(path.join(dir, 'bun.lockb')) || fs.existsSync(path.join(dir, 'bun.lock'))) return 'bun';
|
|
200
|
-
if (fs.existsSync(path.join(dir, 'pnpm-lock.yaml'))) return 'pnpm';
|
|
201
|
-
if (fs.existsSync(path.join(dir, 'yarn.lock'))) return 'yarn';
|
|
202
|
-
return 'npm';
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
module.exports = { initCommand };
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import pc from 'picocolors';
|
|
4
|
+
import * as p from '@clack/prompts';
|
|
5
|
+
import {
|
|
6
|
+
detectFramework,
|
|
7
|
+
detectTailwindVersion,
|
|
8
|
+
isTypeScriptProject,
|
|
9
|
+
isAstralkitInstalled,
|
|
10
|
+
findCssEntryFile,
|
|
11
|
+
getMissingCssImports,
|
|
12
|
+
addCssImports,
|
|
13
|
+
} from '../lib/config.js';
|
|
14
|
+
import { validateFramework } from '../lib/validators.js';
|
|
15
|
+
import { getAiRulesContent } from '../lib/ai-rules.js';
|
|
16
|
+
import { saveApiKey, getApiKey } from '../lib/auth.js';
|
|
17
|
+
import { detectPackageManager, runInstall } from '../lib/pkg-manager.js';
|
|
18
|
+
import { apiRequest } from '../lib/api.js';
|
|
19
|
+
|
|
20
|
+
const FRAMEWORK_LABELS = { nextjs: 'Next.js', react: 'React', html: 'HTML' };
|
|
21
|
+
|
|
22
|
+
export async function initCommand(options) {
|
|
23
|
+
p.intro(pc.bgBlue(pc.white(' AstralKit Setup ')));
|
|
24
|
+
|
|
25
|
+
// ─── Step 1: API Key ─────────────────────────────────
|
|
26
|
+
let apiKey = options.apiKey || getApiKey();
|
|
27
|
+
|
|
28
|
+
if (options.apiKey) {
|
|
29
|
+
if (!options.apiKey.startsWith('ak_')) {
|
|
30
|
+
p.cancel(pc.red('Invalid API key format. Keys start with ak_'));
|
|
31
|
+
console.log(pc.gray('Get your key at ') + pc.cyan('https://astralkit.com/account'));
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
saveApiKey(options.apiKey);
|
|
35
|
+
p.log.success('API key saved');
|
|
36
|
+
} else if (!apiKey) {
|
|
37
|
+
p.log.warn('No API key found.');
|
|
38
|
+
console.log();
|
|
39
|
+
console.log(pc.gray(' Get your free API key at: ') + pc.cyan('https://astralkit.com/account'));
|
|
40
|
+
console.log();
|
|
41
|
+
|
|
42
|
+
const keyInput = await p.text({
|
|
43
|
+
message: 'Paste your API key (or press Enter to skip for now):',
|
|
44
|
+
placeholder: 'ak_...',
|
|
45
|
+
validate(val) {
|
|
46
|
+
if (!val) return;
|
|
47
|
+
if (!val.startsWith('ak_')) return 'Keys start with ak_ — check astralkit.com/account';
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
if (p.isCancel(keyInput)) {
|
|
52
|
+
p.cancel('Setup cancelled.');
|
|
53
|
+
process.exit(0);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (keyInput) {
|
|
57
|
+
saveApiKey(keyInput);
|
|
58
|
+
apiKey = keyInput;
|
|
59
|
+
p.log.success('API key saved');
|
|
60
|
+
} else {
|
|
61
|
+
p.log.warn('Skipping API key — some features will be unavailable.');
|
|
62
|
+
p.log.info('Run ' + pc.cyan('astralkit init --api-key <your-key>') + ' later to add it.');
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
p.log.success('API key found');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// ─── Step 2: Detect Project ────────────────────────────
|
|
69
|
+
if (options.framework && !validateFramework(options.framework)) {
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
let framework = options.framework || detectFramework();
|
|
74
|
+
const twVersion = detectTailwindVersion();
|
|
75
|
+
const isTS = isTypeScriptProject();
|
|
76
|
+
const hasSrc = fs.existsSync(path.join(process.cwd(), 'src'));
|
|
77
|
+
const pm = detectPackageManager();
|
|
78
|
+
|
|
79
|
+
p.log.step(`Framework: ${pc.cyan(FRAMEWORK_LABELS[framework] || framework)}`);
|
|
80
|
+
if (twVersion) p.log.step(`Tailwind: ${pc.cyan('v' + twVersion)}`);
|
|
81
|
+
if (isTS) p.log.step(`TypeScript: ${pc.cyan('Yes')}`);
|
|
82
|
+
p.log.step(`Package manager: ${pc.cyan(pm)}`);
|
|
83
|
+
|
|
84
|
+
// ─── Step 3: Install astralkit as a real npm dependency ────
|
|
85
|
+
if (!isAstralkitInstalled()) {
|
|
86
|
+
if (apiKey) {
|
|
87
|
+
const ora = (await import('ora')).default;
|
|
88
|
+
const spinner = ora('Downloading AstralKit design tokens...').start();
|
|
89
|
+
try {
|
|
90
|
+
const response = await apiRequest('/api/cli/sdk/tarball');
|
|
91
|
+
const contentDisposition = response.headers.get('content-disposition') || '';
|
|
92
|
+
const filenameMatch = contentDisposition.match(/filename="([^"]+)"/);
|
|
93
|
+
const tgzFilename = filenameMatch?.[1] || 'astralkit-0.1.0.tgz';
|
|
94
|
+
|
|
95
|
+
const tgzPath = path.join(process.cwd(), tgzFilename);
|
|
96
|
+
const buffer = Buffer.from(await response.arrayBuffer());
|
|
97
|
+
fs.writeFileSync(tgzPath, buffer);
|
|
98
|
+
|
|
99
|
+
spinner.text = `Installing astralkit via ${pm}...`;
|
|
100
|
+
|
|
101
|
+
const result = await runInstall(pm, process.cwd(), [`./${tgzFilename}`]);
|
|
102
|
+
|
|
103
|
+
if (result.success) {
|
|
104
|
+
spinner.succeed('Installed astralkit design tokens');
|
|
105
|
+
p.log.info(pc.gray(`Commit ${tgzFilename} to git so teammates get it on npm install`));
|
|
106
|
+
} else {
|
|
107
|
+
spinner.fail('Failed to install astralkit.');
|
|
108
|
+
console.log(pc.gray(' ' + (result.hint || result.error)));
|
|
109
|
+
}
|
|
110
|
+
} catch (err) {
|
|
111
|
+
spinner.fail('Could not download design tokens.');
|
|
112
|
+
if (err.code === 'AUTH_REQUIRED') {
|
|
113
|
+
p.log.info('Add your API key: ' + pc.cyan('astralkit init --api-key <key>'));
|
|
114
|
+
} else if (err.code === 'NETWORK_ERROR' || err.code === 'TIMEOUT') {
|
|
115
|
+
p.log.info('Check your connection and run ' + pc.cyan('astralkit init') + ' again.');
|
|
116
|
+
} else {
|
|
117
|
+
p.log.info(pc.gray(err.message));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
} else {
|
|
121
|
+
p.log.warn('Skipping design token install — no API key.');
|
|
122
|
+
p.log.info('Run ' + pc.cyan('astralkit init --api-key <key>') + ' to install them.');
|
|
123
|
+
}
|
|
124
|
+
} else {
|
|
125
|
+
p.log.step('astralkit design tokens already installed');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// ─── Step 4: CSS imports ─────────────────────────────
|
|
129
|
+
const cssEntry = findCssEntryFile();
|
|
130
|
+
if (cssEntry) {
|
|
131
|
+
const missing = getMissingCssImports(cssEntry.path);
|
|
132
|
+
if (missing.length > 0) {
|
|
133
|
+
const addImports = await p.confirm({
|
|
134
|
+
message: `Add AstralKit CSS imports to ${pc.cyan(cssEntry.relative)}?`,
|
|
135
|
+
initialValue: true,
|
|
136
|
+
});
|
|
137
|
+
if (!p.isCancel(addImports) && addImports) {
|
|
138
|
+
addCssImports(cssEntry.path, missing);
|
|
139
|
+
p.log.success(`CSS imports added to ${cssEntry.relative}`);
|
|
140
|
+
}
|
|
141
|
+
} else {
|
|
142
|
+
p.log.step('CSS imports already present');
|
|
143
|
+
}
|
|
144
|
+
} else {
|
|
145
|
+
// No CSS entry found — create one at the framework-appropriate location
|
|
146
|
+
const defaultCssPath = (framework === 'nextjs' && hasSrc)
|
|
147
|
+
? path.join(process.cwd(), 'src', 'app', 'globals.css')
|
|
148
|
+
: (framework === 'nextjs')
|
|
149
|
+
? path.join(process.cwd(), 'app', 'globals.css')
|
|
150
|
+
: (hasSrc)
|
|
151
|
+
? path.join(process.cwd(), 'src', 'index.css')
|
|
152
|
+
: path.join(process.cwd(), 'index.css');
|
|
153
|
+
const defaultCssRelative = path.relative(process.cwd(), defaultCssPath);
|
|
154
|
+
|
|
155
|
+
const allImports = getMissingCssImports('/nonexistent'); // get all imports
|
|
156
|
+
const cssDir = path.dirname(defaultCssPath);
|
|
157
|
+
if (!fs.existsSync(cssDir)) fs.mkdirSync(cssDir, { recursive: true });
|
|
158
|
+
addCssImports(defaultCssPath, allImports);
|
|
159
|
+
p.log.success(`Created ${pc.cyan(defaultCssRelative)} with AstralKit imports`);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// ─── Step 5: AI rules file ───────────────────────────
|
|
163
|
+
const rulesFile = 'astralkit-ai-rules.md';
|
|
164
|
+
const rulesPath = path.join(process.cwd(), rulesFile);
|
|
165
|
+
if (!fs.existsSync(rulesPath)) {
|
|
166
|
+
fs.writeFileSync(rulesPath, getAiRulesContent());
|
|
167
|
+
p.log.success(`Created ${pc.cyan(rulesFile)}`);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// ─── Done ────────────────────────────────────────────
|
|
171
|
+
p.outro(pc.green('AstralKit is ready!'));
|
|
172
|
+
|
|
173
|
+
console.log();
|
|
174
|
+
console.log(pc.gray(' Add a component:'), pc.cyan('astralkit add pricing-table'));
|
|
175
|
+
console.log(pc.gray(' Browse all: '), pc.cyan('astralkit list'));
|
|
176
|
+
console.log();
|
|
177
|
+
}
|