@nexus-framework/cli 0.2.1 → 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/README.md +62 -6
- package/dist/cli.js +82 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/pack.d.ts +28 -0
- package/dist/commands/pack.d.ts.map +1 -0
- package/dist/commands/pack.js +206 -0
- package/dist/commands/pack.js.map +1 -0
- package/dist/commands/skill.d.ts +53 -0
- package/dist/commands/skill.d.ts.map +1 -0
- package/dist/commands/skill.js +371 -0
- package/dist/commands/skill.js.map +1 -0
- package/dist/commands/update.d.ts +24 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +100 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/generators/ai-config.js +40 -1
- package/dist/generators/ai-config.js.map +1 -1
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/generators/index.js +38 -2
- package/dist/generators/index.js.map +1 -1
- package/dist/generators/skills.d.ts +32 -0
- package/dist/generators/skills.d.ts.map +1 -0
- package/dist/generators/skills.js +220 -0
- package/dist/generators/skills.js.map +1 -0
- package/dist/generators/structure.d.ts.map +1 -1
- package/dist/generators/structure.js +42 -3
- package/dist/generators/structure.js.map +1 -1
- package/dist/prompts/frameworks.js +1 -1
- package/dist/prompts/frameworks.js.map +1 -1
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +17 -0
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/skill-config.d.ts +19 -0
- package/dist/prompts/skill-config.d.ts.map +1 -0
- package/dist/prompts/skill-config.js +22 -0
- package/dist/prompts/skill-config.js.map +1 -0
- package/dist/types/config.d.ts +3 -1
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/update-check.d.ts +27 -0
- package/dist/utils/update-check.d.ts.map +1 -0
- package/dist/utils/update-check.js +111 -0
- package/dist/utils/update-check.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
[](https://www.typescriptlang.org/)
|
|
10
10
|
[](https://nodejs.org/)
|
|
11
|
-
[](https://vitest.dev/)
|
|
12
12
|
[](https://www.npmjs.com/package/@nexus-framework/cli)
|
|
13
13
|
[](LICENSE)
|
|
14
14
|
[](https://github.com/GDA-Africa/nexus-cli/pulls)
|
|
@@ -79,6 +79,20 @@ Every project gets a documentation system AI agents can parse, a knowledge base
|
|
|
79
79
|
- **`nexus adopt`** — add NEXUS to any existing codebase
|
|
80
80
|
- **`nexus upgrade`** — regenerate templates, preserve user work
|
|
81
81
|
- **`nexus repair`** — fix missing or corrupted NEXUS files
|
|
82
|
+
- **`nexus pack`** — zip `.nexus/` into a portable backup
|
|
83
|
+
- **`nexus unpack`** — restore from a backup zip with verification
|
|
84
|
+
- **`nexus update`** — self-update the CLI to the latest version
|
|
85
|
+
|
|
86
|
+
</td>
|
|
87
|
+
<td width="50%">
|
|
88
|
+
|
|
89
|
+
### 🧠 Skills System
|
|
90
|
+
- **`nexus skill list`** — see all skills installed in your project
|
|
91
|
+
- **`nexus skill registry`** — browse all available skills in the registry
|
|
92
|
+
- **`nexus skill new`** — scaffold a custom skill interactively
|
|
93
|
+
- **`nexus skill status`** — health-check all installed skills
|
|
94
|
+
- Pre-read instruction files so AI agents know *how* to do tasks
|
|
95
|
+
- Sourced from `@nexus-framework/skills` — updated independently
|
|
82
96
|
|
|
83
97
|
</td>
|
|
84
98
|
<td width="50%">
|
|
@@ -112,7 +126,7 @@ nexus init my-app
|
|
|
112
126
|
You'll be guided through an interactive setup:
|
|
113
127
|
|
|
114
128
|
```
|
|
115
|
-
🔮 NEXUS CLI v0.
|
|
129
|
+
🔮 NEXUS CLI v0.3.0 — AI-Native Development Framework
|
|
116
130
|
|
|
117
131
|
? What are you building? › Web Application
|
|
118
132
|
? How will your app handle data? › Cloud First
|
|
@@ -161,6 +175,7 @@ Every generated project includes:
|
|
|
161
175
|
| `src/` | Framework-specific source code and branded landing page |
|
|
162
176
|
| `.nexus/docs/` | **The NEXUS Doc System** — 8 AI-readable files + project brain + knowledge base |
|
|
163
177
|
| `.nexus/ai/` | Master AI instructions — the single source of truth for agent behavior |
|
|
178
|
+
| `.nexus/skills/` | **Skills System** — `core/` (framework skills), `custom/` (yours), `community/` (registry) |
|
|
164
179
|
| Tool configs | `.cursorrules`, `.windsurfrules`, `.clinerules`, `AGENTS.md`, `.github/copilot-instructions.md` — each embeds full instructions |
|
|
165
180
|
| `tests/` | Vitest/Jest config, example tests, and test helpers |
|
|
166
181
|
| `package.json` | Real dependencies, real scripts — `npm run dev` works immediately |
|
|
@@ -184,6 +199,44 @@ Every generated project includes:
|
|
|
184
199
|
|
|
185
200
|
---
|
|
186
201
|
|
|
202
|
+
## 🧠 Skills System
|
|
203
|
+
|
|
204
|
+
Skills are pre-read instruction files that tell AI agents *how* to execute tasks in your specific project — not just what to do, but the exact patterns, conventions, and anti-patterns your codebase follows.
|
|
205
|
+
|
|
206
|
+
Every project gets a `.nexus/skills/` directory with three zones:
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
.nexus/skills/
|
|
210
|
+
README.md ← auto-generated index agents read first
|
|
211
|
+
core/ ← framework-matched skills from @nexus-framework/skills
|
|
212
|
+
custom/ ← your own skills (created with nexus skill new, never touched by NEXUS)
|
|
213
|
+
community/ ← skills installed from the registry
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Managing Skills
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
nexus skill list # what's installed in this project
|
|
220
|
+
nexus skill registry # browse everything in the registry
|
|
221
|
+
nexus skill registry --framework nextjs # filter to one framework
|
|
222
|
+
nexus skill new # scaffold a custom skill interactively
|
|
223
|
+
nexus skill status # health-check: deprecated, invalid frontmatter
|
|
224
|
+
nexus skill install <pkg> # install a community skill pack
|
|
225
|
+
nexus skill remove <name> # remove a community skill
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Custom Skills
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
nexus skill new my-service-pattern
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Guides you through setting a category, trigger phrases, and scaffolds a full markdown template. The AI agent reads this file before any task matching the triggers.
|
|
235
|
+
|
|
236
|
+
**Precedence:** `custom/` > `core/` > `community/` — your skills always win.
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
187
240
|
## 🎭 Agent Persona
|
|
188
241
|
|
|
189
242
|
NEXUS lets you configure how AI agents communicate when they're synced with your project.
|
|
@@ -232,18 +285,21 @@ After adopting, your AI coding tool will auto-detect the NEXUS docs, scan your c
|
|
|
232
285
|
### ✅ Shipped
|
|
233
286
|
- [x] Core CLI with `nexus init`, `nexus adopt`, `nexus upgrade`, `nexus repair`
|
|
234
287
|
- [x] Interactive prompt system (7 modules including persona)
|
|
235
|
-
- [x] Generator engine (8 modules: structure, docs, config, tests, CI/CD, landing page, AI config,
|
|
288
|
+
- [x] Generator engine (8 modules: structure, docs, config, tests, CI/CD, landing page, AI config, skills)
|
|
236
289
|
- [x] AI-native documentation system (8 structured files + project brain + knowledge base + onboarding protocol)
|
|
237
290
|
- [x] Agent Persona system (tone, verbosity, identity, custom directives)
|
|
238
291
|
- [x] Multi-tool AI support (Cursor, Copilot, Windsurf, Cline, Claude Code)
|
|
239
292
|
- [x] 6 frontend frameworks supported
|
|
240
293
|
- [x] Smart file strategy (upgrade preserves user work, repair fixes corruption)
|
|
241
294
|
- [x] Progressive knowledge base (append-only, category-tagged, AI-scannable)
|
|
242
|
-
- [x]
|
|
295
|
+
- [x] **Skills System** — `nexus skill` (6 subcommands), `.nexus/skills/`, sourced from `@nexus-framework/skills`
|
|
296
|
+
- [x] **`nexus pack` / `nexus unpack`** — portable `.nexus/` migration with zip + verification
|
|
297
|
+
- [x] **`nexus update`** — self-updating CLI + startup update notifications
|
|
298
|
+
- [x] 225 unit tests passing
|
|
243
299
|
- [x] Published to npm as `@nexus-framework/cli`
|
|
244
300
|
- [x] CI/CD with auto-publish to npm on version bump
|
|
245
301
|
|
|
246
|
-
### 🔜 Next Up (v0.3.
|
|
302
|
+
### 🔜 Next Up (v0.3.x)
|
|
247
303
|
- [ ] E2E tests — generate a project, run its build, verify all files
|
|
248
304
|
- [ ] Framework-specific template content (not just landing pages)
|
|
249
305
|
- [ ] `nexus add <feature>` — add capabilities to existing NEXUS projects
|
|
@@ -272,7 +328,7 @@ We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
|
272
328
|
```bash
|
|
273
329
|
git clone https://github.com/GDA-Africa/nexus-cli.git
|
|
274
330
|
cd nexus-cli && yarn install
|
|
275
|
-
yarn lint && yarn test #
|
|
331
|
+
yarn lint && yarn test # 225 tests, zero lint errors
|
|
276
332
|
```
|
|
277
333
|
|
|
278
334
|
---
|
package/dist/cli.js
CHANGED
|
@@ -6,8 +6,12 @@
|
|
|
6
6
|
import { Command } from 'commander';
|
|
7
7
|
import { adoptCommand } from './commands/adopt.js';
|
|
8
8
|
import { initCommand } from './commands/init.js';
|
|
9
|
+
import { packCommand, unpackCommand } from './commands/pack.js';
|
|
9
10
|
import { repairCommand } from './commands/repair.js';
|
|
11
|
+
import { skillInstallCommand, skillListCommand, skillNewCommand, skillRegistryCommand, skillRemoveCommand, skillStatusCommand, } from './commands/skill.js';
|
|
12
|
+
import { updateCommand, printUpdateBanner } from './commands/update.js';
|
|
10
13
|
import { upgradeCommand } from './commands/upgrade.js';
|
|
14
|
+
import { checkForUpdate } from './utils/update-check.js';
|
|
11
15
|
import { version } from './version.js';
|
|
12
16
|
const program = new Command();
|
|
13
17
|
program
|
|
@@ -41,6 +45,82 @@ program
|
|
|
41
45
|
.action(async (targetPath) => {
|
|
42
46
|
await repairCommand(targetPath);
|
|
43
47
|
});
|
|
44
|
-
//
|
|
45
|
-
program
|
|
48
|
+
// ── nexus skill ──────────────────────────────────────────────
|
|
49
|
+
const skillCmd = program
|
|
50
|
+
.command('skill')
|
|
51
|
+
.description('Manage NEXUS Skills — pre-read AI task instructions in .nexus/skills/');
|
|
52
|
+
skillCmd
|
|
53
|
+
.command('new [name]')
|
|
54
|
+
.description('Scaffold a new custom skill in .nexus/skills/custom/')
|
|
55
|
+
.action(async (name) => {
|
|
56
|
+
await skillNewCommand(name);
|
|
57
|
+
});
|
|
58
|
+
skillCmd
|
|
59
|
+
.command('list')
|
|
60
|
+
.description('List all installed skills (core / custom / community)')
|
|
61
|
+
.action(async () => {
|
|
62
|
+
await skillListCommand();
|
|
63
|
+
});
|
|
64
|
+
skillCmd
|
|
65
|
+
.command('registry')
|
|
66
|
+
.description('Browse all skills available in the @nexus-framework/skills registry')
|
|
67
|
+
.option('--framework <name>', 'Filter to a single framework (e.g. nextjs, react-vite, shared)')
|
|
68
|
+
.action(async (options) => {
|
|
69
|
+
await skillRegistryCommand(options);
|
|
70
|
+
});
|
|
71
|
+
skillCmd
|
|
72
|
+
.command('install <package>')
|
|
73
|
+
.description('Install community skills from @nexus-framework/skills or a registry package')
|
|
74
|
+
.action(async (pkg) => {
|
|
75
|
+
await skillInstallCommand(pkg);
|
|
76
|
+
});
|
|
77
|
+
skillCmd
|
|
78
|
+
.command('remove <name>')
|
|
79
|
+
.description('Remove a community skill (cannot remove core or custom skills)')
|
|
80
|
+
.action(async (name) => {
|
|
81
|
+
await skillRemoveCommand(name);
|
|
82
|
+
});
|
|
83
|
+
skillCmd
|
|
84
|
+
.command('status')
|
|
85
|
+
.description('Check skill health — missing core skills, invalid frontmatter, deprecated status')
|
|
86
|
+
.action(async () => {
|
|
87
|
+
await skillStatusCommand();
|
|
88
|
+
});
|
|
89
|
+
// ── nexus pack / unpack ───────────────────────────────────────
|
|
90
|
+
program
|
|
91
|
+
.command('pack [path]')
|
|
92
|
+
.description('Zip .nexus/ into a portable nexus-backup-<timestamp>.zip for migration')
|
|
93
|
+
.action(async (targetPath) => {
|
|
94
|
+
await packCommand(targetPath);
|
|
95
|
+
});
|
|
96
|
+
program
|
|
97
|
+
.command('unpack [path]')
|
|
98
|
+
.description('Extract a nexus-backup-*.zip and verify the restored .nexus/ structure')
|
|
99
|
+
.option('--file <zipfile>', 'Specify a zip file to unpack (default: most recent backup in directory)')
|
|
100
|
+
.action(async (targetPath, options) => {
|
|
101
|
+
await unpackCommand(targetPath, options);
|
|
102
|
+
});
|
|
103
|
+
// ── nexus update ──────────────────────────────────────────────
|
|
104
|
+
program
|
|
105
|
+
.command('update')
|
|
106
|
+
.description('Check for a newer version of NEXUS CLI and install it automatically')
|
|
107
|
+
.action(async () => {
|
|
108
|
+
await updateCommand();
|
|
109
|
+
});
|
|
110
|
+
// ── Startup update notification ───────────────────────────────
|
|
111
|
+
// Silently checks the npm registry after every command.
|
|
112
|
+
// If a newer version exists, prints a short non-blocking banner
|
|
113
|
+
// at the end of the command output.
|
|
114
|
+
async function runWithUpdateCheck() {
|
|
115
|
+
// Fire update check in background — does not block CLI startup
|
|
116
|
+
const updatePromise = checkForUpdate(4000);
|
|
117
|
+
// Parse and run the actual command
|
|
118
|
+
await program.parseAsync();
|
|
119
|
+
// After the command finishes, check if an update was found
|
|
120
|
+
const info = await updatePromise;
|
|
121
|
+
if (info?.hasUpdate) {
|
|
122
|
+
printUpdateBanner(info);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
void runWithUpdateCheck();
|
|
46
126
|
//# 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":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc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AO,CAAC,CAAC;AAC3C,CAAC,CAAC,CAAC;AAEL,iEAAiE;AAEjE,OAAO;KACJ,OAAO,CAAC,QAAQ,CAAC;KACjB,WAAW,CAAC,qEAAqE,CAAC;KAClF,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,MAAM,aAAa,EAAE,CAAC;AACxB,CAAC,CAAC,CAAC;AAEL,iEAAiE;AACjE,wDAAwD;AACxD,gEAAgE;AAChE,oCAAoC;AAEpC,KAAK,UAAU,kBAAkB;IAC/B,+DAA+D;IAC/D,MAAM,aAAa,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IAE3C,mCAAmC;IACnC,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC;IAE3B,2DAA2D;IAC3D,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC;IACjC,IAAI,IAAI,EAAE,SAAS,EAAE,CAAC;QACpB,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;AACH,CAAC;AAED,KAAK,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NEXUS CLI - Pack & Unpack Commands
|
|
3
|
+
*
|
|
4
|
+
* `nexus pack` — Zips .nexus/ into nexus-backup-<timestamp>.zip for portable migration.
|
|
5
|
+
* `nexus unpack` — Finds + unzips a nexus-backup-*.zip, then verifies the restored structure.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* `nexus pack [path]`
|
|
9
|
+
*
|
|
10
|
+
* Zips the .nexus/ folder in the target directory into a portable
|
|
11
|
+
* nexus-backup-<timestamp>.zip file placed in the same directory.
|
|
12
|
+
* Safe to run anywhere — does not modify .nexus/ at all.
|
|
13
|
+
*/
|
|
14
|
+
export declare function packCommand(targetPath?: string): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* `nexus unpack [path] [--file <zipfile>]`
|
|
17
|
+
*
|
|
18
|
+
* Finds the most recent nexus-backup-*.zip in the target directory
|
|
19
|
+
* (or a specific file via --file), extracts it, then verifies the
|
|
20
|
+
* restored .nexus/ structure is complete.
|
|
21
|
+
*
|
|
22
|
+
* Safe to run even if .nexus/ already exists — extracted files will
|
|
23
|
+
* overwrite/merge but no existing file is deleted.
|
|
24
|
+
*/
|
|
25
|
+
export declare function unpackCommand(targetPath?: string, options?: {
|
|
26
|
+
file?: string;
|
|
27
|
+
}): Promise<void>;
|
|
28
|
+
//# sourceMappingURL=pack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pack.d.ts","sourceRoot":"","sources":["../../src/commands/pack.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA8BH;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmDpE;AAID;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CACjC,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAC9B,OAAO,CAAC,IAAI,CAAC,CA4Cf"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NEXUS CLI - Pack & Unpack Commands
|
|
3
|
+
*
|
|
4
|
+
* `nexus pack` — Zips .nexus/ into nexus-backup-<timestamp>.zip for portable migration.
|
|
5
|
+
* `nexus unpack` — Finds + unzips a nexus-backup-*.zip, then verifies the restored structure.
|
|
6
|
+
*/
|
|
7
|
+
import fs from 'node:fs';
|
|
8
|
+
import { createWriteStream } from 'node:fs';
|
|
9
|
+
import fsp from 'node:fs/promises';
|
|
10
|
+
import path from 'node:path';
|
|
11
|
+
import archiver from 'archiver';
|
|
12
|
+
import unzipper from 'unzipper';
|
|
13
|
+
import { logger } from '../utils/logger.js';
|
|
14
|
+
// ─── Constants ────────────────────────────────────────────────
|
|
15
|
+
const NEXUS_DIR = '.nexus';
|
|
16
|
+
const ZIP_PREFIX = 'nexus-backup-';
|
|
17
|
+
const ZIP_PATTERN = /^nexus-backup-\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2}\.zip$/;
|
|
18
|
+
/**
|
|
19
|
+
* Directories and files that must be present after a successful unpack.
|
|
20
|
+
*/
|
|
21
|
+
const REQUIRED_AFTER_UNPACK = [
|
|
22
|
+
'.nexus',
|
|
23
|
+
'.nexus/docs',
|
|
24
|
+
'.nexus/ai',
|
|
25
|
+
'.nexus/manifest.json',
|
|
26
|
+
];
|
|
27
|
+
// ─── Pack ─────────────────────────────────────────────────────
|
|
28
|
+
/**
|
|
29
|
+
* `nexus pack [path]`
|
|
30
|
+
*
|
|
31
|
+
* Zips the .nexus/ folder in the target directory into a portable
|
|
32
|
+
* nexus-backup-<timestamp>.zip file placed in the same directory.
|
|
33
|
+
* Safe to run anywhere — does not modify .nexus/ at all.
|
|
34
|
+
*/
|
|
35
|
+
export async function packCommand(targetPath) {
|
|
36
|
+
const cwd = targetPath ? path.resolve(targetPath) : process.cwd();
|
|
37
|
+
const nexusDir = path.join(cwd, NEXUS_DIR);
|
|
38
|
+
// Guard: .nexus/ must exist
|
|
39
|
+
try {
|
|
40
|
+
const stat = await fsp.stat(nexusDir);
|
|
41
|
+
if (!stat.isDirectory()) {
|
|
42
|
+
logger.error(`.nexus is not a directory at: ${cwd}`);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
logger.error(`No .nexus/ folder found at: ${cwd}`);
|
|
48
|
+
logger.info('Run nexus init or nexus adopt first.');
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
// Build output filename with ISO timestamp (colons → dashes for cross-platform)
|
|
52
|
+
const ts = new Date().toISOString().slice(0, 19).replace(/:/g, '-');
|
|
53
|
+
const zipName = `${ZIP_PREFIX}${ts}.zip`;
|
|
54
|
+
const zipPath = path.join(cwd, zipName);
|
|
55
|
+
logger.nexus(`Packing .nexus/ → ${zipName} …`);
|
|
56
|
+
await new Promise((resolve, reject) => {
|
|
57
|
+
const output = createWriteStream(zipPath);
|
|
58
|
+
const archive = archiver('zip', { zlib: { level: 9 } });
|
|
59
|
+
output.on('close', resolve);
|
|
60
|
+
archive.on('error', reject);
|
|
61
|
+
archive.pipe(output);
|
|
62
|
+
// Add the whole .nexus/ directory, preserving internal structure
|
|
63
|
+
archive.directory(nexusDir, NEXUS_DIR);
|
|
64
|
+
void archive.finalize();
|
|
65
|
+
});
|
|
66
|
+
const stats = fs.statSync(zipPath);
|
|
67
|
+
const kb = (stats.size / 1024).toFixed(1);
|
|
68
|
+
logger.newline();
|
|
69
|
+
logger.success(`Packed successfully!`);
|
|
70
|
+
logger.info(` File : ${zipName}`);
|
|
71
|
+
logger.info(` Size : ${kb} KB`);
|
|
72
|
+
logger.info(` Location: ${zipPath}`);
|
|
73
|
+
logger.newline();
|
|
74
|
+
logger.info('To migrate: copy this zip to another project or computer,');
|
|
75
|
+
logger.info('then run: nexus unpack');
|
|
76
|
+
logger.newline();
|
|
77
|
+
}
|
|
78
|
+
// ─── Unpack ───────────────────────────────────────────────────
|
|
79
|
+
/**
|
|
80
|
+
* `nexus unpack [path] [--file <zipfile>]`
|
|
81
|
+
*
|
|
82
|
+
* Finds the most recent nexus-backup-*.zip in the target directory
|
|
83
|
+
* (or a specific file via --file), extracts it, then verifies the
|
|
84
|
+
* restored .nexus/ structure is complete.
|
|
85
|
+
*
|
|
86
|
+
* Safe to run even if .nexus/ already exists — extracted files will
|
|
87
|
+
* overwrite/merge but no existing file is deleted.
|
|
88
|
+
*/
|
|
89
|
+
export async function unpackCommand(targetPath, options = {}) {
|
|
90
|
+
const cwd = targetPath ? path.resolve(targetPath) : process.cwd();
|
|
91
|
+
// Resolve the zip file to use
|
|
92
|
+
let zipPath;
|
|
93
|
+
if (options.file) {
|
|
94
|
+
zipPath = path.isAbsolute(options.file)
|
|
95
|
+
? options.file
|
|
96
|
+
: path.join(cwd, options.file);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
zipPath = await findLatestBackup(cwd);
|
|
100
|
+
}
|
|
101
|
+
// Verify the zip exists
|
|
102
|
+
try {
|
|
103
|
+
await fsp.stat(zipPath);
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
logger.error(`Zip file not found: ${zipPath}`);
|
|
107
|
+
logger.newline();
|
|
108
|
+
logger.info('Looking for a file matching: nexus-backup-YYYY-MM-DDTHH-MM-SS.zip');
|
|
109
|
+
logger.info(`In directory: ${cwd}`);
|
|
110
|
+
logger.newline();
|
|
111
|
+
logger.info('To create one: nexus pack');
|
|
112
|
+
logger.info('To specify one: nexus unpack --file <path-to-zip>');
|
|
113
|
+
process.exit(1);
|
|
114
|
+
}
|
|
115
|
+
const zipName = path.basename(zipPath);
|
|
116
|
+
logger.nexus(`Unpacking ${zipName} → ${cwd} …`);
|
|
117
|
+
// Extract
|
|
118
|
+
await new Promise((resolve, reject) => {
|
|
119
|
+
fs.createReadStream(zipPath)
|
|
120
|
+
.pipe(unzipper.Extract({ path: cwd }))
|
|
121
|
+
.on('close', resolve)
|
|
122
|
+
.on('error', reject);
|
|
123
|
+
});
|
|
124
|
+
logger.success('Extraction complete.');
|
|
125
|
+
logger.newline();
|
|
126
|
+
// Verify
|
|
127
|
+
await verifyUnpack(cwd);
|
|
128
|
+
}
|
|
129
|
+
// ─── Helpers ──────────────────────────────────────────────────
|
|
130
|
+
/**
|
|
131
|
+
* Scan cwd for nexus-backup-*.zip files and return the most recent one.
|
|
132
|
+
*/
|
|
133
|
+
async function findLatestBackup(cwd) {
|
|
134
|
+
let entries;
|
|
135
|
+
try {
|
|
136
|
+
entries = await fsp.readdir(cwd);
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
logger.error(`Cannot read directory: ${cwd}`);
|
|
140
|
+
process.exit(1);
|
|
141
|
+
}
|
|
142
|
+
const zips = entries
|
|
143
|
+
.filter((f) => ZIP_PATTERN.test(f))
|
|
144
|
+
.sort()
|
|
145
|
+
.reverse(); // ISO timestamps sort lexicographically, newest last → reverse for newest first
|
|
146
|
+
if (zips.length === 0) {
|
|
147
|
+
logger.error('No nexus-backup-*.zip file found in this directory.');
|
|
148
|
+
logger.newline();
|
|
149
|
+
logger.info('To create one: nexus pack');
|
|
150
|
+
logger.info('To specify one: nexus unpack --file <path-to-zip>');
|
|
151
|
+
process.exit(1);
|
|
152
|
+
}
|
|
153
|
+
if (zips.length > 1) {
|
|
154
|
+
logger.info(`Found ${zips.length} backup zips — using the most recent:`);
|
|
155
|
+
logger.info(` ${zips[0]}`);
|
|
156
|
+
logger.info(` (others: ${zips.slice(1).join(', ')})`);
|
|
157
|
+
logger.newline();
|
|
158
|
+
}
|
|
159
|
+
return path.join(cwd, zips[0]);
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* After extraction, verify all expected .nexus/ paths exist and report.
|
|
163
|
+
*/
|
|
164
|
+
async function verifyUnpack(cwd) {
|
|
165
|
+
logger.info('Verifying restored structure …');
|
|
166
|
+
logger.newline();
|
|
167
|
+
let allOk = true;
|
|
168
|
+
for (const rel of REQUIRED_AFTER_UNPACK) {
|
|
169
|
+
const full = path.join(cwd, rel);
|
|
170
|
+
try {
|
|
171
|
+
await fsp.stat(full);
|
|
172
|
+
logger.success(` ✔ ${rel}`);
|
|
173
|
+
}
|
|
174
|
+
catch {
|
|
175
|
+
logger.error(` ✖ ${rel} — MISSING`);
|
|
176
|
+
allOk = false;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
// Also check for optional but expected items and report informatively
|
|
180
|
+
const optionals = [
|
|
181
|
+
'.nexus/skills',
|
|
182
|
+
'.nexus/docs/knowledge.md',
|
|
183
|
+
'.nexus/docs/index.md',
|
|
184
|
+
];
|
|
185
|
+
for (const rel of optionals) {
|
|
186
|
+
const full = path.join(cwd, rel);
|
|
187
|
+
try {
|
|
188
|
+
await fsp.stat(full);
|
|
189
|
+
logger.success(` ✔ ${rel}`);
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
logger.warn(` ⚠ ${rel} — not present (optional)`);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
logger.newline();
|
|
196
|
+
if (allOk) {
|
|
197
|
+
logger.success('All required NEXUS files are in place.');
|
|
198
|
+
logger.info('Your AI tools will detect .nexus/ automatically on next use.');
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
logger.warn('Some required files are missing. The archive may be incomplete.');
|
|
202
|
+
logger.info('Run nexus repair to restore any missing files from templates.');
|
|
203
|
+
}
|
|
204
|
+
logger.newline();
|
|
205
|
+
}
|
|
206
|
+
//# sourceMappingURL=pack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pack.js","sourceRoot":"","sources":["../../src/commands/pack.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,GAAG,MAAM,kBAAkB,CAAC;AACnC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,iEAAiE;AAEjE,MAAM,SAAS,GAAG,QAAQ,CAAC;AAC3B,MAAM,UAAU,GAAG,eAAe,CAAC;AACnC,MAAM,WAAW,GAAG,yDAAyD,CAAC;AAE9E;;GAEG;AACH,MAAM,qBAAqB,GAAG;IAC5B,QAAQ;IACR,aAAa;IACb,WAAW;IACX,sBAAsB;CACvB,CAAC;AAEF,iEAAiE;AAEjE;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,UAAmB;IACnD,MAAM,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO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C,CAAC;QACvD,CAAC;IACH,CAAC;IAED,MAAM,CAAC,OAAO,EAAE,CAAC;IAEjB,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,CAAC,OAAO,CAAC,wCAAwC,CAAC,CAAC;QACzD,MAAM,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;IAC9E,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;QAC/E,MAAM,CAAC,IAAI,CAAC,+DAA+D,CAAC,CAAC;IAC/E,CAAC;IAED,MAAM,CAAC,OAAO,EAAE,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NEXUS CLI - Skill Command
|
|
3
|
+
*
|
|
4
|
+
* Provides the `nexus skill` subcommand suite for managing skills in .nexus/skills/.
|
|
5
|
+
*
|
|
6
|
+
* Subcommands:
|
|
7
|
+
* nexus skill new <name> — scaffold a new custom skill
|
|
8
|
+
* nexus skill list — list all installed skills
|
|
9
|
+
* nexus skill install <pkg> — install from registry (community/)
|
|
10
|
+
* nexus skill remove <name> — remove a community skill
|
|
11
|
+
* nexus skill status — check core skills freshness
|
|
12
|
+
*
|
|
13
|
+
* Directory rules:
|
|
14
|
+
* core/ — NEXUS-owned; updated by `nexus upgrade`; NOT manageable via this command
|
|
15
|
+
* custom/ — User-owned; created with `skill new`; NEVER removed by NEXUS
|
|
16
|
+
* community/ — Registry-installed; managed by `skill install` / `skill remove`
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Scaffold a new custom skill interactively.
|
|
20
|
+
* Creates `.nexus/skills/custom/<name>.md` with template content and `status: draft`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function skillNewCommand(name?: string): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* List all skills installed in .nexus/skills/ grouped by directory.
|
|
25
|
+
*/
|
|
26
|
+
export declare function skillListCommand(): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* List all skills available in the @nexus-framework/skills registry,
|
|
29
|
+
* optionally filtered to a single framework.
|
|
30
|
+
*
|
|
31
|
+
* Reads directly from the installed npm package — no network required.
|
|
32
|
+
*/
|
|
33
|
+
export declare function skillRegistryCommand(options?: {
|
|
34
|
+
framework?: string;
|
|
35
|
+
}): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Install skills from the @nexus-framework/skills registry into community/.
|
|
38
|
+
*
|
|
39
|
+
* Currently a stub — will source from npm when @nexus-framework/skills is published.
|
|
40
|
+
* For now, notifies the user of upcoming availability.
|
|
41
|
+
*/
|
|
42
|
+
export declare function skillInstallCommand(pkg?: string): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Remove a community skill from .nexus/skills/community/.
|
|
45
|
+
* Refuses to remove core or custom skills with a clear explanation.
|
|
46
|
+
*/
|
|
47
|
+
export declare function skillRemoveCommand(name?: string): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Check if core skills are present and report any issues.
|
|
50
|
+
* Suggests running `nexus upgrade` if core skills are missing or outdated.
|
|
51
|
+
*/
|
|
52
|
+
export declare function skillStatusCommand(): Promise<void>;
|
|
53
|
+
//# sourceMappingURL=skill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../src/commands/skill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAeH;;;GAGG;AACH,wBAAsB,eAAe,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmGlE;AAMD;;GAEG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAiDtD;AAMD;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CA8D9F;AAMD;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA2BrE;AAMD;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqCrE;AAMD;;;GAGG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAsDxD"}
|