@myapihq/cli 1.0.67 → 1.0.70
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/commands/setup.js +14 -14
- package/dist/commands/update.js +5 -6
- package/dist/index.js +13 -4
- package/package.json +1 -1
package/dist/commands/setup.js
CHANGED
|
@@ -41,16 +41,21 @@ export async function installSkills() {
|
|
|
41
41
|
info('No bundled skills found — skipping skills install.');
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
// Each
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
// Each skill is a subdirectory containing SKILL.md
|
|
45
|
+
const skills = fs.readdirSync(BUNDLED_SKILLS_DIR).filter(f => fs.statSync(path.join(BUNDLED_SKILLS_DIR, f)).isDirectory() &&
|
|
46
|
+
fs.existsSync(path.join(BUNDLED_SKILLS_DIR, f, 'SKILL.md')));
|
|
47
|
+
if (skills.length === 0) {
|
|
48
|
+
info('No bundled skills found — skipping skills install.');
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
// Write canonical copies: ~/.agents/skills/myapi/<skill>/SKILL.md (only SKILL.md)
|
|
52
|
+
fs.mkdirSync(SKILLS_CANONICAL, { recursive: true });
|
|
48
53
|
for (const skill of skills) {
|
|
49
54
|
const skillDir = path.join(SKILLS_CANONICAL, skill);
|
|
50
55
|
fs.mkdirSync(skillDir, { recursive: true });
|
|
51
|
-
fs.copyFileSync(path.join(BUNDLED_SKILLS_DIR,
|
|
56
|
+
fs.copyFileSync(path.join(BUNDLED_SKILLS_DIR, skill, 'SKILL.md'), path.join(skillDir, 'SKILL.md'));
|
|
52
57
|
}
|
|
53
|
-
// Symlink each skill
|
|
58
|
+
// Symlink each skill into agent config directories
|
|
54
59
|
for (const [agent, dir] of Object.entries(AGENT_DIRS)) {
|
|
55
60
|
try {
|
|
56
61
|
fs.mkdirSync(dir, { recursive: true });
|
|
@@ -58,15 +63,10 @@ export async function installSkills() {
|
|
|
58
63
|
const link = path.join(dir, skill);
|
|
59
64
|
const target = path.join(SKILLS_CANONICAL, skill);
|
|
60
65
|
try {
|
|
61
|
-
|
|
62
|
-
fs.rmSync(link, { recursive: true, force: true });
|
|
63
|
-
}
|
|
64
|
-
catch { /* ignore */ }
|
|
65
|
-
fs.symlinkSync(target, link);
|
|
66
|
-
}
|
|
67
|
-
catch {
|
|
68
|
-
// Non-fatal.
|
|
66
|
+
fs.rmSync(link, { recursive: true, force: true });
|
|
69
67
|
}
|
|
68
|
+
catch { /* ignore */ }
|
|
69
|
+
fs.symlinkSync(target, link);
|
|
70
70
|
}
|
|
71
71
|
info(` ✓ ${agent}`);
|
|
72
72
|
}
|
package/dist/commands/update.js
CHANGED
|
@@ -19,8 +19,10 @@ export async function checkForUpdate(currentVersion) {
|
|
|
19
19
|
if (latest && isNewer(latest, currentVersion)) {
|
|
20
20
|
info(`\n› New version available (${currentVersion} → ${latest}) — installing…`);
|
|
21
21
|
try {
|
|
22
|
-
//
|
|
23
|
-
|
|
22
|
+
// Use @latest so npm only resolves to a fully-published tarball, avoiding
|
|
23
|
+
// ETARGET races where registry metadata briefly reports a version before
|
|
24
|
+
// its tarball is available.
|
|
25
|
+
execSync(`"${npmBin()}" install -g @myapihq/cli@latest`, { stdio: 'pipe' });
|
|
24
26
|
const config = loadConfig();
|
|
25
27
|
if (config?.skills_installed) {
|
|
26
28
|
await installSkills();
|
|
@@ -29,11 +31,8 @@ export async function checkForUpdate(currentVersion) {
|
|
|
29
31
|
}
|
|
30
32
|
catch (installErr) {
|
|
31
33
|
const msg = installErr?.stderr?.toString?.() || installErr?.message || String(installErr);
|
|
32
|
-
// Silently ignore ETARGET — version just published, tarball not yet available.
|
|
33
|
-
if (msg.includes('ETARGET') || msg.includes('notarget'))
|
|
34
|
-
return;
|
|
35
34
|
info(`› Auto-update failed: ${msg.trim()}`);
|
|
36
|
-
info(`› Run manually: npm install -g @myapihq/cli
|
|
35
|
+
info(`› Run manually: npm install -g @myapihq/cli@latest`);
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
38
|
}
|
package/dist/index.js
CHANGED
|
@@ -168,6 +168,14 @@ async function main() {
|
|
|
168
168
|
case 'config':
|
|
169
169
|
await configCmd.run(subcommand, restArgs, { ...flags, _via: 'config' });
|
|
170
170
|
break;
|
|
171
|
+
case 'install-skills':
|
|
172
|
+
if (flags.help) {
|
|
173
|
+
info('Usage: myapi install-skills\n\nAlias for: myapi auth install-skills');
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
await setupCmd.installSkills();
|
|
177
|
+
success('› Skills installed.');
|
|
178
|
+
break;
|
|
171
179
|
case 'help':
|
|
172
180
|
printHelp();
|
|
173
181
|
break;
|
|
@@ -216,10 +224,11 @@ Commands:
|
|
|
216
224
|
funnel Manage websites (publish pages, custom domains, funnels)
|
|
217
225
|
|
|
218
226
|
Aliases:
|
|
219
|
-
whoami
|
|
220
|
-
keys
|
|
221
|
-
setup
|
|
222
|
-
config
|
|
227
|
+
whoami → myapi auth whoami
|
|
228
|
+
keys → myapi auth api-keys
|
|
229
|
+
setup → myapi auth setup
|
|
230
|
+
config → myapi auth config
|
|
231
|
+
install-skills → myapi auth install-skills
|
|
223
232
|
|
|
224
233
|
Run "myapi <command> --help" for subcommand help.
|
|
225
234
|
|