@series-inc/stowkit-cli 0.1.23 → 0.1.25

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/dist/cli.js CHANGED
@@ -24,7 +24,7 @@ function checkForUpdate() {
24
24
  const latest = data.version;
25
25
  if (latest && latest !== localVersion) {
26
26
  console.log(`\n Update available: ${localVersion} → ${latest}`);
27
- console.log(` Run: npm install -g @series-inc/stowkit-cli\n`);
27
+ console.log(` Run: stowkit update\n`);
28
28
  }
29
29
  })
30
30
  .catch(() => { clearTimeout(timeout); });
@@ -38,6 +38,7 @@ function printUsage() {
38
38
  console.log(`
39
39
  Usage:
40
40
  stowkit init [dir] Initialize a StowKit project
41
+ stowkit init --update [dir] Update AI skill files to match installed CLI version
41
42
  stowkit build [dir] Full build: scan + process + pack
42
43
  stowkit scan [dir] Detect new assets, generate .stowmeta defaults
43
44
  stowkit process [dir] Compress assets (respects cache)
@@ -48,6 +49,8 @@ Usage:
48
49
  stowkit move <path> <folder> Move an asset to a different folder
49
50
  stowkit delete <path> Delete an asset and its sidecar files
50
51
  stowkit set-id <path> <id> Change an asset's stringId
52
+ stowkit update Update CLI to latest version and refresh skill files
53
+ stowkit version Show installed version
51
54
  stowkit packer [dir] Open the packer GUI
52
55
  stowkit editor [dir] Open the level editor
53
56
  stowkit serve [dir] Start API server only (no GUI)
@@ -75,6 +78,10 @@ function resolveAppDir(packageName, monorepoFolder) {
75
78
  }
76
79
  return null;
77
80
  }
81
+ function getVersion() {
82
+ const pkg = JSON.parse(fs.readFileSync(path.resolve(thisDir, '../package.json'), 'utf-8'));
83
+ return pkg.version;
84
+ }
78
85
  function openBrowser(url) {
79
86
  import('node:child_process').then(({ exec }) => {
80
87
  const cmd = process.platform === 'win32' ? 'start' : process.platform === 'darwin' ? 'open' : 'xdg-open';
@@ -96,7 +103,34 @@ async function main() {
96
103
  try {
97
104
  switch (command) {
98
105
  case 'init':
99
- await initProject(projectDir);
106
+ await initProject(projectDir, { update: args.includes('--update') });
107
+ break;
108
+ case 'update': {
109
+ const currentVersion = getVersion();
110
+ console.log(`Current version: ${currentVersion}`);
111
+ console.log('Checking for updates...');
112
+ const res = await fetch('https://registry.npmjs.org/@series-inc/stowkit-cli/latest');
113
+ const data = await res.json();
114
+ const latest = data.version;
115
+ if (latest === currentVersion) {
116
+ console.log('Already on the latest version.');
117
+ }
118
+ else {
119
+ console.log(`Updating: ${currentVersion} → ${latest}`);
120
+ const { execSync } = await import('node:child_process');
121
+ execSync('npm install -g @series-inc/stowkit-cli@latest', { stdio: 'inherit' });
122
+ console.log(`Updated to ${latest}.`);
123
+ }
124
+ // Refresh skill files if in a StowKit project
125
+ const configExists = existsSync(path.resolve(projectDir, '.felicityproject'));
126
+ if (configExists) {
127
+ await initProject(projectDir, { update: true });
128
+ }
129
+ break;
130
+ }
131
+ case 'version':
132
+ case '--version':
133
+ console.log(getVersion());
100
134
  break;
101
135
  case 'build':
102
136
  await fullBuild(projectDir, opts);
package/dist/init.d.ts CHANGED
@@ -1 +1,4 @@
1
- export declare function initProject(projectDir: string): Promise<void>;
1
+ export interface InitOptions {
2
+ update?: boolean;
3
+ }
4
+ export declare function initProject(projectDir: string, opts?: InitOptions): Promise<void>;
package/dist/init.js CHANGED
@@ -1,10 +1,26 @@
1
1
  import * as fs from 'node:fs/promises';
2
2
  import * as path from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
- export async function initProject(projectDir) {
4
+ export async function initProject(projectDir, opts) {
5
5
  const absDir = path.resolve(projectDir);
6
- // Check if already initialized
7
6
  const configPath = path.join(absDir, '.felicityproject');
7
+ const update = opts?.update ?? false;
8
+ if (update) {
9
+ // --update: only refresh AI skill files, project must already exist
10
+ try {
11
+ await fs.access(configPath);
12
+ }
13
+ catch {
14
+ console.error('No StowKit project found. Run `stowkit init` first.');
15
+ process.exit(1);
16
+ }
17
+ await copySkillFiles(absDir);
18
+ console.log('Updated AI skill files:');
19
+ console.log(' .claude/skills/stowkit/SKILL.md');
20
+ console.log(' .cursor/rules/stowkit.mdc');
21
+ return;
22
+ }
23
+ // Check if already initialized
8
24
  try {
9
25
  await fs.access(configPath);
10
26
  console.log(`Project already initialized at ${absDir}`);
@@ -49,7 +65,18 @@ export async function initProject(projectDir) {
49
65
  catch {
50
66
  await fs.writeFile(gitignorePath, stowkitIgnores + '\n');
51
67
  }
52
- // Copy AI skill/rule files (CLI skill only — loader skills are installed locally with their packages)
68
+ // Copy AI skill/rule files
69
+ await copySkillFiles(absDir);
70
+ console.log(`Initialized StowKit project at ${absDir}`);
71
+ console.log(` Source art dir: ${srcArtDir}/`);
72
+ console.log(` Output dir: public/cdn-assets/`);
73
+ console.log(` Config: .felicityproject`);
74
+ console.log(` AI skills: .claude/skills/stowkit/SKILL.md, .cursor/rules/stowkit.mdc`);
75
+ console.log('');
76
+ console.log('Drop your assets (PNG, JPG, FBX, WAV, etc.) into assets/');
77
+ console.log('Then run: stowkit build');
78
+ }
79
+ async function copySkillFiles(absDir) {
53
80
  const thisDir = path.dirname(fileURLToPath(import.meta.url));
54
81
  const skillSrc = path.resolve(thisDir, '../skill.md');
55
82
  try {
@@ -64,12 +91,4 @@ export async function initProject(projectDir) {
64
91
  catch {
65
92
  // Skill file not found in package — skip silently
66
93
  }
67
- console.log(`Initialized StowKit project at ${absDir}`);
68
- console.log(` Source art dir: ${srcArtDir}/`);
69
- console.log(` Output dir: public/cdn-assets/`);
70
- console.log(` Config: .felicityproject`);
71
- console.log(` AI skills: .claude/skills/stowkit/SKILL.md, .cursor/rules/stowkit.mdc`);
72
- console.log('');
73
- console.log('Drop your assets (PNG, JPG, FBX, WAV, etc.) into assets/');
74
- console.log('Then run: npx stowkit build');
75
94
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@series-inc/stowkit-cli",
3
- "version": "0.1.23",
3
+ "version": "0.1.25",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "stowkit": "./dist/cli.js"
@@ -17,7 +17,7 @@
17
17
  "dev": "tsc --watch"
18
18
  },
19
19
  "dependencies": {
20
- "@series-inc/stowkit-packer-gui": "^0.1.11",
20
+ "@series-inc/stowkit-packer-gui": "^0.1.12",
21
21
  "@series-inc/stowkit-editor": "^0.1.2",
22
22
  "draco3d": "^1.5.7",
23
23
  "fbx-parser": "^2.1.3",
package/skill.md CHANGED
@@ -37,6 +37,9 @@ A StowKit project has a `.felicityproject` JSON file at its root:
37
37
 
38
38
  ```bash
39
39
  stowkit init [dir] # Scaffold a new project (creates .felicityproject, assets/, public/cdn-assets/)
40
+ stowkit init --update [dir] # Update AI skill files to match installed CLI version
41
+ stowkit update # Update CLI to latest version and refresh skill files
42
+ stowkit version # Show installed version
40
43
  stowkit build [dir] # Full build: scan + process + pack
41
44
  stowkit scan [dir] # Detect new assets and generate .stowmeta defaults
42
45
  stowkit process [dir] # Compress assets (respects cache)
@@ -505,6 +508,20 @@ PerfLogger.enable();
505
508
  PerfLogger.disable();
506
509
  ```
507
510
 
511
+ ## Updating the CLI and This Skill File
512
+
513
+ This skill file is bundled with the `@series-inc/stowkit-cli` package. To update the CLI to the latest version and refresh this file in one step:
514
+
515
+ ```bash
516
+ stowkit update
517
+ ```
518
+
519
+ This updates the global CLI install, then overwrites `.claude/skills/stowkit/SKILL.md` and `.cursor/rules/stowkit.mdc` with the version shipped in the new CLI. It does not touch the project config, directories, or any asset files.
520
+
521
+ To refresh skill files without updating the CLI: `stowkit init --update`
522
+
523
+ **When to run this:** If you notice this skill file is missing documentation for commands that exist in `stowkit --help`, or if the user asks you to update StowKit.
524
+
508
525
  ## Common Tasks for AI Agents
509
526
 
510
527
  ### Adding a GLB model (recommended 3D workflow)