@ory/gemini-cli 0.6.2 → 0.7.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
@@ -57,13 +57,13 @@ From any project where you'd like Ory authentication, inside Gemini CLI:
57
57
 
58
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.
59
59
 
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 — set:
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:
61
61
 
62
62
  ```bash
63
- export ORY_AUTH_GATE=1
63
+ export ORY_USER_LOGIN=1
64
64
  ```
65
65
 
66
- Then restart Gemini CLI. On next session start, Gemini opens an Ory login in your browser; sign in with the same seeded credentials from step 1. This is what makes `permissions enforce` (see [Agent security](#agent-security)) deny on the right identity later.
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.
67
67
 
68
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.
69
69
 
@@ -118,7 +118,7 @@ Without configuration the extension still loads cleanly and runs in **pass-throu
118
118
 
119
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.
120
120
 
121
- - **Authentication.** Two identities. The human at the keyboard (the **user**) authenticates interactively via Ory Identities when `ORY_AUTH_GATE=1` is set. 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.
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.
122
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.
123
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.
124
124
 
@@ -128,10 +128,10 @@ The extension is **fail-open** on its own infrastructure failures (network error
128
128
 
129
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.
130
130
 
131
- 1. **Turn on the user gate.** In your shell:
131
+ 1. **Turn on user login.** It's off by default. In your shell:
132
132
 
133
133
  ```bash
134
- export ORY_AUTH_GATE=1
134
+ export ORY_USER_LOGIN=1
135
135
  ```
136
136
 
137
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 ORY_AUTH_GATE=1 when you're ready for the PKCE login gate.");
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", {
@@ -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 auth gate. */
5
- authGate?: typeof ensureUserAuthenticated;
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.authGate ?? argus_1.ensureUserAuthenticated;
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.6.2",
3
+ "version": "0.7.1",
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.6.2"
71
+ "@ory/argus": "0.7.1"
72
72
  },
73
73
  "engines": {
74
74
  "node": ">=22"