@ory/gemini-cli 0.9.0 → 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 +31 -12
- package/gemini-extension/GEMINI.md +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,6 +4,20 @@
|
|
|
4
4
|
|
|
5
5
|
You don't need an Ory account or any prior Ory experience to start.
|
|
6
6
|
|
|
7
|
+
## New to Ory?
|
|
8
|
+
|
|
9
|
+
[Ory](https://www.ory.com/docs/) is an open-source identity and access platform — it provides login, registration, sessions, social sign-in, multi-factor auth, and fine-grained permissions, so you don't have to build any of that yourself. Two things make it easy to try with no prior experience:
|
|
10
|
+
|
|
11
|
+
- **Ory Elements** are prebuilt, themeable UI components for the auth pages (login, registration, recovery, settings). The scaffolding skills wire them into your app for you.
|
|
12
|
+
- **The local Ory stack** is a complete Ory running on your laptop in Docker — no account, no signup, no API key. Everything in the Quickstart below works against it, fully offline.
|
|
13
|
+
|
|
14
|
+
This extension does two independent things, and you can use either on its own:
|
|
15
|
+
|
|
16
|
+
1. **Build auth into your app.** Have Gemini scaffold Ory login, registration, social sign-in, and permissions into the project you're working on, backed by the local stack. This is the Quickstart below — it needs nothing but Docker.
|
|
17
|
+
2. **Govern the agent itself.** Authenticate Gemini's own session and authorize every tool it runs against Ory Permissions, with a full audit trail. See [Agent security](#agent-security).
|
|
18
|
+
|
|
19
|
+
If you're just exploring, do the Quickstart first.
|
|
20
|
+
|
|
7
21
|
## Prerequisites
|
|
8
22
|
|
|
9
23
|
- [Gemini CLI](https://github.com/google-gemini/gemini-cli) installed and signed in
|
|
@@ -74,11 +88,16 @@ That's the full Ory DX path. Stop here if you're just evaluating the extension.
|
|
|
74
88
|
|
|
75
89
|
The extension bundles a catalog of skills that Gemini auto-invokes by description. Ask Gemini in natural language or invoke a skill directly:
|
|
76
90
|
|
|
91
|
+
**Start here — add Ory auth to your app:**
|
|
92
|
+
|
|
77
93
|
- **`ory-auth-setup`** — full project setup. Install the Ory CLI, create an Ory Network project (or use the local one), add Ory Elements, configure the SDK, build the auth pages, wire session middleware.
|
|
78
94
|
- **`ory-login-flow`** — login, registration, recovery, verification, and settings pages with Ory Elements. Next.js App Router and React SPA variants.
|
|
79
95
|
- **`ory-social-login`** — Google, GitHub, Apple, Microsoft, Discord, and other OIDC providers with Jsonnet data mappers.
|
|
80
96
|
- **`ory-local-dev`** — drive the local Ory stack from within Gemini to prototype and test without a remote project.
|
|
81
|
-
|
|
97
|
+
|
|
98
|
+
**Going further:**
|
|
99
|
+
|
|
100
|
+
- **`ory-permissions-onboarding`** — bootstrap permissions for built-in tools, switch between observe and enforce mode, troubleshoot denials.
|
|
82
101
|
- **`ory-build-integration`** — pull the runnable subset of an `ory/integrates` template (webhook / config / http-event) into your own app and wire it to your Ory project — no contribution/registry concerns.
|
|
83
102
|
- **`ory-contribute-integration`** — author a brand-new integration as a contribution to `ory/integrates`, including `registry.entry.yaml`, the `Maintained by:` footer, DCO sign-off, and registry regeneration.
|
|
84
103
|
- **`ory-e2b-sandbox`** — scaffold an [E2B](https://e2b.dev) sandbox template that boots with this extension preinstalled and registered, so every sandbox session is gated by Ory auth, permissions, and tracing without any per-sandbox setup.
|
|
@@ -87,7 +106,7 @@ The extension bundles a catalog of skills that Gemini auto-invokes by descriptio
|
|
|
87
106
|
|
|
88
107
|
### Ory MCP server
|
|
89
108
|
|
|
90
|
-
Bundled and registered automatically. Exposes the Ory CLI and the Ory Network REST API as MCP tools so Gemini can manage identities, OAuth2 clients, projects,
|
|
109
|
+
Bundled and registered automatically. Exposes the Ory CLI and the Ory Network REST API as MCP tools so Gemini can manage identities, OAuth2 clients, projects, permissions, and configuration without ever leaving the chat. Useful for seeding test data, verifying a scaffolded integration, or running one-off admin tasks.
|
|
91
110
|
|
|
92
111
|
### Local Ory stack
|
|
93
112
|
|
|
@@ -97,16 +116,16 @@ Bundled and registered automatically. Exposes the Ory CLI and the Ory Network RE
|
|
|
97
116
|
/ory:temporal-up # start a local Temporal dev server (for ory-temporal-worker)
|
|
98
117
|
```
|
|
99
118
|
|
|
100
|
-
`local-up`
|
|
119
|
+
`local-up` runs a complete Ory on your laptop: the Ory APIs (Identities, OAuth2, Permissions) at `http://localhost:4000`, a login UI on `:4455` (not :3000, to avoid Next.js port conflicts), and Jaeger (the trace viewer) on `:16686`. A test user identity is seeded and its credentials are printed for you. Use it to:
|
|
101
120
|
|
|
102
121
|
- **Learn Ory hands-on** without signing up for a hosted project.
|
|
103
|
-
- **Prototype** flows (login, social, MFA, recovery,
|
|
122
|
+
- **Prototype** flows (login, social, MFA, recovery, permissions) against a real Ory backend.
|
|
104
123
|
- **Test** an auth integration end-to-end before pushing anything to a real environment.
|
|
105
124
|
- **Develop** your application against the same identity, OAuth2, and permission surfaces you'll ship with.
|
|
106
125
|
|
|
107
126
|
## Pointing at a real Ory project
|
|
108
127
|
|
|
109
|
-
The Quickstart uses the local stack. If you have a hosted [Ory Network](https://console.ory.sh) project, point the extension at it with a single configure command. **The extension requires `--oauth2-client-id` whenever `--project-url` is provided** — register the client first (see [Register the user OAuth2 client](#register-the-user-oauth2-client) below), then run:
|
|
128
|
+
The Quickstart uses the local stack. If you have a hosted [Ory Network](https://console.ory.sh) project (Ory's managed cloud), point the extension at it with a single configure command. **The extension requires `--oauth2-client-id` whenever `--project-url` is provided** — register the client first (see [Register the user OAuth2 client](#register-the-user-oauth2-client) below), then run:
|
|
110
129
|
|
|
111
130
|
```bash
|
|
112
131
|
npx -y -p @ory/gemini-cli ory-gemini configure \
|
|
@@ -180,10 +199,10 @@ Headless / CI runs that already hold a session token can skip this entirely by s
|
|
|
180
199
|
Once the extension is pointed at an Ory project (local or hosted), Gemini's session and every tool call can be governed by Ory.
|
|
181
200
|
|
|
182
201
|
- **Authentication.** Two identities. The human at the keyboard (the **user**) authenticates interactively via Ory Identities when user login is enabled (`ORY_USER_LOGIN=true`, off by default — browser PKCE flow on first session, persisted token thereafter). The Gemini process (the **agent**) gets its own OAuth2 identity, self-registered via [Dynamic Client Registration (RFC 7591)](https://datatracker.ietf.org/doc/html/rfc7591) on first run.
|
|
183
|
-
- **Authorization.** Before any tool runs, the extension checks [Ory Permissions](https://www.ory.com/docs/keto) (Zanzibar-style
|
|
184
|
-
- **Audit.** Every decision (allow, deny, fallback) is recorded as a structured trace span: NDJSON file output and/or OTLP/HTTP export to Jaeger, Honeycomb, Grafana, and similar collectors. The user → agent delegation is written to Ory as a relation
|
|
202
|
+
- **Authorization.** Before any tool runs, the extension checks [Ory Permissions](https://www.ory.com/docs/keto) (Zanzibar-style relations) against the user's subject and blocks the call on `deny`. MCP tool calls additionally get a server-level check.
|
|
203
|
+
- **Audit.** Every decision (allow, deny, fallback) is recorded as a structured trace span: NDJSON file output and/or OTLP/HTTP export to Jaeger, Honeycomb, Grafana, and similar collectors. The user → agent delegation is written to Ory as a relation so *"agent X acting on behalf of user Y"* stays queryable after tokens expire.
|
|
185
204
|
|
|
186
|
-
The extension is **fail-open** on its own infrastructure failures (network errors, rate limits, missing config), so enforcement is only as strong as your
|
|
205
|
+
The extension is **fail-open** on its own infrastructure failures (network errors, rate limits, missing config), so enforcement is only as strong as your permission grants — grant explicit `use` on the tools each user should be able to run.
|
|
187
206
|
|
|
188
207
|
### Enable enforcement
|
|
189
208
|
|
|
@@ -200,7 +219,7 @@ After install the extension runs in **observe mode**: every tool call is checked
|
|
|
200
219
|
|
|
201
220
|
`ORY_OAUTH2_CLIENT_ID` is required when `ORY_USER_LOGIN` is on: PKCE needs a public OAuth2 client registered with the four loopback redirect URIs (`http://127.0.0.1:47823..47826/callback`) to exchange the authorization code for a token. The local stack provisions one and prints the export in its `local up` banner; for a hosted Ory project see [Register the user OAuth2 client](#register-the-user-oauth2-client) for the exact CLI / Console steps. Headless / CI runs can skip the browser flow entirely by pre-supplying `ORY_USER_SESSION_TOKEN` instead.
|
|
202
221
|
|
|
203
|
-
2. **Bootstrap
|
|
222
|
+
2. **Bootstrap permissions for the built-in tools.** One idempotent command grants the current user `use` on every tool Gemini ships with (read_file, write_file, shell, …):
|
|
204
223
|
|
|
205
224
|
```bash
|
|
206
225
|
npx -y -p @ory/gemini-cli ory-gemini permissions bootstrap
|
|
@@ -214,7 +233,7 @@ After install the extension runs in **observe mode**: every tool call is checked
|
|
|
214
233
|
npx -y -p @ory/gemini-cli ory-gemini permissions status
|
|
215
234
|
```
|
|
216
235
|
|
|
217
|
-
Add
|
|
236
|
+
Add permissions for any MCP server tools or custom commands by hand, or via the Ory MCP server from inside Gemini (*"grant me use on the shell tool"*).
|
|
218
237
|
|
|
219
238
|
4. **Promote to enforce.** Once the observe-mode logs look right, switch over:
|
|
220
239
|
|
|
@@ -239,13 +258,13 @@ npx -y -p @ory/gemini-cli ory-gemini status
|
|
|
239
258
|
Highlights:
|
|
240
259
|
|
|
241
260
|
- `agent status` — show the current persisted DCR identity for the agent.
|
|
242
|
-
- `permissions observe` / `permissions enforce` — switch between "log denies, allow through" (the install default) and "block denies." `permissions bootstrap` writes `use`
|
|
261
|
+
- `permissions observe` / `permissions enforce` — switch between "log denies, allow through" (the install default) and "block denies." `permissions bootstrap` writes `use` permissions for the harness's built-in tools so the promotion path doesn't require hand-writing relations.
|
|
243
262
|
- `configure --audit-only` — kill switch that disables Ory entirely (no auth, no permission checks; only audit logging of tool invocations). For phased rollouts, prefer `permissions observe` over `--audit-only`.
|
|
244
263
|
- `local seed` / `local env` — reseed the test user, or print env vars for pointing other tools at the local stack.
|
|
245
264
|
|
|
246
265
|
## Troubleshooting
|
|
247
266
|
|
|
248
|
-
- **`/ory:local-up` fails.** Make sure Docker is running and ports `
|
|
267
|
+
- **`/ory:local-up` fails.** Make sure Docker is running and ports `4455` (login UI), `4000`, `4100`, and `16686` are free.
|
|
249
268
|
- **PKCE login loops.** Clear persisted state with `npx -y -p @ory/gemini-cli ory-gemini agent unregister` and retry.
|
|
250
269
|
- **`npx` fetches an old version.** Force a fresh fetch: `npx -y -p @ory/gemini-cli@latest ory-gemini …`.
|
|
251
270
|
- **Need more signal.** Set `ORY_AGENT_DEBUG=true` and `ORY_AGENT_LOG_FILE=/tmp/ory.log` to capture structured logs.
|
|
@@ -24,7 +24,7 @@ tool call.
|
|
|
24
24
|
## Slash commands
|
|
25
25
|
|
|
26
26
|
- `/ory:local-up` — start a local Ory instance in Docker (Identities, OAuth2,
|
|
27
|
-
Permissions, plus a login UI on `:
|
|
27
|
+
Permissions, plus a login UI on `:4455` (not :3000, to avoid Next.js port conflicts) and Jaeger on `:16686`, reachable
|
|
28
28
|
through `http://localhost:4000`). Prints seeded test-user credentials.
|
|
29
29
|
- `/ory:local-down` — tear it all down.
|
|
30
30
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ory/gemini-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Ory extension for Gemini CLI: scaffolding skills, a local Ory instance, and authentication, authorization, and audit for every tool call",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://ory.com",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"gemini-extension"
|
|
69
69
|
],
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@ory/argus": "0.
|
|
71
|
+
"@ory/argus": "0.10.0"
|
|
72
72
|
},
|
|
73
73
|
"engines": {
|
|
74
74
|
"node": ">=22"
|