@hasna/skills 0.9.19 → 0.10.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.
package/README.md CHANGED
@@ -30,23 +30,61 @@ payloads outside public software repositories.
30
30
 
31
31
  ## Quick Start
32
32
 
33
- The fleet authority is `https://api.hasna.com/skills`; versioned requests use
34
- `/skills/v1`. Obtain a workspace API key through your administrator's
35
- provisioning process and configure it using the [credential resolution](#credentials)
36
- below. Check the selected identity and
37
- available capabilities before syncing:
33
+ ```bash
34
+ bun install -g @hasna/skills
35
+ skills login
36
+ ```
37
+
38
+ `skills login` opens your browser to sign in to https://skills.md and stores an
39
+ API key for this machine in `~/.hasna/skills/config/credentials` (owner-only),
40
+ together with the server it belongs to. On a terminal it then offers to register
41
+ Skills with your coding agents (`skills setup agents`). Check who you are with
42
+ `skills whoami`.
43
+
44
+ `skills logout` signs out the active profile. It deletes the key that
45
+ `skills login` stored, then revokes it on the server that issued it when login
46
+ minted it (a key you added with `--api-key` is only deleted, unless you pass
47
+ `--revoke`). It exits 0 only when you are signed out. It exits non-zero, naming
48
+ the reason, when revocation did not complete or is not supported (it then says
49
+ where to revoke the key by hand), when another credential is still active (an
50
+ environment variable, the Keychain or another selected profile, which it never
51
+ changes), when the profile holds a credential `skills login` did not store
52
+ (left in place), or when the local deletion failed.
53
+
54
+ - No browser on this machine: `skills login --device` prints a code to approve
55
+ on another device, then `skills login --poll` finishes the same sign-in.
56
+ - An API key you already have: `printenv MY_SKILLS_KEY | skills login --api-key`
57
+ reads it from stdin, verifies it and stores it. Nothing is echoed.
58
+ - An email code instead of the browser: `skills login --email you@example.com`.
59
+ - Running `skills` in a terminal opens the interactive browser. It also works
60
+ signed out and has the same account commands: `/login`, `/logout`, `/whoami`.
61
+
62
+ ### Your own server
63
+
64
+ The software is open source and every command works against your own compatible
65
+ Skills server. Sign in to it with
66
+ `skills login --url https://skills.example.com`; the URL is stored with the key,
67
+ so later commands use that server without flags. `HASNA_SKILLS_API_URL` selects
68
+ a server for one shell. `skills setup --api-url <origin>` records a server
69
+ without signing in.
70
+
71
+ ### Fleet stations
72
+
73
+ Stations provisioned with a fleet key keep using the internal gateway
74
+ `https://api.hasna.com/skills`; versioned requests use `/skills/v1`. A key with
75
+ no recorded URL (the Keychain item, `HASNA_SKILLS_API_KEY` alone, or an older
76
+ credentials file) always stays on that gateway and is never sent anywhere else.
77
+ The gateway has no interactive login service, so on such a station
78
+ `skills login` says so, sends nothing, and names the credential to unset first.
79
+ Obtain a workspace API key through your administrator's provisioning process
80
+ and configure it using the [credential resolution](#credentials) below. Check
81
+ the selected identity and available capabilities before syncing:
38
82
 
39
83
  ```bash
40
- skills auth whoami --json
84
+ skills whoami --json
41
85
  skills capabilities --json
42
86
  ```
43
87
 
44
- The default authority is `https://api.hasna.com/skills`; a full `/skills/v1`
45
- base is also accepted. For your own compatible server, select it with
46
- `skills setup --api-url https://skills.example.com`, then use `skills auth login`.
47
- Browser/device-code and email-code login are for compatible deployments; the
48
- fleet gateway has no interactive login service and does not issue keys that way.
49
-
50
88
  A workspace administrator creates a shared profile selecting published skills by
51
89
  exact version and SHA-256 digest. Consumers sync that profile into a verified
52
90
  Skills cache, then load instructions through the CLI. Replace `default` with
@@ -739,7 +777,7 @@ Tier 5 sits below disk on purpose. A wrapper that injects `HASNA_SKILLS_API_KEY`
739
777
  into one child process re-reads its store every time and cannot go stale; a shell
740
778
  `export` can, and after a key rotation the file on disk is the correct one.
741
779
 
742
- `skills auth login` writes tier 4. A tier an operator set on purpose (1 and 2)
780
+ `skills login` (also `skills auth login`) writes tier 4. A tier an operator set on purpose (1 and 2)
743
781
  never falls through to another identity: if it cannot be honoured, the command
744
782
  fails rather than acting as a different principal.
745
783
 
@@ -759,19 +797,37 @@ recorded Skills instance. Secrets needs its own working bootstrap provider;
759
797
  this setup does not unlock a Keychain or copy a Secrets bootstrap credential.
760
798
  If the file changes during a vault lookup, the request is refused.
761
799
 
762
- An explicit `skills auth login` replaces a stored reference with the newly
763
- authenticated key. `skills auth logout` removes the app's file reference, not
764
- the vault item or Secrets' credential. Changing the service URL preserves the
765
- reference's previous instance binding.
800
+ An explicit `skills login` replaces a stored reference with the newly
801
+ authenticated key. `skills logout` does not remove a stored reference: it
802
+ did not come from `skills login`, so logout leaves it in place, names the file
803
+ and exits non-zero. Remove the reference from the file to sign that profile
804
+ out; the vault item and Secrets' credential are never touched. Changing the
805
+ service URL preserves the reference's previous instance binding.
766
806
 
767
807
  **The service address, in the same shape:**
768
808
 
769
809
  `HASNA_SKILLS_API_URL` → the Keychain item `hasna.credentials.skills.api-url` →
770
810
  `~/.hasna/skills/config/credentials` → the fleet gateway
771
811
  `https://api.hasna.com/skills`. The gateway default applies only once a
772
- credential has resolved, so an install with no credential names no host at all.
773
- `skills setup --api-url <origin>` writes the credentials file; the address is
774
- per-user, never per-project.
812
+ credential has resolved, so a data command from an install with no credential
813
+ names no host at all. Signing in is the one exception: with no URL and no
814
+ credential anywhere, `skills login` signs in to https://skills.md and records
815
+ that URL beside the new key. A credential that already resolves keeps its own
816
+ server, for data and for signing in. A URL that `skills login` wrote is removed
817
+ again by `skills logout` together with the key; a URL you configured with
818
+ `skills setup --api-url <origin>` stays. That command writes the credentials
819
+ file; the address is per-user, never per-project.
820
+
821
+ **Which credential may go to which server.** A stored credential goes only to
822
+ the server it was stored for: the credentials-file or profile key to its
823
+ recorded server (the internal gateway when it recorded none), the Keychain key
824
+ to the Keychain `api-url` beside it (else the gateway). A credential that
825
+ records no server of its own (`HASNA_SKILLS_API_KEY`,
826
+ `HASNA_SKILLS_API_KEY_OVERRIDE`, an environment `HASNA_SKILLS_API_KEY_REF`, or
827
+ an explicit argument) goes only to the internal gateway or to a URL from the
828
+ environment (`HASNA_SKILLS_API_URL`), never to a URL from the credentials file
829
+ or the Keychain. Any other combination is refused before anything is sent. Set
830
+ `HASNA_SKILLS_API_URL` alongside such a credential for your own server.
775
831
 
776
832
  The internal gateway resource contract is `/skills/v1/...`; commercial and custom
777
833
  instances retain their `/api/v1/...` routes. A full gateway `/skills/v1` base is
@@ -877,8 +933,10 @@ of app folders, and `XDG_CONFIG_HOME` is not consulted at all.
877
933
  | `skills env-check [name]` | `check-env` | Show required environment variables; `--set KEY=VALUE` updates the project's `.env` |
878
934
  | `skills test [name]` | | Test skill readiness (env, system, npm deps) |
879
935
  | `skills outdated` | | Compare pinned vs registry versions |
880
- | `skills auth login --api-key <key>` | | Verify and store a Skills API key |
881
- | `skills auth login` | | Sign in to a compatible API with browser/device-code auth or email code |
936
+ | `skills login` | | Sign in in the browser (https://skills.md unless a server is configured); `--device`, `--email`, `--api-key` (stdin) and `--url <origin>` select other flows and servers |
937
+ | `skills logout` | | Sign out the active profile: delete the key `skills login` stored and revoke it on its server when login minted it; `--revoke` also revokes a key you added, `--no-revoke` revokes nothing (and exits non-zero if a minted key is left live) |
938
+ | `skills whoami` | | Show the signed-in account and where its credential came from |
939
+ | `skills auth login` / `auth logout` / `auth whoami` | | The same commands under `auth`; `auth login --membership-id` enrolls a workspace profile |
882
940
  | `skills billing status` | | Show server account plan and balance |
883
941
  | `skills billing checkout` | | Create a checkout session when billing is enabled |
884
942
  | `skills billing portal` | | Create a customer portal session when billing is enabled |