@series-inc/stowkit-cli 0.1.24 → 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 +34 -1
- package/package.json +1 -1
- package/skill.md +9 -5
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:
|
|
27
|
+
console.log(` Run: stowkit update\n`);
|
|
28
28
|
}
|
|
29
29
|
})
|
|
30
30
|
.catch(() => { clearTimeout(timeout); });
|
|
@@ -49,6 +49,8 @@ Usage:
|
|
|
49
49
|
stowkit move <path> <folder> Move an asset to a different folder
|
|
50
50
|
stowkit delete <path> Delete an asset and its sidecar files
|
|
51
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
|
|
52
54
|
stowkit packer [dir] Open the packer GUI
|
|
53
55
|
stowkit editor [dir] Open the level editor
|
|
54
56
|
stowkit serve [dir] Start API server only (no GUI)
|
|
@@ -76,6 +78,10 @@ function resolveAppDir(packageName, monorepoFolder) {
|
|
|
76
78
|
}
|
|
77
79
|
return null;
|
|
78
80
|
}
|
|
81
|
+
function getVersion() {
|
|
82
|
+
const pkg = JSON.parse(fs.readFileSync(path.resolve(thisDir, '../package.json'), 'utf-8'));
|
|
83
|
+
return pkg.version;
|
|
84
|
+
}
|
|
79
85
|
function openBrowser(url) {
|
|
80
86
|
import('node:child_process').then(({ exec }) => {
|
|
81
87
|
const cmd = process.platform === 'win32' ? 'start' : process.platform === 'darwin' ? 'open' : 'xdg-open';
|
|
@@ -99,6 +105,33 @@ async function main() {
|
|
|
99
105
|
case 'init':
|
|
100
106
|
await initProject(projectDir, { update: args.includes('--update') });
|
|
101
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());
|
|
134
|
+
break;
|
|
102
135
|
case 'build':
|
|
103
136
|
await fullBuild(projectDir, opts);
|
|
104
137
|
break;
|
package/package.json
CHANGED
package/skill.md
CHANGED
|
@@ -38,6 +38,8 @@ A StowKit project has a `.felicityproject` JSON file at its root:
|
|
|
38
38
|
```bash
|
|
39
39
|
stowkit init [dir] # Scaffold a new project (creates .felicityproject, assets/, public/cdn-assets/)
|
|
40
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
|
|
41
43
|
stowkit build [dir] # Full build: scan + process + pack
|
|
42
44
|
stowkit scan [dir] # Detect new assets and generate .stowmeta defaults
|
|
43
45
|
stowkit process [dir] # Compress assets (respects cache)
|
|
@@ -506,17 +508,19 @@ PerfLogger.enable();
|
|
|
506
508
|
PerfLogger.disable();
|
|
507
509
|
```
|
|
508
510
|
|
|
509
|
-
## Updating This Skill File
|
|
511
|
+
## Updating the CLI and This Skill File
|
|
510
512
|
|
|
511
|
-
This skill file is bundled with the `@series-inc/stowkit-cli` package.
|
|
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:
|
|
512
514
|
|
|
513
515
|
```bash
|
|
514
|
-
stowkit
|
|
516
|
+
stowkit update
|
|
515
517
|
```
|
|
516
518
|
|
|
517
|
-
This overwrites `.claude/skills/stowkit/SKILL.md` and `.cursor/rules/stowkit.mdc` with the version shipped in the
|
|
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.
|
|
518
520
|
|
|
519
|
-
|
|
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.
|
|
520
524
|
|
|
521
525
|
## Common Tasks for AI Agents
|
|
522
526
|
|