@rayrun/cli 0.1.0 → 0.4.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,6 +1,7 @@
1
1
  # @rayrun/cli
2
2
 
3
- Connect supported MCP clients to a Rayrun workspace endpoint without copying configuration by hand.
3
+ Connect supported MCP clients, execute approved tools through OAuth, and manage Rayrun through its
4
+ public API.
4
5
 
5
6
  ```sh
6
7
  pnpm --package @rayrun/cli@latest dlx rayrun setup https://copy-the-endpoint-from-rayrun.example/mcp
@@ -22,3 +23,91 @@ rayrun setup rollback <backup-id>
22
23
  Use `--project` for project-local configuration in Claude Code, Codex, Cursor, VS Code, Devin, and OpenCode. Legacy Windsurf remains user-scoped. Claude Code asks you to approve a project MCP server when that project opens. Codex loads `.codex/config.toml` only after you trust the project; restart Codex after doing so.
23
24
 
24
25
  Interactive setup runs supported clients' OAuth login commands. `--yes` and non-interactive setup never launch login unless you explicitly pass `--login`; the command prints the exact login command when it skips one. Pass `--no-login` to make the choice explicit in scripts.
26
+
27
+ ## Execute tools
28
+
29
+ Execution commands connect to `https://ray.run/mcp/direct` and authenticate the person in a browser
30
+ with OAuth. They do not use `RAYRUN_API_KEY`. Override the endpoint with `--endpoint` or
31
+ `RAYRUN_MCP_URL` for a local or self-hosted Rayrun gateway.
32
+
33
+ ```sh
34
+ rayrun tools describe linear.create_issue
35
+ rayrun call linear.create_issue '{"title":"Fix the release"}'
36
+ rayrun call linear.create_issue --input arguments.json
37
+ ```
38
+
39
+ Tool names are service-qualified and must match the Direct Mode catalog exactly. Use `--input -` to
40
+ read a JSON object from stdin, `--json` for machine-readable output, and `--no-open` to print browser
41
+ URLs without launching them.
42
+
43
+ If an exact call needs approval or a service authorization, the CLI opens the authenticated Rayrun
44
+ page and saves a private continuation:
45
+
46
+ ```text
47
+ Execution paused: 12345678-1234-1234-1234-123456789abc
48
+ Resume: rayrun resume --execution-id 12345678-1234-1234-1234-123456789abc
49
+ ```
50
+
51
+ Approve in the browser, then run the printed command. `resume` replays only the saved call with the
52
+ server-issued continuation state; its `accept` response cannot authorize the call without the
53
+ authenticated browser decision. Pending files can contain the exact tool arguments and are stored
54
+ under `~/.rayrun/execution/pending`. The resume window expires after 10 minutes; expired files are
55
+ pruned by the next execution command and are also removed by `rayrun logout`. OAuth refresh tokens
56
+ use the same account-private storage. `RAYRUN_CONFIG_HOME` must use a local, per-host filesystem.
57
+ POSIX systems enforce `0700` directories and `0600` files. On Windows, execution storage must remain
58
+ inside the current user profile and inherits that profile's ACL. `logout` removes tokens locally and
59
+ attempts token revocation.
60
+
61
+ Execution lock errors print the exact generation file to remove if a process crashed and its PID was
62
+ reused. Remove that file only after verifying that no Rayrun CLI execution command is still running.
63
+
64
+ ## Manage a workspace
65
+
66
+ Create a scoped key in **Dashboard → Settings → API keys**, then export it without putting it in a
67
+ command argument or configuration file. `RAYRUN_API_URL` is optional and defaults to
68
+ `https://ray.run`.
69
+
70
+ ```sh
71
+ export RAYRUN_API_KEY='rak_...'
72
+
73
+ rayrun connect mcp https://mcp.example.com --name 'Internal tools'
74
+ rayrun connect openapi https://api.example.com/openapi.json --name 'Example API'
75
+ rayrun connections list
76
+ rayrun clients list
77
+ rayrun tools search create issue --connection <connection-uid>
78
+ rayrun policy inspect <client-uid> --query issue
79
+ rayrun approvals list
80
+ rayrun activity list
81
+ ```
82
+
83
+ List commands show a compact table. Add `--json` for stable machine-readable output, `--limit` to
84
+ request up to 100 rows, and `--cursor` with the printed next cursor to continue. The CLI calls the
85
+ same hosted API and policy evaluator as the dashboard; it does not run a local gateway or store API
86
+ keys.
87
+
88
+ ## Author hosted tool hooks
89
+
90
+ Use a full-control API key. Hook source executes in Rayrun’s hosted sandbox, not in the CLI process.
91
+
92
+ ```sh
93
+ rayrun hooks pull <connection-uid> <tool-uid> \
94
+ --output hook.ts --types-output rayrun-hooks.d.ts
95
+
96
+ rayrun hooks test <connection-uid> <tool-uid> \
97
+ --file hook.ts --arguments '{"query":"release"}' --mock-result '{"items":[]}'
98
+
99
+ rayrun hooks deploy <connection-uid> <tool-uid> --file hook.ts --shadow
100
+ rayrun hooks logs <connection-uid> <tool-uid>
101
+ rayrun hooks rollback <connection-uid> <tool-uid> <revision-uid>
102
+ rayrun hooks deactivate <connection-uid> <tool-uid> --shadow
103
+ ```
104
+
105
+ `pull` can write the draft and generated TypeScript declarations separately. `test` compiles and
106
+ runs before plus an optional after stage using your mock result; it never contacts the upstream.
107
+ `deploy` saves `--file` and optional `--config` before creating an immutable revision. Omit `--shadow`
108
+ to deploy active. Rollback and deactivate default to active and accept `--shadow` for the shadow
109
+ pointer. Hook log payloads appear only when the service’s payload-capture setting is enabled; timing,
110
+ outcome, revision, request correlation, and the shadow changed/unchanged signal remain available
111
+ either way. Captured messages, structured data, and errors require a full-control key. Use
112
+ `hooks logs --json` for the full-fidelity retained record. Compiler errors include hook.ts line and
113
+ column diagnostics.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rayrun/cli",
3
- "version": "0.1.0",
4
- "description": "Safely connect local MCP clients to Rayrun",
3
+ "version": "0.4.0",
4
+ "description": "Set up MCP clients, execute tools, and manage Rayrun from the command line",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -15,7 +15,10 @@
15
15
  "index.js",
16
16
  "src/clients.js",
17
17
  "src/config.js",
18
+ "src/execution.js",
18
19
  "src/main.js",
20
+ "src/management.js",
21
+ "src/oauth.js",
19
22
  "src/setup.js",
20
23
  "README.md",
21
24
  "LICENSE"
@@ -24,10 +27,9 @@
24
27
  "publishConfig": {
25
28
  "access": "public"
26
29
  },
27
- "scripts": {
28
- "test": "vitest run"
29
- },
30
30
  "dependencies": {
31
+ "@modelcontextprotocol/client": "2.0.0",
32
+ "@rayrun/sdk": "^0.5.0",
31
33
  "jsonc-parser": "^3.3.1",
32
34
  "smol-toml": "^1.8.0"
33
35
  },
@@ -36,5 +38,8 @@
36
38
  },
37
39
  "engines": {
38
40
  "node": ">=20"
41
+ },
42
+ "scripts": {
43
+ "test": "vitest run"
39
44
  }
40
- }
45
+ }