@ory/claude-code 0.2.1 → 0.3.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 +23 -32
- package/dist/handlers.js +16 -8
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -16,50 +16,39 @@ You don't need an Ory account or any prior Ory experience to start.
|
|
|
16
16
|
Inside Claude Code:
|
|
17
17
|
|
|
18
18
|
```
|
|
19
|
-
/plugin
|
|
19
|
+
/plugin marketplace add ory/claude-plugins
|
|
20
|
+
/plugin install ory-agent-plugin@ory
|
|
20
21
|
```
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
Skills, slash commands, hooks, and the Ory MCP server are now registered. Verify with `/plugin list`.
|
|
23
24
|
|
|
24
25
|
<details>
|
|
25
|
-
<summary>Alternative install
|
|
26
|
-
|
|
27
|
-
If the public marketplace install above isn't available, either of these registers the same plugin:
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
# Ory-hosted marketplace
|
|
31
|
-
/plugin marketplace add ory/claude-plugins
|
|
32
|
-
/plugin install ory-agent-plugin@ory-plugins
|
|
33
|
-
```
|
|
26
|
+
<summary>Alternative install path (no Claude Code session required)</summary>
|
|
34
27
|
|
|
35
28
|
```bash
|
|
36
|
-
# Direct installer
|
|
37
|
-
npx @ory/claude-code install # current project
|
|
38
|
-
npx @ory/claude-code install --global # all projects (user scope)
|
|
39
|
-
npx @ory/claude-code uninstall
|
|
29
|
+
# Direct installer — registers the marketplace and installs the plugin via the claude CLI.
|
|
30
|
+
npx -y -p @ory/claude-code ory-claude install # current project
|
|
31
|
+
npx -y -p @ory/claude-code ory-claude install --global # all projects (user scope)
|
|
32
|
+
npx -y -p @ory/claude-code ory-claude uninstall
|
|
40
33
|
```
|
|
41
34
|
|
|
35
|
+
The installer requires the `claude` CLI on `PATH`. After it finishes, run `ory-claude status` to confirm the plugin is registered.
|
|
36
|
+
|
|
42
37
|
</details>
|
|
43
38
|
|
|
44
39
|
## Quickstart (≈ 3 minutes)
|
|
45
40
|
|
|
46
41
|
From any project where you'd like Ory authentication, inside Claude Code:
|
|
47
42
|
|
|
48
|
-
1. **Start a local Ory instance.** Ask Claude *"start the local Ory stack"* or run:
|
|
43
|
+
1. **Start a local Ory instance.** Ask Claude *"start the local Ory stack"* or run the slash command:
|
|
49
44
|
|
|
50
45
|
```
|
|
51
|
-
/ory:local-up
|
|
46
|
+
/ory-agent-plugin:local-up
|
|
52
47
|
```
|
|
53
48
|
|
|
54
49
|
A banner prints the seeded test user's email and password. Note them — you'll log in with them in step 3.
|
|
55
50
|
|
|
56
|
-
2. **Scaffold Ory into your project.** Ask Claude *"add Ory auth to this app"
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
/ory:auth-setup
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
Claude installs Ory Elements, wires the SDK, generates the login / registration / recovery / verification / settings pages, and sets up session middleware. It targets the local stack from step 1, so no signup or API key is needed.
|
|
51
|
+
2. **Scaffold Ory into your project.** Ask Claude *"add Ory auth to this app"*. The `ory-auth-setup` skill takes over: it installs Ory Elements, wires the SDK, generates the login / registration / recovery / verification / settings pages, and sets up session middleware. It targets the local stack from step 1, so no signup or API key is needed.
|
|
63
52
|
|
|
64
53
|
3. **Sign in.** Start your app, visit the login page Claude 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.
|
|
65
54
|
|
|
@@ -69,12 +58,13 @@ That's the full Ory DX path. Stop here if you're just evaluating the plugin. Con
|
|
|
69
58
|
|
|
70
59
|
### Skills for scaffolding Ory into your application
|
|
71
60
|
|
|
72
|
-
Each skill is a vetted, end-to-end playbook.
|
|
61
|
+
Each skill is a vetted, end-to-end playbook. Skills are model-invoked — ask Claude in natural language and the matching skill takes over.
|
|
73
62
|
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
63
|
+
- **`ory-auth-setup`** *(e.g. "set up Ory auth in this project")* — 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.
|
|
64
|
+
- **`ory-login-flow`** *(e.g. "add login and registration pages with Ory Elements")* — login, registration, recovery, verification, and settings pages with Ory Elements. Next.js App Router and React SPA variants.
|
|
65
|
+
- **`ory-social-login`** *(e.g. "add Google sign-in via Ory")* — Google, GitHub, Apple, Microsoft, Discord, and other OIDC providers with Jsonnet data mappers.
|
|
66
|
+
- **`ory-local-dev`** *(e.g. "run the local Ory stack")* — drive the local Ory stack from within Claude to prototype and test without a remote project.
|
|
67
|
+
- **`ory-permissions-onboarding`** *(e.g. "grant me use on the Bash tool")* — walk through writing the Ory Permissions tuples that let the plugin enforce per-tool access.
|
|
78
68
|
|
|
79
69
|
### Ory MCP server
|
|
80
70
|
|
|
@@ -83,8 +73,8 @@ Bundled and registered automatically. Exposes the Ory CLI and the Ory Network RE
|
|
|
83
73
|
### Local Ory stack
|
|
84
74
|
|
|
85
75
|
```
|
|
86
|
-
/ory:local-up # start a local Ory instance in Docker
|
|
87
|
-
/ory:local-down # tear it all down
|
|
76
|
+
/ory-agent-plugin:local-up # start a local Ory instance in Docker
|
|
77
|
+
/ory-agent-plugin:local-down # tear it all down
|
|
88
78
|
```
|
|
89
79
|
|
|
90
80
|
`local-up` brings up Ory Identities, OAuth2, and Permissions, plus a login UI on `:3000` and Jaeger on `:16686`, all reachable through `http://localhost:4000`. A test user identity is seeded and the credentials are printed for you. Use it to:
|
|
@@ -174,9 +164,10 @@ Highlights:
|
|
|
174
164
|
|
|
175
165
|
## Troubleshooting
|
|
176
166
|
|
|
177
|
-
- **`/ory:local-up` fails.** Make sure Docker is running and ports `3000`, `4000`, `4100`, and `16686` are free.
|
|
167
|
+
- **`/ory-agent-plugin:local-up` fails.** Make sure Docker is running and ports `3000`, `4000`, `4100`, and `16686` are free.
|
|
178
168
|
- **PKCE login loops.** Clear persisted state with `npx -y -p @ory/claude-code ory-claude agent unregister` and retry.
|
|
179
169
|
- **`npx` fetches an old version.** Force a fresh fetch: `npx -y -p @ory/claude-code@latest ory-claude …`.
|
|
170
|
+
- **Hooks pinned to an old plugin version.** After a plugin upgrade, run `/plugin marketplace update ory` inside Claude Code (or re-run the npx installer) so the hook commands and MCP server pick up the new release.
|
|
180
171
|
- **Need more signal.** Set `ORY_AGENT_DEBUG=true` and `ORY_AGENT_LOG_FILE=/tmp/ory.log` to capture structured logs.
|
|
181
172
|
|
|
182
173
|
## Links
|
package/dist/handlers.js
CHANGED
|
@@ -198,23 +198,27 @@ async function handlePreToolUse(input, client, deps = {}) {
|
|
|
198
198
|
object: mcpTool.serverName,
|
|
199
199
|
relation: "use",
|
|
200
200
|
subjectId,
|
|
201
|
+
...("subjectSet" in subject ? { subjectSet: subject.subjectSet } : {}),
|
|
201
202
|
spanAttributes: mcpAttrs,
|
|
202
203
|
});
|
|
204
|
+
const decisionAttrs = decision.spanAttributes;
|
|
203
205
|
if (decision.kind === "allow") {
|
|
204
|
-
client.tracer.record("tool.invoke", "ok", {
|
|
206
|
+
client.tracer.record("tool.invoke", "ok", {
|
|
207
|
+
attributes: { ...mcpAttrs, ...decisionAttrs },
|
|
208
|
+
});
|
|
205
209
|
return {};
|
|
206
210
|
}
|
|
207
211
|
if (decision.kind === "observe") {
|
|
208
212
|
client.tracer.record("tool.block", "denied", {
|
|
209
|
-
attributes: { ...mcpAttrs, allowed: false, ...(0, argus_1.alertAttributes)(false) },
|
|
213
|
+
attributes: { ...mcpAttrs, ...decisionAttrs, allowed: false, ...(0, argus_1.alertAttributes)(false) },
|
|
210
214
|
});
|
|
211
215
|
client.tracer.record("tool.invoke", "ok", {
|
|
212
|
-
attributes: { ...mcpAttrs, allowed: false, observed: true },
|
|
216
|
+
attributes: { ...mcpAttrs, ...decisionAttrs, allowed: false, observed: true },
|
|
213
217
|
});
|
|
214
218
|
return {};
|
|
215
219
|
}
|
|
216
220
|
client.tracer.record("tool.block", "denied", {
|
|
217
|
-
attributes: { ...mcpAttrs, allowed: false, ...(0, argus_1.alertAttributes)(true) },
|
|
221
|
+
attributes: { ...mcpAttrs, ...decisionAttrs, allowed: false, ...(0, argus_1.alertAttributes)(true) },
|
|
218
222
|
});
|
|
219
223
|
return {
|
|
220
224
|
decision: "block",
|
|
@@ -227,21 +231,24 @@ async function handlePreToolUse(input, client, deps = {}) {
|
|
|
227
231
|
return handlePermissionError(decision.error, toolName, client);
|
|
228
232
|
}
|
|
229
233
|
const attrs = { toolName, ...inputSummary };
|
|
234
|
+
const decisionAttrs = decision.spanAttributes;
|
|
230
235
|
if (decision.kind === "allow") {
|
|
231
|
-
client.tracer.record("tool.invoke", "ok", {
|
|
236
|
+
client.tracer.record("tool.invoke", "ok", {
|
|
237
|
+
attributes: { ...attrs, ...decisionAttrs, allowed: true },
|
|
238
|
+
});
|
|
232
239
|
return {};
|
|
233
240
|
}
|
|
234
241
|
if (decision.kind === "observe") {
|
|
235
242
|
client.tracer.record("tool.block", "denied", {
|
|
236
|
-
attributes: { ...attrs, allowed: false, ...(0, argus_1.alertAttributes)(false) },
|
|
243
|
+
attributes: { ...attrs, ...decisionAttrs, allowed: false, ...(0, argus_1.alertAttributes)(false) },
|
|
237
244
|
});
|
|
238
245
|
client.tracer.record("tool.invoke", "ok", {
|
|
239
|
-
attributes: { ...attrs, allowed: false, observed: true },
|
|
246
|
+
attributes: { ...attrs, ...decisionAttrs, allowed: false, observed: true },
|
|
240
247
|
});
|
|
241
248
|
return {};
|
|
242
249
|
}
|
|
243
250
|
client.tracer.record("tool.block", "denied", {
|
|
244
|
-
attributes: { ...attrs, allowed: false, ...(0, argus_1.alertAttributes)(true) },
|
|
251
|
+
attributes: { ...attrs, ...decisionAttrs, allowed: false, ...(0, argus_1.alertAttributes)(true) },
|
|
245
252
|
});
|
|
246
253
|
return {
|
|
247
254
|
decision: "block",
|
|
@@ -383,6 +390,7 @@ async function handlePermissionRequest(input, client) {
|
|
|
383
390
|
object: mcpTool.serverName,
|
|
384
391
|
relation: "use",
|
|
385
392
|
subjectId,
|
|
393
|
+
...("subjectSet" in subject ? { subjectSet: subject.subjectSet } : {}),
|
|
386
394
|
spanAttributes: { toolName, mcpServer: mcpTool.serverName, mcpTool: mcpTool.toolName },
|
|
387
395
|
});
|
|
388
396
|
if (decision.kind === "deny") {
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ory/claude-code",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Ory plugin for Claude Code: scaffolding skills, a local Ory instance, and authentication, authorization, and audit for every tool call",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
-
"homepage": "https://
|
|
6
|
+
"homepage": "https://github.com/ory/claude-plugins/tree/master/plugins/ory-agent-plugin",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/ory/claude-plugins/issues"
|
|
9
|
+
},
|
|
7
10
|
"keywords": [
|
|
8
11
|
"ory",
|
|
9
12
|
"claude",
|
|
@@ -72,7 +75,7 @@
|
|
|
72
75
|
"!dist/**/*.tsbuildinfo"
|
|
73
76
|
],
|
|
74
77
|
"dependencies": {
|
|
75
|
-
"@ory/argus": "0.
|
|
78
|
+
"@ory/argus": "0.3.0"
|
|
76
79
|
},
|
|
77
80
|
"engines": {
|
|
78
81
|
"node": ">=24"
|