@astralkit/cli 4.2.0 → 4.2.2
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/CHANGELOG.md +37 -0
- package/README.md +38 -18
- package/package.json +3 -2
- package/src/commands/add.js +565 -451
- package/src/commands/init.js +52 -1
- package/src/commands/list.js +8 -3
- package/src/commands/remove.js +5 -0
- package/src/commands/search.js +6 -3
- package/src/lib/api.js +15 -3
- package/src/lib/config.js +38 -2
- package/src/lib/pkg-manager.js +18 -3
- package/src/lib/validators.js +109 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the `@astralkit/cli` package.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [4.2.2] — 2026-04-18
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **CSS import ordering.** When `init` ran against a project with an existing `@import "tailwindcss";` line, it was prepending the astralkit imports *before* tailwindcss — the opposite of the recommended order (Tailwind v4 docs + our own main app put tailwindcss first, then `@theme` customizations). Now the astralkit imports are inserted on the line after the last tailwind-related line, matching the canonical order.
|
|
12
|
+
- **Tailwind version parsing** handles more real-world `package.json` version specifiers. Previous logic used `.replace(/[^0-9]/, '')` (no `g` flag, strips only first non-digit), which produced misleading numbers for values like `"^4.0.0-beta"`. New logic strips all leading non-digits before parsing and returns `null` for non-parseable values like `"latest"` or `"file:..."` instead of guessing.
|
|
13
|
+
- **Tailwind v3 plugin registration regex** now matches more formatting variants of the `plugins: [...]` array — including no-space (`plugins:[`) and newline-before-bracket formats. Previously only matched `plugins: [` (one space).
|
|
14
|
+
- **Package manager detection** now walks up parent directories looking for a lockfile, instead of checking only `cwd`. This correctly picks up pnpm/yarn/bun in monorepo subpackages where the lockfile lives at the workspace root.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- No user-facing API changes. All three fixes improve detection robustness during `init`.
|
|
18
|
+
|
|
19
|
+
## [4.2.1] — 2026-04-18
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
- **README example slugs.** Replaced three non-existent slugs (`pricing-table`, `sidebar-light`, `auth-system`) with real catalog slugs (`button-variants`, `sidebar-expanded-light`, `authentication-system`). Copy-pasting from the README now produces working commands.
|
|
23
|
+
- **`init` success message** no longer points at `pricing-table`. Now shows `astralkit add button-variants`.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- **Plans table in README** rewritten to reflect the actual four tiers (Free, Pro, Plus, Lifetime) documented on the pricing page. Previous table only showed Free/Pro and incorrectly claimed Free tier gets React/Next.js output (it's HTML-only via the website).
|
|
27
|
+
- **Environment variable documentation** expanded. Added `ASTRALKIT_TOKEN` (session JWT from browser login), tightened descriptions for `ASTRALKIT_API_KEY`, `ASTRALKIT_API_URL` (https-only-except-localhost note), and `ASTRALKIT_LOGIN_PORT` (valid range).
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
- **"Discover what's available" section** in README. Points users at `astralkit list` and the showcase URLs rather than a hardcoded catalog list that would go stale.
|
|
31
|
+
- **Boosters / workflows roadmap note.** Makes clear they're rolling out through 2026 and that components (156 of them) are available now.
|
|
32
|
+
|
|
33
|
+
## [4.2.0] — 2026-04-02
|
|
34
|
+
|
|
35
|
+
### Previous public release.
|
|
36
|
+
|
|
37
|
+
Commands available: `init`, `add`, `remove`, `login`, `logout`, `whoami`, `list`, `search`, `diff`, `update`. Smart content detection across components/boosters/workflows registries. Framework detection (Next.js/React), Tailwind version detection (v3/v4), TypeScript detection, package manager detection (npm/pnpm/yarn/bun).
|
package/README.md
CHANGED
|
@@ -17,8 +17,8 @@ npx @astralkit/cli add button-sizes --api-key ak_YOUR_KEY
|
|
|
17
17
|
After init, your API key is saved locally — no need to pass it again:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
astralkit add
|
|
21
|
-
astralkit add sidebar-light
|
|
20
|
+
astralkit add button-variants
|
|
21
|
+
astralkit add sidebar-expanded-light
|
|
22
22
|
astralkit list
|
|
23
23
|
```
|
|
24
24
|
|
|
@@ -62,7 +62,7 @@ Add a component, booster, or workflow to your project. The CLI **auto-detects th
|
|
|
62
62
|
```bash
|
|
63
63
|
# Just type the name — the CLI figures out what it is
|
|
64
64
|
astralkit add avatar-verified # → found as component, installs directly
|
|
65
|
-
astralkit add
|
|
65
|
+
astralkit add authentication-system # → found as booster, installs directly
|
|
66
66
|
astralkit add ai-saas-starter # → found as workflow, scaffolds directly
|
|
67
67
|
```
|
|
68
68
|
|
|
@@ -75,9 +75,9 @@ astralkit add ai-saas-starter # → found as workflow, scaffolds direct
|
|
|
75
75
|
You can still use explicit flags to skip detection:
|
|
76
76
|
|
|
77
77
|
```bash
|
|
78
|
-
astralkit add
|
|
79
|
-
astralkit add crm --workflow --overlay
|
|
80
|
-
astralkit add
|
|
78
|
+
astralkit add authentication-system --booster # skip detection, install as booster
|
|
79
|
+
astralkit add crm-project-management --workflow --overlay # merge workflow into current project
|
|
80
|
+
astralkit add button-variants --framework react
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
| Flag | Description |
|
|
@@ -96,8 +96,8 @@ astralkit add pricing-table --framework react
|
|
|
96
96
|
Remove a previously installed component, booster, or workflow.
|
|
97
97
|
|
|
98
98
|
```bash
|
|
99
|
-
astralkit remove
|
|
100
|
-
astralkit remove
|
|
99
|
+
astralkit remove authentication-system
|
|
100
|
+
astralkit remove button-variants --force # skip confirmation
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
### `astralkit list`
|
|
@@ -234,14 +234,18 @@ Your `globals.css`:
|
|
|
234
234
|
|
|
235
235
|
Teammates clone and run `npm install` — everything works. No `astralkit init` needed in CI.
|
|
236
236
|
|
|
237
|
-
##
|
|
237
|
+
## Plans
|
|
238
238
|
|
|
239
|
-
| | Free | Pro |
|
|
240
|
-
|
|
241
|
-
|
|
|
242
|
-
|
|
|
243
|
-
|
|
|
244
|
-
|
|
|
239
|
+
| | Free | Pro | Plus | Lifetime |
|
|
240
|
+
|---|---|---|---|---|
|
|
241
|
+
| **Component downloads** | 10/month | Unlimited | Unlimited | Unlimited |
|
|
242
|
+
| **Premium components** | — | ✓ | ✓ | ✓ |
|
|
243
|
+
| **HTML / Tailwind** | ✓ | ✓ | ✓ | ✓ |
|
|
244
|
+
| **React + Next.js** | — | ✓ | ✓ | ✓ |
|
|
245
|
+
| **Boosters** | — | — | 5/month | Unlimited |
|
|
246
|
+
| **Workflows** | — | — | 1/month | Unlimited |
|
|
247
|
+
|
|
248
|
+
> **CLI access starts at Pro.** The Free tier is HTML/Tailwind only and delivered by copy-paste from [astralkit.com](https://astralkit.com) — the CLI's React and Next.js output requires a paid plan. Boosters and workflows require Plus or Lifetime.
|
|
245
249
|
|
|
246
250
|
Upgrade at [astralkit.com/pricing](https://astralkit.com/pricing).
|
|
247
251
|
|
|
@@ -249,9 +253,10 @@ Upgrade at [astralkit.com/pricing](https://astralkit.com/pricing).
|
|
|
249
253
|
|
|
250
254
|
| Variable | Description |
|
|
251
255
|
|----------|-------------|
|
|
252
|
-
| `ASTRALKIT_API_KEY` | API key for CI/CD (skips interactive auth) |
|
|
253
|
-
| `
|
|
254
|
-
| `
|
|
256
|
+
| `ASTRALKIT_API_KEY` | Permanent API key for CI/CD (skips interactive auth). Get one at [astralkit.com/account](https://astralkit.com/account). |
|
|
257
|
+
| `ASTRALKIT_TOKEN` | Session JWT captured from `astralkit login`. Useful for short-lived CI contexts where you want to reuse a browser-login token rather than provisioning an API key. Checked before `ASTRALKIT_API_KEY`. |
|
|
258
|
+
| `ASTRALKIT_API_URL` | Override API base URL (development only). Must be `https://` unless pointing at localhost. |
|
|
259
|
+
| `ASTRALKIT_LOGIN_PORT` | Override the OAuth callback port for `astralkit login` (default: `9876`). Must be in `1024–65535`. |
|
|
255
260
|
|
|
256
261
|
## Troubleshooting
|
|
257
262
|
|
|
@@ -276,6 +281,21 @@ npm install <package> --legacy-peer-deps
|
|
|
276
281
|
- React or Next.js project
|
|
277
282
|
- An AstralKit account for premium content
|
|
278
283
|
|
|
284
|
+
## Discover what's available
|
|
285
|
+
|
|
286
|
+
Two ways to browse the real inventory:
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
astralkit list # components
|
|
290
|
+
astralkit list --boosters # feature modules
|
|
291
|
+
astralkit list --workflows # app scaffolds
|
|
292
|
+
astralkit search "stripe" # search across everything
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
Or browse the showcase: [astralkit.com/components](https://astralkit.com/components), [/boosters](https://astralkit.com/boosters), [/workflows](https://astralkit.com/workflows). Every card shows the exact slug you pass to `astralkit add`.
|
|
296
|
+
|
|
297
|
+
> **Boosters and workflows are rolling out through 2026.** The CLI supports them today, but the registry catalog is still being populated. Check [astralkit.com/boosters](https://astralkit.com/boosters) and [/workflows](https://astralkit.com/workflows) for release dates. Components (all 156) are available now.
|
|
298
|
+
|
|
279
299
|
## Links
|
|
280
300
|
|
|
281
301
|
- [AstralKit](https://astralkit.com)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astralkit/cli",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.2",
|
|
4
4
|
"description": "AstralKit CLI — Install and manage UI components in your project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"bin",
|
|
11
11
|
"src",
|
|
12
|
-
"LICENSE"
|
|
12
|
+
"LICENSE",
|
|
13
|
+
"CHANGELOG.md"
|
|
13
14
|
],
|
|
14
15
|
"engines": {
|
|
15
16
|
"node": ">=18.0.0"
|