@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.
@@ -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 bundled file is <skill-name>.md install as <skill-name>/SKILL.md
45
- const files = fs.readdirSync(BUNDLED_SKILLS_DIR).filter(f => f.endsWith('.md'));
46
- const skills = files.map(f => f.replace(/\.md$/, ''));
47
- // Write canonical copies: ~/.agents/skills/myapi/<skill-name>/SKILL.md
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, `${skill}.md`), path.join(skillDir, 'SKILL.md'));
56
+ fs.copyFileSync(path.join(BUNDLED_SKILLS_DIR, skill, 'SKILL.md'), path.join(skillDir, 'SKILL.md'));
52
57
  }
53
- // Symlink each skill directory into agent dirs
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
- try {
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
  }
@@ -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
- // Pin the exact version so npm can't resolve to a cached older one.
23
- execSync(`"${npmBin()}" install -g @myapihq/cli@${latest}`, { stdio: 'pipe' });
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@${latest}`);
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 → myapi auth whoami
220
- keys → myapi auth api-keys
221
- setup → myapi auth setup
222
- config → myapi auth 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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myapihq/cli",
3
- "version": "1.0.67",
3
+ "version": "1.0.70",
4
4
  "description": "MyAPI command-line interface",
5
5
  "type": "module",
6
6
  "files": [