@nitrostack/cli 1.0.12 → 1.0.14

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 (42) hide show
  1. package/dist/commands/cursor.d.ts +11 -0
  2. package/dist/commands/cursor.d.ts.map +1 -0
  3. package/dist/commands/cursor.js +238 -0
  4. package/dist/commands/init.d.ts +1 -0
  5. package/dist/commands/init.d.ts.map +1 -1
  6. package/dist/commands/init.js +82 -9
  7. package/dist/commands/upgrade.d.ts +12 -0
  8. package/dist/commands/upgrade.d.ts.map +1 -1
  9. package/dist/commands/upgrade.js +210 -106
  10. package/dist/index.d.ts +1 -0
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +14 -0
  13. package/dist/skills/clone.d.ts +28 -0
  14. package/dist/skills/clone.d.ts.map +1 -0
  15. package/dist/skills/clone.js +60 -0
  16. package/dist/skills/detect-agents.d.ts +8 -0
  17. package/dist/skills/detect-agents.d.ts.map +1 -0
  18. package/dist/skills/detect-agents.js +129 -0
  19. package/dist/skills/discover.d.ts +12 -0
  20. package/dist/skills/discover.d.ts.map +1 -0
  21. package/dist/skills/discover.js +45 -0
  22. package/dist/skills/index.d.ts +21 -0
  23. package/dist/skills/index.d.ts.map +1 -0
  24. package/dist/skills/index.js +97 -0
  25. package/dist/skills/installer.d.ts +21 -0
  26. package/dist/skills/installer.d.ts.map +1 -0
  27. package/dist/skills/installer.js +48 -0
  28. package/dist/skills/types.d.ts +39 -0
  29. package/dist/skills/types.d.ts.map +1 -0
  30. package/dist/skills/types.js +1 -0
  31. package/dist/skills/ui.d.ts +55 -0
  32. package/dist/skills/ui.d.ts.map +1 -0
  33. package/dist/skills/ui.js +102 -0
  34. package/package.json +3 -3
  35. package/templates/typescript-oauth/.env.example +71 -14
  36. package/templates/typescript-oauth/src/app.module.ts +7 -0
  37. package/templates/typescript-oauth/src/guards/oauth.guard.ts +19 -0
  38. package/templates/typescript-oauth/src/index.ts +9 -11
  39. package/templates/typescript-oauth/src/modules/flights/flights.prompts.ts +19 -1
  40. package/templates/typescript-oauth/src/services/duffel.service.ts +4 -2
  41. package/templates/typescript-pizzaz/.env.example +10 -0
  42. package/templates/typescript-starter/.env.example +10 -0
@@ -0,0 +1,129 @@
1
+ import os from 'os';
2
+ import path from 'path';
3
+ import { exec } from 'child_process';
4
+ import { promisify } from 'util';
5
+ import fs from 'fs-extra';
6
+ const execAsync = promisify(exec);
7
+ /**
8
+ * Returns true when the given CLI command is available in the system PATH.
9
+ * Works cross-platform: uses `where` on Windows, `which` elsewhere.
10
+ */
11
+ async function commandExists(cmd) {
12
+ try {
13
+ const whichCmd = process.platform === 'win32' ? `where ${cmd}` : `which ${cmd}`;
14
+ await execAsync(whichCmd);
15
+ return true;
16
+ }
17
+ catch {
18
+ return false;
19
+ }
20
+ }
21
+ /**
22
+ * Returns true when a directory exists at `dirPath`.
23
+ */
24
+ function dirExists(dirPath) {
25
+ try {
26
+ return fs.existsSync(dirPath) && fs.statSync(dirPath).isDirectory();
27
+ }
28
+ catch {
29
+ return false;
30
+ }
31
+ }
32
+ const HOME = os.homedir();
33
+ /**
34
+ * Helper to build an AgentDescriptor from a simpler specification,
35
+ * reducing duplicate boilerplate for detect() and getSkillsDir().
36
+ */
37
+ function createAgentDescriptor(spec) {
38
+ return {
39
+ id: spec.id,
40
+ name: spec.name,
41
+ displayPath: `~/${spec.folderName}/skills`,
42
+ async detect() {
43
+ if (spec.customDetect) {
44
+ return spec.customDetect();
45
+ }
46
+ const hasCmd = spec.cmd ? await commandExists(spec.cmd) : false;
47
+ return hasCmd || dirExists(path.join(HOME, spec.folderName));
48
+ },
49
+ getSkillsDir(scope = 'global', projectDir = process.cwd()) {
50
+ if (spec.getSkillsDir) {
51
+ return spec.getSkillsDir(scope, projectDir);
52
+ }
53
+ const base = scope === 'project' ? projectDir : HOME;
54
+ return path.join(base, spec.folderName, 'skills');
55
+ },
56
+ };
57
+ }
58
+ export const AGENTS = [
59
+ // ── Original 5 agents (must keep indices 0-4 for tests) ───────────────────
60
+ createAgentDescriptor({
61
+ id: 'cursor',
62
+ name: 'Cursor Agent',
63
+ folderName: '.cursor',
64
+ }),
65
+ createAgentDescriptor({
66
+ id: 'codex',
67
+ name: 'Codex',
68
+ folderName: '.codex',
69
+ cmd: 'codex',
70
+ }),
71
+ createAgentDescriptor({
72
+ id: 'claude-code',
73
+ name: 'Claude Code',
74
+ folderName: '.claude',
75
+ cmd: 'claude',
76
+ }),
77
+ createAgentDescriptor({
78
+ id: 'gemini-cli',
79
+ name: 'Gemini CLI',
80
+ folderName: '.gemini',
81
+ cmd: 'gemini',
82
+ }),
83
+ createAgentDescriptor({
84
+ id: 'antigravity',
85
+ name: 'Google Antigravity',
86
+ folderName: '.antigravity',
87
+ cmd: 'agy',
88
+ }),
89
+ // ── Additional coding agents (limited to GitHub Copilot and OpenCode) ──────
90
+ createAgentDescriptor({
91
+ id: 'github-copilot',
92
+ name: 'GitHub Copilot Agent',
93
+ folderName: '.copilot',
94
+ }),
95
+ createAgentDescriptor({
96
+ id: 'opencode',
97
+ name: 'OpenCode Agent',
98
+ // OpenCode stores its config at ~/.config/opencode
99
+ folderName: '.config/opencode',
100
+ cmd: 'opencode',
101
+ getSkillsDir(scope = 'global', projectDir = process.cwd()) {
102
+ if (scope === 'project') {
103
+ return path.join(projectDir, '.opencode', 'skills');
104
+ }
105
+ return path.join(HOME, '.config', 'opencode', 'skills');
106
+ },
107
+ }),
108
+ createAgentDescriptor({
109
+ id: 'agents',
110
+ name: 'Workspace Agents',
111
+ folderName: '.agents',
112
+ }),
113
+ ];
114
+ /**
115
+ * Runs all agent detectors in parallel and returns only the agents that are
116
+ * detected on the current machine.
117
+ */
118
+ export async function detectAgents() {
119
+ const results = await Promise.all(AGENTS.map(async (agent) => {
120
+ try {
121
+ const found = await agent.detect();
122
+ return found ? agent : null;
123
+ }
124
+ catch {
125
+ return null;
126
+ }
127
+ }));
128
+ return results.filter((a) => a !== null);
129
+ }
@@ -0,0 +1,12 @@
1
+ import type { Skill } from './types.js';
2
+ /**
3
+ * Discovers all skills inside the cloned repository.
4
+ *
5
+ * A "skill" is any immediate subdirectory of `<cloneDir>/skills/` whose name
6
+ * does not start with a dot. Regular files and hidden directories are ignored.
7
+ *
8
+ * @param cloneDir - Absolute path to the root of the cloned repository.
9
+ * @returns Array of discovered skills, sorted alphabetically by name.
10
+ */
11
+ export declare function discoverSkills(cloneDir: string): Promise<Skill[]>;
12
+ //# sourceMappingURL=discover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../src/skills/discover.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAgBxC;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CAwBvE"}
@@ -0,0 +1,45 @@
1
+ import path from 'path';
2
+ import fs from 'fs-extra';
3
+ /**
4
+ * The subdirectory inside the cloned repository that contains individual skill
5
+ * folders. Repository layout:
6
+ *
7
+ * <clone>/
8
+ * skills/
9
+ * remotion/ ← one skill per subdirectory
10
+ * mcp-best-practices/
11
+ * …
12
+ * src/
13
+ * README.md
14
+ */
15
+ const SKILLS_SUBDIR = 'skills';
16
+ /**
17
+ * Discovers all skills inside the cloned repository.
18
+ *
19
+ * A "skill" is any immediate subdirectory of `<cloneDir>/skills/` whose name
20
+ * does not start with a dot. Regular files and hidden directories are ignored.
21
+ *
22
+ * @param cloneDir - Absolute path to the root of the cloned repository.
23
+ * @returns Array of discovered skills, sorted alphabetically by name.
24
+ */
25
+ export async function discoverSkills(cloneDir) {
26
+ const skillsRoot = path.join(cloneDir, SKILLS_SUBDIR);
27
+ if (!(await fs.pathExists(skillsRoot))) {
28
+ return [];
29
+ }
30
+ const entries = await fs.readdir(skillsRoot, { withFileTypes: true });
31
+ const skills = [];
32
+ for (const entry of entries) {
33
+ // Skip hidden entries (e.g. .DS_Store, .git)
34
+ if (entry.name.startsWith('.'))
35
+ continue;
36
+ // Only directories are treated as skills
37
+ if (!entry.isDirectory())
38
+ continue;
39
+ skills.push({
40
+ name: entry.name,
41
+ sourcePath: path.join(skillsRoot, entry.name),
42
+ });
43
+ }
44
+ return skills.sort((a, b) => a.name.localeCompare(b.name));
45
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Runs the full agent-skills installation flow.
3
+ *
4
+ * Steps:
5
+ * 1. Clone the skills repository into a temporary directory.
6
+ * 2. Discover all skills in the `skills/` subdirectory.
7
+ * 3. Detect supported AI agents installed on the machine.
8
+ * 4. Prompt the user to select which agents to install skills into.
9
+ * 5. Install the skills and report results.
10
+ * 6. Clean up the temporary clone.
11
+ *
12
+ * Graceful fallbacks:
13
+ * - Git unavailable or clone fails → print warning and return.
14
+ * - No agents detected → print warning and return.
15
+ * - User selects no agents → return silently.
16
+ * - Individual skill copy fails → reported per-agent, does not abort the run.
17
+ *
18
+ * @param force - When true, overwrite existing skill files.
19
+ */
20
+ export declare function runSkillsFlow(force?: boolean, projectDir?: string): Promise<void>;
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/skills/index.ts"],"names":[],"mappings":"AAiBA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,aAAa,CAAC,KAAK,GAAE,OAAe,EAAE,UAAU,GAAE,MAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4E7G"}
@@ -0,0 +1,97 @@
1
+ import path from 'path';
2
+ import fs from 'fs-extra';
3
+ import chalk from 'chalk';
4
+ import { cloneSkillsRepo, SkillsCloneError } from './clone.js';
5
+ import { discoverSkills } from './discover.js';
6
+ import { AGENTS } from './detect-agents.js';
7
+ import { installSkills } from './installer.js';
8
+ import { printSkillsHeader, printCloned, printSkillList, printInstalling, printSuccess, printCloneError, } from './ui.js';
9
+ /**
10
+ * Runs the full agent-skills installation flow.
11
+ *
12
+ * Steps:
13
+ * 1. Clone the skills repository into a temporary directory.
14
+ * 2. Discover all skills in the `skills/` subdirectory.
15
+ * 3. Detect supported AI agents installed on the machine.
16
+ * 4. Prompt the user to select which agents to install skills into.
17
+ * 5. Install the skills and report results.
18
+ * 6. Clean up the temporary clone.
19
+ *
20
+ * Graceful fallbacks:
21
+ * - Git unavailable or clone fails → print warning and return.
22
+ * - No agents detected → print warning and return.
23
+ * - User selects no agents → return silently.
24
+ * - Individual skill copy fails → reported per-agent, does not abort the run.
25
+ *
26
+ * @param force - When true, overwrite existing skill files.
27
+ */
28
+ export async function runSkillsFlow(force = false, projectDir = process.cwd()) {
29
+ printSkillsHeader();
30
+ // ── Step 1: Clone ──────────────────────────────────────────────────────────
31
+ let tempDir;
32
+ try {
33
+ tempDir = await cloneSkillsRepo();
34
+ }
35
+ catch (err) {
36
+ const message = err instanceof SkillsCloneError
37
+ ? err.message
38
+ : err instanceof Error
39
+ ? err.message
40
+ : String(err);
41
+ printCloneError(message);
42
+ return;
43
+ }
44
+ try {
45
+ printCloned();
46
+ // ── Step 2: Discover skills ──────────────────────────────────────────────
47
+ const skills = await discoverSkills(tempDir);
48
+ if (skills.length === 0) {
49
+ console.log(chalk.dim(' No skills found in the repository.\n'));
50
+ return;
51
+ }
52
+ printSkillList(skills);
53
+ // ── Step 3: Install Project-Level Skills ─────────────────────────────────
54
+ // Installs the skills for all 6 agents by default at project scope
55
+ const results = await installSkills(AGENTS, skills, force, 'project', projectDir);
56
+ printInstalling(results);
57
+ // Read the skills version from the cloned repository's package.json
58
+ let skillsVersion = '1.0.0';
59
+ const skillsPackageJsonPath = path.join(tempDir, 'package.json');
60
+ if (await fs.pathExists(skillsPackageJsonPath)) {
61
+ try {
62
+ const pkgJson = await fs.readJSON(skillsPackageJsonPath);
63
+ if (pkgJson.version) {
64
+ skillsVersion = pkgJson.version;
65
+ }
66
+ }
67
+ catch {
68
+ // Ignore read errors
69
+ }
70
+ }
71
+ // Write skills version to the project's package.json
72
+ const projectPackageJsonPath = path.join(projectDir, 'package.json');
73
+ if (await fs.pathExists(projectPackageJsonPath)) {
74
+ try {
75
+ const projectPkgJson = await fs.readJSON(projectPackageJsonPath);
76
+ if (!projectPkgJson.nitrostack) {
77
+ projectPkgJson.nitrostack = {};
78
+ }
79
+ projectPkgJson.nitrostack.skillsVersion = skillsVersion;
80
+ await fs.writeJSON(projectPackageJsonPath, projectPkgJson, { spaces: 2 });
81
+ }
82
+ catch {
83
+ // Ignore write errors
84
+ }
85
+ }
86
+ printSuccess();
87
+ }
88
+ finally {
89
+ // ── Cleanup: always remove the temp clone ────────────────────────────────
90
+ try {
91
+ await fs.remove(tempDir);
92
+ }
93
+ catch {
94
+ // best-effort; temp files will be cleaned by the OS
95
+ }
96
+ }
97
+ }
@@ -0,0 +1,21 @@
1
+ import type { AgentDescriptor, InstallResult, Skill } from './types.js';
2
+ /**
3
+ * Installs all discovered skills into the skills directory of a single agent.
4
+ *
5
+ * - Creates the target directory if it does not exist.
6
+ * - Skips individual skills whose destination directory already exists,
7
+ * unless `force` is true.
8
+ * - Preserves the full folder structure of each skill.
9
+ *
10
+ * @param agent - The agent to install into.
11
+ * @param skills - All skills discovered from the repository.
12
+ * @param force - When true, overwrite existing skill directories.
13
+ * @returns InstallResult describing what was installed vs skipped.
14
+ */
15
+ export declare function installSkillsForAgent(agent: AgentDescriptor, skills: Skill[], force: boolean, scope?: 'project' | 'global', projectDir?: string): Promise<InstallResult>;
16
+ /**
17
+ * Installs skills into every selected agent sequentially.
18
+ * Sequential (rather than parallel) installation gives cleaner CLI progress output.
19
+ */
20
+ export declare function installSkills(agents: AgentDescriptor[], skills: Skill[], force: boolean, scope?: 'project' | 'global', projectDir?: string): Promise<InstallResult[]>;
21
+ //# sourceMappingURL=installer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../../src/skills/installer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExE;;;;;;;;;;;;GAYG;AACH,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,KAAK,EAAE,EACf,KAAK,EAAE,OAAO,EACd,KAAK,GAAE,SAAS,GAAG,QAAmB,EACtC,UAAU,GAAE,MAAsB,GACjC,OAAO,CAAC,aAAa,CAAC,CAwBxB;AAED;;;GAGG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,eAAe,EAAE,EACzB,MAAM,EAAE,KAAK,EAAE,EACf,KAAK,EAAE,OAAO,EACd,KAAK,GAAE,SAAS,GAAG,QAAmB,EACtC,UAAU,GAAE,MAAsB,GACjC,OAAO,CAAC,aAAa,EAAE,CAAC,CAS1B"}
@@ -0,0 +1,48 @@
1
+ import path from 'path';
2
+ import fs from 'fs-extra';
3
+ /**
4
+ * Installs all discovered skills into the skills directory of a single agent.
5
+ *
6
+ * - Creates the target directory if it does not exist.
7
+ * - Skips individual skills whose destination directory already exists,
8
+ * unless `force` is true.
9
+ * - Preserves the full folder structure of each skill.
10
+ *
11
+ * @param agent - The agent to install into.
12
+ * @param skills - All skills discovered from the repository.
13
+ * @param force - When true, overwrite existing skill directories.
14
+ * @returns InstallResult describing what was installed vs skipped.
15
+ */
16
+ export async function installSkillsForAgent(agent, skills, force, scope = 'global', projectDir = process.cwd()) {
17
+ const result = { agent, installed: [], skipped: [] };
18
+ try {
19
+ const skillsDir = agent.getSkillsDir(scope, projectDir);
20
+ await fs.mkdirp(skillsDir);
21
+ for (const skill of skills) {
22
+ const dest = path.join(skillsDir, skill.name);
23
+ const alreadyExists = await fs.pathExists(dest);
24
+ if (alreadyExists && !force) {
25
+ result.skipped.push(skill.name);
26
+ continue;
27
+ }
28
+ await fs.copy(skill.sourcePath, dest, { overwrite: force });
29
+ result.installed.push(skill.name);
30
+ }
31
+ }
32
+ catch (err) {
33
+ result.error = err instanceof Error ? err.message : String(err);
34
+ }
35
+ return result;
36
+ }
37
+ /**
38
+ * Installs skills into every selected agent sequentially.
39
+ * Sequential (rather than parallel) installation gives cleaner CLI progress output.
40
+ */
41
+ export async function installSkills(agents, skills, force, scope = 'global', projectDir = process.cwd()) {
42
+ const results = [];
43
+ for (const agent of agents) {
44
+ const result = await installSkillsForAgent(agent, skills, force, scope, projectDir);
45
+ results.push(result);
46
+ }
47
+ return results;
48
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * A single skill discovered from the skills repository.
3
+ * Each skill maps to one subdirectory under `skills/` in the cloned repo.
4
+ */
5
+ export interface Skill {
6
+ /** Directory name — used as the skill identifier and display name */
7
+ name: string;
8
+ /** Absolute path to the skill directory inside the temporary clone */
9
+ sourcePath: string;
10
+ }
11
+ /**
12
+ * Describes a supported AI coding agent.
13
+ * Add new agents by appending entries to the AGENTS registry in detect-agents.ts.
14
+ */
15
+ export interface AgentDescriptor {
16
+ /** Machine-readable identifier (kebab-case) */
17
+ id: string;
18
+ /** Human-readable display name shown in the CLI */
19
+ name: string;
20
+ /** Short path hint shown next to the agent name in the selection list */
21
+ displayPath: string;
22
+ /** Returns true when the agent appears to be installed on this machine */
23
+ detect(): Promise<boolean>;
24
+ /** Returns the absolute path of the directory where skills should be installed */
25
+ getSkillsDir(scope?: 'project' | 'global', projectDir?: string): string;
26
+ }
27
+ /**
28
+ * Result of installing skills for one agent.
29
+ */
30
+ export interface InstallResult {
31
+ agent: AgentDescriptor;
32
+ /** Skill names that were successfully copied */
33
+ installed: string[];
34
+ /** Skill names that were skipped because the destination already existed */
35
+ skipped: string[];
36
+ /** Non-fatal error message, if any */
37
+ error?: string;
38
+ }
39
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/skills/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,+CAA+C;IAC/C,EAAE,EAAE,MAAM,CAAC;IACX,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3B,kFAAkF;IAClF,YAAY,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,QAAQ,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzE;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,eAAe,CAAC;IACvB,gDAAgD;IAChD,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,4EAA4E;IAC5E,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,55 @@
1
+ import type { InstallResult, Skill } from './types.js';
2
+ /**
3
+ * Prints the skills section header:
4
+ *
5
+ * skills
6
+ *
7
+ * ◇ Source: https://github.com/nitrocloudofficial/skills.git
8
+ * ◇ Repository cloned
9
+ */
10
+ export declare function printSkillsHeader(): void;
11
+ /**
12
+ * Prints the "Repository cloned" confirmation line.
13
+ * Called after cloneSkillsRepo() succeeds.
14
+ */
15
+ export declare function printCloned(): void;
16
+ /**
17
+ * Prints the discovered skill list:
18
+ *
19
+ * ◇ Found 4 skills
20
+ *
21
+ * • nitrostack-sdk
22
+ * • mcp-best-practices
23
+ * …
24
+ */
25
+ export declare function printSkillList(skills: Skill[]): void;
26
+ /**
27
+ * Prints the detected-agent count line:
28
+ *
29
+ * ◇ Detected 3 agents
30
+ */
31
+ export declare function printDetectedAgents(count: number): void;
32
+ /**
33
+ * Prints a warning when no agents are detected so the user knows why the
34
+ * flow is being skipped rather than seeing a silent no-op.
35
+ */
36
+ export declare function printNoAgentsWarning(): void;
37
+ /**
38
+ * Prints the per-agent installation results:
39
+ *
40
+ * Installing...
41
+ *
42
+ * ✔ Cursor (3 installed)
43
+ * ✔ Claude Code (2 installed, 1 skipped)
44
+ * ⚠ Gemini CLI error: …
45
+ */
46
+ export declare function printInstalling(results: InstallResult[]): void;
47
+ /**
48
+ * Prints the final success message.
49
+ */
50
+ export declare function printSuccess(): void;
51
+ /**
52
+ * Prints a warning when git is not available or the clone fails.
53
+ */
54
+ export declare function printCloneError(message: string): void;
55
+ //# sourceMappingURL=ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/skills/ui.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAYvD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAGxC;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAQpD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAEvD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAK3C;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,IAAI,CAuB9D;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAKrD"}
@@ -0,0 +1,102 @@
1
+ import chalk from 'chalk';
2
+ import { brand } from '../ui/branding.js';
3
+ import { SKILLS_REPO_URL } from './clone.js';
4
+ // ── Private helpers ──────────────────────────────────────────────────────────
5
+ /** Diamond prefix used for info lines — matches Remotion create-video style */
6
+ const diamond = () => chalk.dim('◇');
7
+ /** Bullet used for list items */
8
+ const bullet = () => brand.sky('•');
9
+ // ── Public output functions ──────────────────────────────────────────────────
10
+ /**
11
+ * Prints the skills section header:
12
+ *
13
+ * skills
14
+ *
15
+ * ◇ Source: https://github.com/nitrocloudofficial/skills.git
16
+ * ◇ Repository cloned
17
+ */
18
+ export function printSkillsHeader() {
19
+ console.log('\n' + chalk.white.bold(' skills') + '\n');
20
+ console.log(` ${diamond()} ${chalk.dim('Source:')} ${brand.sky(SKILLS_REPO_URL)}`);
21
+ }
22
+ /**
23
+ * Prints the "Repository cloned" confirmation line.
24
+ * Called after cloneSkillsRepo() succeeds.
25
+ */
26
+ export function printCloned() {
27
+ console.log(` ${diamond()} ${chalk.dim('Repository cloned')}\n`);
28
+ }
29
+ /**
30
+ * Prints the discovered skill list:
31
+ *
32
+ * ◇ Found 4 skills
33
+ *
34
+ * • nitrostack-sdk
35
+ * • mcp-best-practices
36
+ * …
37
+ */
38
+ export function printSkillList(skills) {
39
+ console.log(` ${diamond()} ${chalk.white(`Found ${skills.length} skill${skills.length === 1 ? '' : 's'}`)}\n`);
40
+ for (const skill of skills) {
41
+ console.log(` ${bullet()} ${chalk.white(skill.name)}`);
42
+ }
43
+ console.log('');
44
+ }
45
+ /**
46
+ * Prints the detected-agent count line:
47
+ *
48
+ * ◇ Detected 3 agents
49
+ */
50
+ export function printDetectedAgents(count) {
51
+ console.log(` ${diamond()} ${chalk.white(`Detected ${count} agent${count === 1 ? '' : 's'}`)}\n`);
52
+ }
53
+ /**
54
+ * Prints a warning when no agents are detected so the user knows why the
55
+ * flow is being skipped rather than seeing a silent no-op.
56
+ */
57
+ export function printNoAgentsWarning() {
58
+ console.log(` ${chalk.hex('#F59E0B')('⚠')} ${chalk.dim('No supported AI agents detected on this machine.')}\n` +
59
+ ` ${chalk.dim('Install Cursor, Claude Code, Gemini CLI, or Codex and re-run to add skills.')}\n`);
60
+ }
61
+ /**
62
+ * Prints the per-agent installation results:
63
+ *
64
+ * Installing...
65
+ *
66
+ * ✔ Cursor (3 installed)
67
+ * ✔ Claude Code (2 installed, 1 skipped)
68
+ * ⚠ Gemini CLI error: …
69
+ */
70
+ export function printInstalling(results) {
71
+ console.log(`\n ${chalk.white.bold('Installing...')}\n`);
72
+ for (const result of results) {
73
+ if (result.error) {
74
+ const label = chalk.hex('#F59E0B')('⚠');
75
+ console.log(` ${label} ${chalk.white(result.agent.name)} ${chalk.dim('error: ' + result.error)}`);
76
+ continue;
77
+ }
78
+ const label = brand.mint('✔');
79
+ const parts = [];
80
+ if (result.installed.length > 0) {
81
+ parts.push(`${result.installed.length} installed`);
82
+ }
83
+ if (result.skipped.length > 0) {
84
+ parts.push(`${result.skipped.length} skipped`);
85
+ }
86
+ const detail = parts.length > 0 ? chalk.dim(` (${parts.join(', ')})`) : '';
87
+ console.log(` ${label} ${chalk.white(result.agent.name)}${detail}`);
88
+ }
89
+ }
90
+ /**
91
+ * Prints the final success message.
92
+ */
93
+ export function printSuccess() {
94
+ console.log('\n ' + chalk.white('✨ NitroStack agent skills installed successfully.') + '\n');
95
+ }
96
+ /**
97
+ * Prints a warning when git is not available or the clone fails.
98
+ */
99
+ export function printCloneError(message) {
100
+ console.log(`\n ${chalk.hex('#F59E0B')('⚠')} ${chalk.dim('Agent skills skipped:')}\n` +
101
+ ` ${chalk.dim(message)}\n`);
102
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nitrostack/cli",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "CLI for NitroStack - Create and manage MCP server projects",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -11,9 +11,9 @@
11
11
  },
12
12
  "exports": {
13
13
  ".": {
14
+ "types": "./dist/index.d.ts",
14
15
  "import": "./dist/index.js",
15
- "require": "./dist/index.js",
16
- "types": "./dist/index.d.ts"
16
+ "require": "./dist/index.js"
17
17
  }
18
18
  },
19
19
  "files": [