Skip to content

Commit ff3aafd

Browse files
authored
Merge pull request #15 from getlark/jb-improve-arg-handling
Better arg parsing + docs update
2 parents dc9a9f4 + 929317d commit ff3aafd

13 files changed

Lines changed: 129 additions & 50 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ npm run build
104104
- LLM tests also create sandboxes by default and require `E2B_API_KEY` plus the relevant provider credentials such as `OPENAI_API_KEY` or `ANTHROPIC_API_KEY`.
105105
- If you already have a runtime server running, set `TEST_WS_URL` to reuse it instead of creating a fresh sandbox.
106106
- Some LLM tests also require `TEST_S3_BUCKET` for artifact upload verification.
107-
- If you want sandbox tests to run against a dev build instead of `npx -y runtimeuse`, set `RUNTIMEUSE_RUN_COMMAND`. A convenient way to get that command is `packages/runtimeuse` -> `npm run dev-publish`.
107+
- If you want sandbox tests to run against a dev build instead of `npx -y runtimeuse@latest`, set `RUNTIMEUSE_RUN_COMMAND`. A convenient way to get that command is `packages/runtimeuse` -> `npm run dev-publish`.
108108

109109
## Docs Development
110110

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Run AI agents inside sandboxes and communicate with them over WebSocket.
1515

1616
```bash
1717
export OPENAI_API_KEY=your_openai_api_key
18-
npx -y runtimeuse
18+
npx -y runtimeuse@latest
1919
```
2020

2121
This starts a WebSocket server on port 8080 using the default OpenAI handler. For fuller Claude-based sandbox examples, see [`examples/`](./examples).

docs/content/docs/agent-runtime.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ The [agent runtime](https://www.npmjs.com/package/runtimeuse) is the process tha
88
## CLI
99

1010
```bash
11-
npx -y runtimeuse # OpenAI handler on port 8080
12-
npx -y runtimeuse --agent claude # Claude handler
13-
npx -y runtimeuse --port 3000 # custom port
14-
npx -y runtimeuse --handler ./my-handler.js # custom handler entrypoint
11+
npx -y runtimeuse@latest # OpenAI handler on port 8080
12+
npx -y runtimeuse@latest --agent claude # Claude handler
13+
npx -y runtimeuse@latest --port 3000 # custom port
14+
npx -y runtimeuse@latest --handler ./my-handler.js # custom handler entrypoint
1515
```
1616

1717
## Built-in Handlers
@@ -25,7 +25,7 @@ Requires `OPENAI_API_KEY` to be set in the environment. The handler runs the age
2525

2626
```bash
2727
export OPENAI_API_KEY=your_openai_api_key
28-
npx -y runtimeuse
28+
npx -y runtimeuse@latest
2929
```
3030

3131
### Claude Handler
@@ -37,7 +37,7 @@ npm install -g @anthropic-ai/claude-code
3737
export ANTHROPIC_API_KEY=your_anthropic_api_key
3838
export IS_SANDBOX=1
3939
export CLAUDE_SKIP_ROOT_CHECK=1
40-
npx -y runtimeuse --agent claude
40+
npx -y runtimeuse@latest --agent claude
4141
```
4242

4343
## Programmatic Startup

docs/content/docs/quickstart.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
1212
```bash
1313
npm install -g @anthropic-ai/claude-code
1414
export ANTHROPIC_API_KEY=your_anthropic_api_key
15-
npx -y runtimeuse --agent claude
15+
npx -y runtimeuse@latest --agent claude
1616
```
1717

1818
This starts the Claude Code agent on port `8080`. To use OpenAI agent instead:
1919
```bash
2020
export OPENAI_API_KEY=your_openai_api_key
21-
npx -y runtimeuse
21+
npx -y runtimeuse@latest
2222
```
2323

2424
```python
@@ -47,7 +47,7 @@ import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
4747
"CLAUDE_SKIP_ROOT_CHECK": "1",
4848
}
4949
)
50-
.set_start_cmd("npx -y runtimeuse --agent claude", wait_for_port(8080))
50+
.set_start_cmd("npx -y runtimeuse@latest --agent claude", wait_for_port(8080))
5151
)
5252

5353
sandbox = Sandbox.create(template="runtimeuse-quickstart-claude", api_key=e2b_api_key)
@@ -95,7 +95,7 @@ import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
9595
sandbox.process.execute_session_command(
9696
"runtimeuse",
9797
SessionExecuteRequest(
98-
command="npx -y runtimeuse --agent claude",
98+
command="npx -y runtimeuse@latest --agent claude",
9999
run_async=True,
100100
),
101101
)

docs/public/terminal.svg

Lines changed: 1 addition & 1 deletion
Loading

examples/daytona-quickstart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ async def _start_server_and_wait(sandbox: Sandbox) -> str:
102102
exec_resp = sandbox.process.execute_session_command(
103103
_SESSION_ID,
104104
SessionExecuteRequest(
105-
command=f"npx -y runtimeuse --agent claude",
105+
command=f"npx -y runtimeuse@latest --agent claude",
106106
run_async=True,
107107
),
108108
)

examples/e2b-quickstart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def _get_env_or_fail(name: str) -> str:
3838

3939
def _create_template_with_alias(alias: str):
4040
anthropic_api_key = _get_env_or_fail("ANTHROPIC_API_KEY")
41-
start_cmd = "npx -y runtimeuse --agent claude"
41+
start_cmd = "npx -y runtimeuse@latest --agent claude"
4242

4343
template = (
4444
Template()

packages/runtimeuse-client-python/.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ OPENAI_API_KEY="your-openai-api-key"
1010
ANTHROPIC_API_KEY="your-anthropic-api-key"
1111

1212
# Optional: override the runtime start command used by sandbox tests.
13-
# Defaults to: npx -y runtimeuse
13+
# Defaults to: npx -y runtimeuse@latest
1414
# Useful with `packages/runtimeuse/scripts/dev-publish.sh`, which prints a curl/unzip command.
15-
RUNTIMEUSE_RUN_COMMAND="npx -y runtimeuse"
15+
RUNTIMEUSE_RUN_COMMAND="npx -y runtimeuse@latest"
1616

1717
# Optional: reuse the E2B template between test runs.
1818
E2B_REUSE_TEMPLATE=false

packages/runtimeuse-client-python/README.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ WORKDIR = "/runtimeuse"
3030
async def main():
3131
# Start the runtime in a sandbox (provider-specific)
3232
sandbox = Sandbox.create()
33-
sandbox.run("npx -y runtimeuse")
33+
sandbox.run("npx -y runtimeuse@latest")
3434
ws_url = sandbox.get_url(8080)
3535

3636
client = RuntimeUseClient(ws_url=ws_url)
@@ -173,27 +173,26 @@ except CancelledException:
173173

174174
### Types
175175

176-
| Class | Description |
177-
| ----------------------------------------- | ------------------------------------------------------ |
178-
| `QueryOptions` | Configuration for `client.query()` (prompt options, callbacks, timeout) |
179-
| `QueryResult` | Return type of `query()` (`.data`, `.metadata`) |
180-
| `ResultMessageInterface` | Wire-format result message from the runtime |
181-
| `TextResult` | Result variant when no output schema is specified (`.text`) |
176+
| Class | Description |
177+
| ----------------------------------------- | ------------------------------------------------------------------------ |
178+
| `QueryOptions` | Configuration for `client.query()` (prompt options, callbacks, timeout) |
179+
| `QueryResult` | Return type of `query()` (`.data`, `.metadata`) |
180+
| `ResultMessageInterface` | Wire-format result message from the runtime |
181+
| `TextResult` | Result variant when no output schema is specified (`.text`) |
182182
| `StructuredOutputResult` | Result variant when an output schema is specified (`.structured_output`) |
183-
184-
| `AssistantMessageInterface` | Intermediate assistant text messages |
185-
| `ArtifactUploadRequestMessageInterface` | Runtime requesting a presigned URL for artifact upload |
186-
| `ArtifactUploadResponseMessageInterface` | Response with presigned URL sent back to runtime |
187-
| `ErrorMessageInterface` | Error from the agent runtime |
188-
| `CommandInterface` | Pre/post invocation shell command |
189-
| `RuntimeEnvironmentDownloadableInterface` | File to download into the runtime before invocation |
183+
| `AssistantMessageInterface` | Intermediate assistant text messages |
184+
| `ArtifactUploadRequestMessageInterface` | Runtime requesting a presigned URL for artifact upload |
185+
| `ArtifactUploadResponseMessageInterface` | Response with presigned URL sent back to runtime |
186+
| `ErrorMessageInterface` | Error from the agent runtime |
187+
| `CommandInterface` | Pre/post invocation shell command |
188+
| `RuntimeEnvironmentDownloadableInterface` | File to download into the runtime before invocation |
190189

191190
### Exceptions
192191

193-
| Class | Description |
194-
| -------------------- | ------------------------------------------- |
192+
| Class | Description |
193+
| -------------------- | --------------------------------------------------------------------------------- |
195194
| `AgentRuntimeError` | Raised when the agent runtime returns an error (carries `.error` and `.metadata`) |
196-
| `CancelledException` | Raised when `client.abort()` is called during a query |
195+
| `CancelledException` | Raised when `client.abort()` is called during a query |
197196

198197
## Related Docs
199198

packages/runtimeuse-client-python/test/sandbox_factories/e2b.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
_logger = logging.getLogger(__name__)
1212

13-
_DEFAULT_RUN_COMMAND = "npx -y runtimeuse@latest"
13+
_DEFAULT_RUN_COMMAND = "npx -y runtimeuse@latest@latest"
1414

1515

1616
def _get_env_or_fail(name: str) -> str:

0 commit comments

Comments
 (0)