@ory/continue 0.11.1 → 0.12.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
@@ -1,119 +1,150 @@
1
1
  # Ory Agent Plugin: Continue CLI
2
2
 
3
- [Ory](https://ory.com) bundled into [Continue](https://continue.dev)'s `cn` CLI: skills and slash commands that scaffold Ory authentication into your codebase, a local Ory stack you can spin up in one command, and (when pointed at an Ory project) authentication, authorization, and audit for every tool Continue runs.
3
+ Security and developer experience for [Continue](https://continue.dev)'s `cn` CLI, powered by [Ory](https://ory.com).
4
4
 
5
- You don't need an Ory account or any prior Ory experience to start.
5
+ **Security.** Continue runs real actions on your machine — editing files, running shell commands, calling APIs. The plugin gives every session a verifiable identity (you sign in once; Continue and any sub-agents it spawns each get their own), checks every tool call against permissions you control, and records each decision as an audit trace you can ship to your observability stack. It starts in watch mode so nothing is blocked on day one, and if Ory is ever unreachable it steps aside rather than locking you out.
6
6
 
7
- This integration targets the **`cn` CLI** (not the Continue IDE extension) and is verified against `@continuedev/cli`.
7
+ **Developer experience.** A single command installs the plugin and walks you through connecting — choose Ory Network, a local Docker stack, or audit-only, and it wires up the project, sign-in client, login, and permissions for you. It also helps you build Ory into your own app: ask in plain language to scaffold login, registration, and recovery pages, run a local Ory, or manage identities and permissions through the bundled MCP server.
8
8
 
9
- ## New to Ory?
9
+ This targets the **`cn` CLI** (not the Continue IDE extension), verified against `@continuedev/cli`.
10
10
 
11
- [Ory](https://www.ory.com/docs/) is an open-source identity and access platform — 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:
11
+ ## What you'll need
12
12
 
13
- - **Ory Elements** are prebuilt, themeable UI components for the auth pages. The scaffolding skills wire them into your app for you.
14
- - **The local Ory stack** is a complete Ory running on your laptop in Docker — no account, no signup, no API key.
13
+ - [Continue](https://continue.dev)'s `cn` CLI, installed
14
+ - Node.js **22 or newer**
15
+ - [Docker](https://docs.docker.com/get-docker/) — only if you want to run Ory locally
16
+ - macOS or Linux (Windows works via WSL2)
15
17
 
16
- ## What this plugin does
18
+ ## Get started
17
19
 
18
- Two independent things, and you can use either on its own:
19
-
20
- 1. **Build auth into your app.** Have Continue scaffold Ory login, registration, social sign-in, and permissions into the project you're working on, backed by the local stack. This needs nothing but Docker.
21
- 2. **Govern the agent itself.** Authenticate Continue's own session and authorize every tool it runs against Ory Permissions, with a full audit trail. See [Agent security](#agent-security).
22
-
23
- ## Prerequisites
24
-
25
- - [Continue](https://continue.dev) `cn` CLI installed
26
- - Node.js **≥ 22**
27
- - [Docker](https://docs.docker.com/get-docker/) (only needed for the local Ory stack)
28
- - macOS or Linux. Windows works via WSL2.
29
-
30
- ## Install
20
+ Run one command. It installs the plugin and walks you through connecting:
31
21
 
32
22
  ```bash
33
23
  npx -y -p @ory/continue ory-continue install
34
24
  ```
35
25
 
36
- Continue has no native extension-install command, so `install` writes the Ory hooks directly into `<project>/.continue/settings.json` and materializes the Ory skills under `<project>/.continue/skills/`. Continue surfaces each skill as a slash command automatically, so the local-stack commands ship as skills too and surface as `/ory-local-up`, `/ory-local-down`, and `/ory-temporal-up`. Confirm everything landed:
26
+ Continue has no native install command, so this writes the Ory hooks into your project settings and drops the Ory skills into your project — Continue turns each skill into a slash command automatically (so the local Ory commands show up as `/ory-local-up`, `/ory-local-down`, and `/ory-temporal-up`).
37
27
 
38
- ```bash
39
- npx -y -p @ory/continue ory-continue status
40
- ```
28
+ You'll be asked how you want to connect — **press Enter for the default**:
41
29
 
42
- `status` prints configuration, user and agent identity, per-tool permission coverage, hook/skill registration, and a tail of recent debug logs. Unconfigured fields show inline as `(unset)`.
30
+ - **Ory Network** *(default)* — sign in, or create a free account, in your browser. The project, keys, permissions, and login are all set up for you. Nothing to configure by hand.
31
+ - **Local** — run a complete Ory on your laptop with Docker. No account, no signup, no keys. Great for trying it out.
32
+ - **Audit-only** — skip Ory entirely and just log what Continue does.
43
33
 
44
- Uninstall removes only the Ory hooks and skills, leaving the rest of your settings intact:
34
+ That's it. Confirm everything landed with:
45
35
 
46
36
  ```bash
47
- npx -y -p @ory/continue ory-continue uninstall
37
+ npx -y -p @ory/continue ory-continue status
48
38
  ```
49
39
 
50
- ## Quickstart (≈ 3 minutes)
40
+ `status` is your one-stop check: what's configured, who's signed in, which tools are covered by permissions, and recent activity. Anything not set up yet shows as `(unset)`.
51
41
 
52
- From any project where you'd like Ory authentication, inside Continue:
42
+ > Re-run install with `--reconfigure` to change your connection later, or `--no-configure` to skip the wizard and configure by hand.
53
43
 
54
- 1. **Start a local Ory instance.** Ask Continue *"start the local Ory stack"* or run `/ory-local-up`. A banner prints the seeded test user's email and password — note them.
55
- 2. **Scaffold Ory into your project.** Ask Continue *"add Ory auth to this app"* (the `ory-auth-setup` skill). It installs Ory Elements, wires the SDK, and generates the login / registration / recovery / settings pages, all targeting the local stack.
56
- 3. **Sign in.** Start your app, visit the login page, and sign in with the seeded credentials. You now have a real Ory session backed by a real Ory stack — locally, offline, zero configuration.
44
+ ## What you get
57
45
 
58
- That's the full Ory DX path. Continue to [Agent security](#agent-security) when you're ready to enforce.
46
+ Once connected, every tool Continue runs is governed by Ory — three things happen automatically:
59
47
 
60
- ## How the integration works
48
+ - **Who's driving.** You sign in once in your browser (a quick, secure handoff — no passwords or tokens to copy around). Continue itself registers its own identity automatically the first time it runs, and any sub-agents get their own too. The "who acted on whose behalf" trail stays queryable later.
49
+ - **What it's allowed to do.** Before a tool runs, Ory checks whether it's permitted. It starts in **watch mode** — nothing is blocked, you just *see* what would be — so it never gets in your way on day one.
50
+ - **A record of everything.** Every decision (allowed, denied, skipped) is logged as a trace you can send to Jaeger, Honeycomb, Grafana, or just a file.
61
51
 
62
- Continue runs the Ory plugin as a **subprocess hook**, the same way [Claude Code](https://github.com/anthropics/claude-code) does — and Continue reads hooks from both `.continue/settings.json` and `.claude/settings.json`. Each lifecycle event launches the hook binary with the event payload as JSON on stdin; the hook replies on stdout and signals a hard block with **exit code 2**.
52
+ If Ory is ever unreachable, the plugin gets out of the way and lets Continue keep working — so it can't lock you out.
63
53
 
64
- The hooks wire into these phases:
54
+ Under the hood, Continue runs the plugin the same way [Claude Code](https://github.com/anthropics/claude-code) does — as a small subprocess for each event — and it reads hooks from both `.continue/` and `.claude/` settings. When a tool is blocked, the plugin signals it with exit code 2 and Continue shows why.
65
55
 
66
- - **SessionStart** — run the user and agent auth gates.
67
- - **PreToolUse / PermissionRequest** — check the tool against Ory Permissions. In enforce mode a `PreToolUse` deny blocks the call with exit code 2, while a `PermissionRequest` deny is returned as a structured deny decision in the hook output. In observe mode a permission-request deny is recorded as an audit span and falls through to Continue's native user prompt — it is never pre-approved on the user's behalf.
68
- - **SubagentStart / SubagentStop** — resolve a distinct identity for typed sub-agents and record their lifecycle.
69
- - **PostToolUse / Stop / SessionEnd** — trace-only audit spans.
56
+ ### See what's happening
70
57
 
71
- The plugin is **fail-open** on its own infrastructure failures (network errors, rate limits, missing config): the agent always starts, and enforcement is only as strong as your permission grants.
58
+ Everything the plugin does is observable out of the box — no configuration required:
72
59
 
73
- ## Agent security
60
+ - **Status at a glance.** `npx -y -p @ory/continue ory-continue status` shows what's configured, who's signed in, how many built-in tools your permissions cover, and the most recent tool-call activity.
61
+ - **Live traces.** Every tool call is recorded as an OpenTelemetry-style span. Watch them stream as the agent works:
74
62
 
75
- Once pointed at an Ory project (local or hosted), Continue's session and every tool call can be governed by Ory.
63
+ ```bash
64
+ npx -y -p @ory/continue ory-continue watch
65
+ ```
76
66
 
77
- - **Authentication.** The human at the keyboard (the **user**) authenticates interactively via Ory Identities when user login is on (`ORY_USER_LOGIN=true`, off by default — browser PKCE flow on first session, persisted token thereafter). The Continue 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.
78
- - **Authorization.** Before any tool runs, the plugin checks [Ory Permissions](https://www.ory.com/docs/keto) (Zanzibar-style relations) against the user's subject and blocks on `deny`.
79
- - **Audit.** Every decision is recorded as a structured trace span (NDJSON file and/or OTLP export).
67
+ Spans are also written to `~/.config/ory-agent-plugins/continue/ory-agent-trace.ndjson` (NDJSON, one span per line) — tail that file, or point `OTEL_EXPORTER_OTLP_ENDPOINT` at a collector to ship them straight to Jaeger, Honeycomb, or Grafana.
68
+ - **Debug log.** For a verbose play-by-play, set `ORY_AGENT_DEBUG=true`; structured logs land in `~/.config/ory-agent-plugins/continue/ory-agent-debug.log`.
80
69
 
81
- ### Permission modes: observe → enforce
70
+ ### Ready to enforce?
82
71
 
83
- After install the plugin runs in **observe mode**: every tool call is checked, 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 first.
72
+ When the watch-mode logs look right, turn on blocking with one command (setup already granted you the built-in tools):
84
73
 
85
74
  ```bash
86
- # Grant the current user `use` on every built-in tool (idempotent):
87
- npx -y -p @ory/continue ory-continue permissions bootstrap
88
-
89
- # See allowed/denied per tool:
90
- npx -y -p @ory/continue ory-continue permissions status
91
-
92
- # Turn on hard blocking once the observe-mode logs look right:
93
75
  npx -y -p @ory/continue ory-continue permissions enforce
94
76
  ```
95
77
 
96
- Switch back any time with `permissions observe`. To disable Ory entirely (audit logging only, no auth or checks), run `ory-continue configure --audit-only`.
78
+ Now a denied tool is actually blocked. Go back to watch mode anytime with `permissions observe`. Use `permissions status` to see what's covered and `permissions bootstrap` to (re-)grant the built-in tools.
79
+
80
+ ## Also: add login to your own app
97
81
 
98
- ## Pointing at a real Ory project
82
+ Beyond securing Continue, the plugin helps you build Ory into whatever you're working on. Ask Continue *"add Ory login to this app"* and it scaffolds the login, registration, recovery, and settings pages (using [Ory Elements](https://github.com/ory/elements)) wired to a local Ory — no signup or keys needed. Start that local Ory with `/ory-local-up` (it prints a test email + password to sign in with) and tear it down with `/ory-local-down`.
99
83
 
100
- The Quickstart uses the local stack. To point at a hosted [Ory Network](https://console.ory.sh) project:
84
+ Bundled **skills** (just ask in plain language, and Continue surfaces each as a slash command) cover more: `ory-auth-setup`, `ory-login-flow`, `ory-social-login` (Google, GitHub, Apple…), `ory-permissions-onboarding`, and playbooks for wiring Ory into your own agents, E2B sandboxes, or Temporal workers.
85
+
86
+ ## Configure by hand (CI / advanced)
87
+
88
+ The guided setup covers most people. For scripted or CI setups, or to point at an existing Ory Network project, configure directly. Settings are saved to `~/.config/ory-agent-plugins/config.json` and shared across all your Ory agent plugins; environment variables win when both are set.
101
89
 
102
90
  ```bash
103
91
  npx -y -p @ory/continue ory-continue configure \
104
- --project-url https://<id>.projects.oryapis.com \
105
- --oauth2-client-id <public OAuth2 client id>
92
+ --project-url https://<slug>.projects.oryapis.com \
93
+ --oauth2-client-id <login client id> \
94
+ --user-login
106
95
  ```
107
96
 
108
- `--oauth2-client-id` is required whenever `--project-url` is set — the user PKCE flow needs a public OAuth2 client registered with the four loopback redirect URIs (`http://127.0.0.1:47823..47826/callback`). See the [repo README](../../README.md) and [`AGENTS.md`](../../AGENTS.md) for the full environment-variable reference (`ORY_PROJECT_URL`, `ORY_USER_LOGIN`, `ORY_OAUTH2_CLIENT_ID`, agent-identity vars) and permission-mode semantics. Config is shared across every Ory agent plugin at `~/.config/ory-agent-plugins/config.json`.
97
+ Continue's own identity registers itself automatically on first run — nothing to create. The `--oauth2-client-id` is the one piece browser sign-in needs; the guided setup makes it for you, or see below to do it by hand. For logging-only with no checks, use `--audit-only`.
98
+
99
+ <details>
100
+ <summary>Create the sign-in client by hand</summary>
101
+
102
+ The guided setup normally does this. To do it yourself, create a **public** OAuth2 client (no secret) listing all four loopback URLs — the plugin tries each in turn so sign-in survives a busy port:
103
+
104
+ ```bash
105
+ ory create oauth2-client --project <project-id> \
106
+ --name "ory-agent-plugin" \
107
+ --grant-type authorization_code,refresh_token \
108
+ --response-type code \
109
+ --scope openid,offline_access \
110
+ --token-endpoint-auth-method none \
111
+ --redirect-uri http://127.0.0.1:47823/callback \
112
+ --redirect-uri http://127.0.0.1:47824/callback \
113
+ --redirect-uri http://127.0.0.1:47825/callback \
114
+ --redirect-uri http://127.0.0.1:47826/callback
115
+ ```
116
+
117
+ Pass the resulting id to `configure --oauth2-client-id`. Running headless with a session token already? Set `ORY_USER_SESSION_TOKEN` and skip the browser step entirely.
118
+
119
+ </details>
120
+
121
+ With nothing configured, the plugin still loads and runs in **pass-through mode**: skills and their slash commands work, but no checks run and nothing is blocked. Perfectly fine if you only want the app-building features.
122
+
123
+ ## Commands
124
+
125
+ ```
126
+ ory-continue install | uninstall Install/remove; --reconfigure re-runs setup, --no-configure skips it
127
+ ory-continue status Show configuration, identities, permission coverage, recent activity
128
+ ory-continue watch Tail the live trace stream (OTel spans)
129
+ ory-continue permissions <cmd> status | bootstrap | observe (watch) | enforce (block)
130
+ ory-continue configure <flags> Point at a project by hand (--project-url, --oauth2-client-id, --user-login, --audit-only)
131
+ ory-continue agent <status|unregister> Manage Continue's own auto-created identity
132
+ ```
133
+
134
+ All prefixed with `npx -y -p @ory/continue`.
135
+
136
+ ## Troubleshooting
109
137
 
110
- Without configuration the plugin still loads cleanly and runs in **pass-through mode**: skills and their slash commands work, but nothing is blocked.
138
+ - **`/ory-local-up` fails** — make sure Docker is running and ports `4000`, `4100`, `4455`, and `16686` are free.
139
+ - **Browser sign-in loops** — reset with `ory-continue agent unregister` and try again.
140
+ - **`npx` grabbed an old version** — force the latest: `npx -y -p @ory/continue@latest ory-continue …`.
141
+ - **Hooks stuck on an old version** — re-run the installer.
142
+ - **Want to see what's happening** — `npx -y -p @ory/continue ory-continue status` for a snapshot, `npx -y -p @ory/continue ory-continue watch` for the live trace stream, or set `ORY_AGENT_DEBUG=true` for a verbose log. Traces and logs live under `~/.config/ory-agent-plugins/continue/` (see [See what's happening](#see-whats-happening)).
111
143
 
112
- ## Links
144
+ ## Learn more
113
145
 
114
- - [Ory documentation](https://www.ory.com/docs/)
146
+ - [Ory documentation](https://www.ory.com/docs/) · [Ory Console](https://console.ory.sh) · [Ory Elements](https://github.com/ory/elements)
115
147
  - [Continue documentation](https://docs.continue.dev/)
116
- - [Repo README](../../README.md) and [AGENTS.md](../../AGENTS.md) — full env-var and permission-mode reference
117
148
 
118
149
  ## License
119
150
 
package/dist/cli/main.js CHANGED
@@ -56,14 +56,19 @@ function main() {
56
56
  const [command, ...args] = process.argv.slice(2);
57
57
  switch (command) {
58
58
  case "install":
59
+ (0, argus_1.beginDeferNextSteps)();
59
60
  install(args);
60
- postInstallPermissions("ory-continue", "continue").then(() => process.exit(0), (err) => {
61
+ (0, argus_1.runPostInstall)("ory-continue", "continue", args).then(() => process.exit(0), (err) => {
61
62
  console.error(err.message ?? err);
62
63
  process.exit(1);
63
64
  });
64
65
  break;
65
66
  case "uninstall":
66
67
  uninstall(args);
68
+ (0, argus_1.clearCredentialsForUninstall)().then(() => process.exit(0), (err) => {
69
+ console.error(err.message ?? err);
70
+ process.exit(1);
71
+ });
67
72
  break;
68
73
  case "configure":
69
74
  (0, argus_1.runConfigureCommand)("ory-continue", args);
@@ -95,6 +100,9 @@ function main() {
95
100
  process.exit(1);
96
101
  });
97
102
  break;
103
+ case "watch":
104
+ (0, argus_1.runWatchCommand)("continue", args);
105
+ break;
98
106
  case "help":
99
107
  case "--help":
100
108
  case "-h":
@@ -124,12 +132,6 @@ function uninstall(args) {
124
132
  process.argv = ["node", "setup.js", ...setupArgs];
125
133
  require("./setup.js");
126
134
  }
127
- async function postInstallPermissions(binName, harness) {
128
- const bootstrapped = await (0, argus_1.maybeAutoBootstrap)(binName, harness);
129
- (0, argus_1.printPermissionsOnboardingHelp)(binName, harness, {
130
- bootstrappedAutomatically: bootstrapped,
131
- });
132
- }
133
135
  /**
134
136
  * Print a three-line quickstart so a fresh user sees the happy path
135
137
  * before the more detailed credentials and permissions banners scroll by.
@@ -156,7 +158,7 @@ function help() {
156
158
  ory-continue — Ory plugin for Continue CLI (cn)
157
159
 
158
160
  Usage:
159
- npx ory-continue <command> [options]
161
+ npx -y -p @ory/continue ory-continue <command> [options]
160
162
 
161
163
  Commands:
162
164
  install Write Ory hooks and skills into .continue/
@@ -166,6 +168,7 @@ Commands:
166
168
  permissions <cmd> Manage permission mode and tool permissions (status, bootstrap, observe, enforce)
167
169
  setup [--project-dir] Write hooks directly to .continue/settings.json
168
170
  status Show plugin status and configuration
171
+ watch [trace-file] Tail the trace stream (OTel spans) live
169
172
  local <cmd> Manage local Ory dev environment (up, down, status, seed, ...)
170
173
 
171
174
  After installing, the plugin hooks into these Continue CLI lifecycle events:
@@ -174,9 +177,9 @@ After installing, the plugin hooks into these Continue CLI lifecycle events:
174
177
  PostToolUse Audit log tool executions
175
178
 
176
179
  Examples:
177
- npx ory-continue install # Install hooks + assets
178
- npx ory-continue status # Check configuration
179
- npx ory-continue uninstall # Remove hooks + assets
180
+ npx -y -p @ory/continue ory-continue install # Install hooks + assets
181
+ npx -y -p @ory/continue ory-continue status # Check configuration
182
+ npx -y -p @ory/continue ory-continue uninstall # Remove hooks + assets
180
183
  `);
181
184
  }
182
185
  main();
package/dist/cli/setup.js CHANGED
@@ -109,6 +109,18 @@ function main() {
109
109
  (0, assets_js_1.installContinueOryAssets)(continueDir);
110
110
  console.log(`Ory hooks and MCP server installed to ${settingsPath}`);
111
111
  console.log(`Ory skills installed to ${continueDir}`);
112
- (0, argus_1.printNextSteps)("Continue CLI", "npx ory-continue-setup --uninstall");
112
+ (0, argus_1.printNextSteps)("Continue CLI", "npx -y -p @ory/continue ory-continue-setup --uninstall", {
113
+ binName: "ory-continue",
114
+ harness: "continue",
115
+ });
113
116
  }
114
117
  main();
118
+ // When invoked directly as the `-setup` bin with `--uninstall`, also clear
119
+ // stored Ory credentials. When required by the plugin's main CLI, that
120
+ // command owns the purge, so the `require.main` guard prevents a double run.
121
+ if (require.main === module && process.argv.includes("--uninstall")) {
122
+ (0, argus_1.clearCredentialsForUninstall)().then(() => process.exit(0), (err) => {
123
+ console.error(err.message ?? err);
124
+ process.exit(1);
125
+ });
126
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ory/continue",
3
- "version": "0.11.1",
3
+ "version": "0.12.0",
4
4
  "description": "Ory plugin for Continue CLI (cn): 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",
@@ -67,7 +67,7 @@
67
67
  "!dist/**/*.tsbuildinfo"
68
68
  ],
69
69
  "dependencies": {
70
- "@ory/argus": "0.11.1"
70
+ "@ory/argus": "0.12.0"
71
71
  },
72
72
  "engines": {
73
73
  "node": ">=22"