@grapity/grapity 0.3.0 → 0.4.1

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
@@ -21,10 +21,24 @@ grapity init --local
21
21
  grapity serve
22
22
  ```
23
23
 
24
- ### Self-hosted (PostgreSQL)
24
+ For local development without Keycloak, use `--no-auth`:
25
25
 
26
26
  ```bash
27
- grapity serve --db postgresql://user:pass@host:5432/grapity --auth jwt
27
+ grapity serve --no-auth
28
+ ```
29
+
30
+ ### Self-hosted (PostgreSQL + Keycloak)
31
+
32
+ ```bash
33
+ grapity init --local \
34
+ --db postgresql://user:pass@host:5432/grapity \
35
+ --auth keycloak \
36
+ --keycloak-server https://keycloak.example.com \
37
+ --keycloak-realm grapity \
38
+ --keycloak-client-id grapity-cli
39
+
40
+ export GRAPITY_CLIENT_SECRET="your-client-secret"
41
+ grapity serve
28
42
  ```
29
43
 
30
44
  ### Remote / SaaS
@@ -32,7 +46,13 @@ grapity serve --db postgresql://user:pass@host:5432/grapity --auth jwt
32
46
  Connect to a hosted Grapity instance. No server to run.
33
47
 
34
48
  ```bash
35
- grapity init --remote --url https://api.grapity.dev --api-key <key>
49
+ grapity init --remote --url https://api.grapity.dev \
50
+ --auth keycloak \
51
+ --keycloak-server https://keycloak.example.com \
52
+ --keycloak-realm grapity \
53
+ --keycloak-client-id grapity-cli
54
+
55
+ export GRAPITY_CLIENT_SECRET="your-client-secret"
36
56
  ```
37
57
 
38
58
  ## Commands
@@ -42,12 +62,17 @@ grapity init --remote --url https://api.grapity.dev --api-key <key>
42
62
  Configure the registry. Writes `~/.grapity/config.yaml`.
43
63
 
44
64
  ```
45
- --local Use local mode (SQLite)
46
- --remote Use remote mode
47
- --url <url> Registry URL (required for remote)
48
- --api-key <key> API key (optional, for remote)
49
- --port <port> Port for local server (default: 3750)
50
- --db <path> SQLite database path (default: ~/.grapity/registry.db)
65
+ --local Use local mode (SQLite or PostgreSQL)
66
+ --remote Use remote mode
67
+ --url <url> Registry URL (required for remote)
68
+ --port <port> Port for local server (default: 3750)
69
+ --db <path-or-url> SQLite path or postgresql:// URL (for local mode)
70
+ --auth <mode> Auth mode: none | keycloak (default: none)
71
+ --keycloak-server <url> Keycloak server URL
72
+ --keycloak-realm <realm> Keycloak realm
73
+ --keycloak-client-id <id> Keycloak client ID for CLI client credentials
74
+ --keycloak-audience <aud> Keycloak token audience to validate
75
+ --keycloak-role-source <s> Where to read roles from: scope | realm_access.roles
51
76
  ```
52
77
 
53
78
  ### `grapity serve`
@@ -55,14 +80,22 @@ Configure the registry. Writes `~/.grapity/config.yaml`.
55
80
  Start the registry server and the Hub developer portal. Use `--no-hub` to skip the portal.
56
81
 
57
82
  ```
58
- -p, --port <port> Port to listen on (default: 3750)
59
- --db <url> SQLite path or postgresql:// URL
60
- --auth <mode> Auth mode: none | api-key | jwt (default: none)
83
+ -p, --port <port> Port to listen on (default: 3750)
84
+ --hub-port <port> Port for the developer portal (default: 3000)
85
+ --no-hub Skip starting the developer portal
86
+ --no-auth Start without authentication (local development only)
61
87
  ```
62
88
 
63
- The database backend is inferred from `--db`: a `postgresql://` URL uses PostgreSQL, anything else (or omitted) uses SQLite.
89
+ ### `grapity auth`
90
+
91
+ Check or clear the cached Keycloak access token.
92
+
93
+ ```bash
94
+ grapity auth status # Show current authentication status
95
+ grapity auth clear # Clear the cached token
96
+ ```
64
97
 
65
- ### `grapity registry push <file>`
98
+ Client secrets are never written to `~/.grapity/config.yaml`. Set `GRAPITY_CLIENT_SECRET` (or `GRAPITY_TOKEN` for automation) before running commands.
66
99
 
67
100
  Push a spec file to the registry. Validates structure, checks backward compatibility against the latest version, assigns a semver, and stores the result.
68
101