@ory/gemini-cli 0.6.1 → 0.7.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 +13 -9
- package/dist/cli/main.js +1 -1
- package/dist/handlers.d.ts +2 -2
- package/dist/handlers.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -19,14 +19,18 @@ In your shell:
|
|
|
19
19
|
gemini extensions install https://github.com/ory/gemini-cli-extension
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Then confirm everything landed:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx -y -p @ory/gemini-cli ory-gemini status
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`status` is the single source of truth — it prints configuration, user and agent identity, per-tool permission coverage, extension + skill registration, and a tail of recent debug logs. Unconfigured fields show inline as `(unset)`.
|
|
23
29
|
|
|
24
30
|
<details>
|
|
25
31
|
<summary>Alternative install paths</summary>
|
|
26
32
|
|
|
27
33
|
```bash
|
|
28
|
-
# Direct installer; renders a fresh extension manifest and invokes
|
|
29
|
-
# `gemini extensions install` for you. No prior npm install required.
|
|
30
34
|
npx -y @ory/gemini-cli install
|
|
31
35
|
npx -y @ory/gemini-cli uninstall
|
|
32
36
|
```
|
|
@@ -53,13 +57,13 @@ From any project where you'd like Ory authentication, inside Gemini CLI:
|
|
|
53
57
|
|
|
54
58
|
3. **Sign in.** Start your app, visit the login page Gemini added, and sign in with the seeded credentials. You now have a real Ory session backed by a real Ory stack — locally, offline, with zero configuration.
|
|
55
59
|
|
|
56
|
-
4. **Turn on Ory login for the Gemini session itself.** *(Optional but recommended.)* Out of the box the extension only governs your *app*. To also attach an Ory identity to *Gemini's* session — so every tool call is attributed to you, not a fallback `session:<id>` subject —
|
|
60
|
+
4. **Turn on Ory login for the Gemini session itself.** *(Optional but recommended.)* Out of the box the extension only governs your *app*. To also attach an Ory identity to *Gemini's* session — so every tool call is attributed to you, not a fallback `session:<id>` subject — opt in to the user-login flow:
|
|
57
61
|
|
|
58
62
|
```bash
|
|
59
|
-
export
|
|
63
|
+
export ORY_USER_LOGIN=1
|
|
60
64
|
```
|
|
61
65
|
|
|
62
|
-
|
|
66
|
+
User login is off by default. With it on, the next Gemini session opens an Ory login in your browser; sign in with the same seeded credentials from step 1, and the token is reused on subsequent sessions until it expires. This is what makes `permissions enforce` (see [Agent security](#agent-security)) deny on the right identity later.
|
|
63
67
|
|
|
64
68
|
That's the full Ory DX path. Stop here if you're just evaluating the extension. Continue to [Agent security](#agent-security) when you're ready to enforce.
|
|
65
69
|
|
|
@@ -114,7 +118,7 @@ Without configuration the extension still loads cleanly and runs in **pass-throu
|
|
|
114
118
|
|
|
115
119
|
Once the extension is pointed at an Ory project (local or hosted), Gemini's session and every tool call can be governed by Ory.
|
|
116
120
|
|
|
117
|
-
- **Authentication.** Two identities. The human at the keyboard (the **user**) authenticates interactively via Ory Identities when `
|
|
121
|
+
- **Authentication.** Two identities. The human at the keyboard (the **user**) authenticates interactively via Ory Identities when user login is enabled (`ORY_USER_LOGIN=1`, 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.
|
|
118
122
|
- **Authorization.** Before any tool runs, the extension checks [Ory Permissions](https://www.ory.com/docs/keto) (Zanzibar-style relation tuples) against the user's subject and blocks the call on `deny`. MCP tool calls additionally get a server-level check.
|
|
119
123
|
- **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 tuple so *"agent X acting on behalf of user Y"* stays queryable after tokens expire.
|
|
120
124
|
|
|
@@ -124,10 +128,10 @@ The extension is **fail-open** on its own infrastructure failures (network error
|
|
|
124
128
|
|
|
125
129
|
After install the extension runs in **observe mode**: every tool call is checked against Ory Permissions, but a deny is recorded as a `permission.observe_deny` audit span and the tool runs anyway. This lets you see what *would* be blocked before turning on hard blocking.
|
|
126
130
|
|
|
127
|
-
1. **Turn on
|
|
131
|
+
1. **Turn on user login.** It's off by default. In your shell:
|
|
128
132
|
|
|
129
133
|
```bash
|
|
130
|
-
export
|
|
134
|
+
export ORY_USER_LOGIN=1
|
|
131
135
|
```
|
|
132
136
|
|
|
133
137
|
The next Gemini session opens a browser for PKCE login. Subsequent sessions reuse the persisted token until it expires.
|
package/dist/cli/main.js
CHANGED
|
@@ -186,7 +186,7 @@ function printQuickstart() {
|
|
|
186
186
|
console.log("Quickstart:");
|
|
187
187
|
console.log(" 1. Inside Gemini, run /ory:local-up to start a local Ory stack.");
|
|
188
188
|
console.log(" 2. Ask Gemini \"add Ory auth to this app\" to scaffold login/signup.");
|
|
189
|
-
console.log(" 3. Set
|
|
189
|
+
console.log(" 3. Set ORY_USER_LOGIN=1 to enable the interactive PKCE browser login.");
|
|
190
190
|
}
|
|
191
191
|
async function status() {
|
|
192
192
|
await (0, argus_1.runStatusCommand)("ory-gemini", "gemini-cli", {
|
package/dist/handlers.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { OryAgentClient, ensureUserAuthenticated, ensureAgentIdentity } from "@ory/argus";
|
|
2
2
|
import type { GeminiHookInput, GeminiHookOutput } from "./types.js";
|
|
3
3
|
export interface HandleHookEventDeps {
|
|
4
|
-
/** Test injection point for the user
|
|
5
|
-
|
|
4
|
+
/** Test injection point for the user login flow. */
|
|
5
|
+
userLogin?: typeof ensureUserAuthenticated;
|
|
6
6
|
/** Test injection point for the agent identity gate. */
|
|
7
7
|
agentGate?: typeof ensureAgentIdentity;
|
|
8
8
|
}
|
package/dist/handlers.js
CHANGED
|
@@ -55,7 +55,7 @@ async function handleSessionStart(input, client, deps) {
|
|
|
55
55
|
client.tracer.record("session.start", "ok", {
|
|
56
56
|
attributes: { source: input.source },
|
|
57
57
|
});
|
|
58
|
-
const userGate = deps.
|
|
58
|
+
const userGate = deps.userLogin ?? argus_1.ensureUserAuthenticated;
|
|
59
59
|
const decision = await userGate(client, {
|
|
60
60
|
binName: "ory-gemini",
|
|
61
61
|
harness: "gemini-cli",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ory/gemini-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.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.7.0"
|
|
72
72
|
},
|
|
73
73
|
"engines": {
|
|
74
74
|
"node": ">=22"
|