@skillsmith/cli 0.3.8 → 0.4.0

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 (43) hide show
  1. package/README.md +65 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/src/commands/index.d.ts +3 -0
  4. package/dist/src/commands/index.d.ts.map +1 -1
  5. package/dist/src/commands/index.js +4 -0
  6. package/dist/src/commands/index.js.map +1 -1
  7. package/dist/src/commands/login.d.ts +23 -0
  8. package/dist/src/commands/login.d.ts.map +1 -0
  9. package/dist/src/commands/login.js +121 -0
  10. package/dist/src/commands/login.js.map +1 -0
  11. package/dist/src/commands/login.test.d.ts +8 -0
  12. package/dist/src/commands/login.test.d.ts.map +1 -0
  13. package/dist/src/commands/login.test.js +218 -0
  14. package/dist/src/commands/login.test.js.map +1 -0
  15. package/dist/src/commands/logout.d.ts +14 -0
  16. package/dist/src/commands/logout.d.ts.map +1 -0
  17. package/dist/src/commands/logout.js +45 -0
  18. package/dist/src/commands/logout.js.map +1 -0
  19. package/dist/src/commands/logout.test.d.ts +8 -0
  20. package/dist/src/commands/logout.test.d.ts.map +1 -0
  21. package/dist/src/commands/logout.test.js +135 -0
  22. package/dist/src/commands/logout.test.js.map +1 -0
  23. package/dist/src/commands/manage.d.ts +1 -16
  24. package/dist/src/commands/manage.d.ts.map +1 -1
  25. package/dist/src/commands/manage.js +3 -97
  26. package/dist/src/commands/manage.js.map +1 -1
  27. package/dist/src/commands/whoami.d.ts +14 -0
  28. package/dist/src/commands/whoami.d.ts.map +1 -0
  29. package/dist/src/commands/whoami.js +42 -0
  30. package/dist/src/commands/whoami.js.map +1 -0
  31. package/dist/src/commands/whoami.test.d.ts +8 -0
  32. package/dist/src/commands/whoami.test.d.ts.map +1 -0
  33. package/dist/src/commands/whoami.test.js +131 -0
  34. package/dist/src/commands/whoami.test.js.map +1 -0
  35. package/dist/src/index.js +12 -4
  36. package/dist/src/index.js.map +1 -1
  37. package/dist/src/templates/mcp-template-handlers.js +1 -1
  38. package/dist/src/templates/mcp-template-handlers.js.map +1 -1
  39. package/dist/src/utils/skills-directory.d.ts +25 -0
  40. package/dist/src/utils/skills-directory.d.ts.map +1 -0
  41. package/dist/src/utils/skills-directory.js +102 -0
  42. package/dist/src/utils/skills-directory.js.map +1 -0
  43. package/package.json +6 -2
package/README.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  Command-line interface for Skillsmith - discover, manage, and author agent skills.
4
4
 
5
+ ## What's New in v0.4.0
6
+
7
+ - **CLI Authentication**: `skillsmith login` opens your browser, you copy the API key and paste it — done. Stored securely in your OS keyring.
8
+ - **Session Commands**: `skillsmith logout` clears stored credentials; `skillsmith whoami` shows your current auth status and key source.
9
+ - **Headless/CI Support**: `skillsmith login --no-browser` prints the URL for environments without a display. Use `SKILLSMITH_API_KEY` env var for fully non-interactive auth.
10
+
5
11
  ## What's New in v0.3.1
6
12
 
7
13
  - **Database Fix**: Fixed "no such table: skills" error on fresh installations
@@ -402,12 +408,71 @@ skillsmith sync config --enable --frequency weekly
402
408
  - `--disable` - Disable automatic sync
403
409
  - `--frequency <freq>` - Set frequency: `daily` or `weekly`
404
410
 
411
+ ### login
412
+
413
+ Authenticate the Skillsmith CLI with your API key. Opens your browser to [skillsmith.app/account/cli-token](https://skillsmith.app/account/cli-token), where you generate and copy a key, then paste it into the terminal prompt.
414
+
415
+ ```bash
416
+ skillsmith login
417
+ ```
418
+
419
+ ```
420
+ Opening https://skillsmith.app/account/cli-token in your browser...
421
+
422
+ After authenticating, copy the API key shown and paste it below.
423
+ ? Paste your API key: [input is masked]
424
+
425
+ ✓ Logged in successfully.
426
+ Note: your API key may still be in your clipboard. Clear it when done.
427
+ ```
428
+
429
+ **Options:**
430
+ - `--no-browser` — Print the URL instead of opening a browser (for headless/CI/SSH environments)
431
+
432
+ **Headless/CI environments:** Use `SKILLSMITH_API_KEY` as an environment variable — no browser needed.
433
+
434
+ **Key storage:** Keys are stored in your OS keyring (macOS Keychain, GNOME Keyring, Windows Credential Store) when available, with `~/.skillsmith/config.json` as fallback.
435
+
436
+ ### logout
437
+
438
+ Remove the stored API key.
439
+
440
+ ```bash
441
+ skillsmith logout
442
+ ```
443
+
444
+ ```
445
+ ? Log out and remove stored API key? (y/N) y
446
+ ✓ Logged out. Key removed from OS keyring.
447
+ ```
448
+
449
+ ### whoami
450
+
451
+ Show current authentication status.
452
+
453
+ ```bash
454
+ skillsmith whoami
455
+ ```
456
+
457
+ ```
458
+ Skillsmith CLI
459
+ Key: sk_live_xxxx...
460
+ Source: OS keyring
461
+ Format: valid
462
+ ```
463
+
464
+ **Source** indicates where the active key was read from:
465
+ - `OS keyring` — stored by `skillsmith login` (most secure)
466
+ - `config file (~/.skillsmith/config.json)` — file-based fallback
467
+ - `environment variable (SKILLSMITH_API_KEY)` — injected at runtime
468
+
405
469
  ## Configuration
406
470
 
407
471
  ### Environment Variables
408
472
 
409
473
  | Variable | Description | Default |
410
474
  |----------|-------------|---------|
475
+ | `SKILLSMITH_API_KEY` | API key for authenticated requests (alternative to `skillsmith login`) | - |
411
476
  | `SKILLSMITH_DB_PATH` | Database file location | `~/.skillsmith/skills.db` |
412
477
  | `SKILLSMITH_IMPORT_DELAY_MS` | Delay between GitHub API calls during import | `150` |
413
478
  | `GITHUB_TOKEN` | GitHub token for imports | - |