@runtypelabs/cli 0.1.9 → 0.2.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
@@ -10,6 +10,12 @@ Command-line interface for the Runtype AI platform.
10
10
  npm install -g @runtypelabs/cli
11
11
  ```
12
12
 
13
+ Or run without installing:
14
+
15
+ ```bash
16
+ npx @runtypelabs/cli <command>
17
+ ```
18
+
13
19
  ## Quick Start
14
20
 
15
21
  ### 1. Create Account & Authenticate
@@ -54,6 +60,27 @@ runtype records create --name "My Record" --type "document"
54
60
  runtype records list --type document
55
61
  ```
56
62
 
63
+ ### 4. Run Multi-Session Agent Tasks
64
+
65
+ Use `runtype marathon` (or `runtype agents task`) to run long-running, multi-session agent tasks with real-time streaming output.
66
+
67
+ ```bash
68
+ # Run a task — agent output streams to your terminal in real time
69
+ runtype marathon "Code Builder" -m "Refactor the auth module to use JWT tokens"
70
+
71
+ # Set a budget and session limit, save progress with a custom name
72
+ runtype marathon agent_abc123 -m "Write integration tests for the API" \
73
+ --max-sessions 10 --max-cost 2.50 --name "api-tests"
74
+
75
+ # Resume an interrupted task (picks up where it left off)
76
+ runtype marathon "Code Builder" -m "Refactor the auth module to use JWT tokens" \
77
+ --resume --name "auth-refactor" --debug
78
+
79
+ # Sync progress to a Runtype record (visible in the dashboard)
80
+ runtype marathon "Code Builder" -m "Build the payments integration" \
81
+ --max-sessions 20 --track --name "payments"
82
+ ```
83
+
57
84
  ## Chat Commands
58
85
 
59
86
  During a chat session, you can use these special commands:
@@ -132,17 +159,22 @@ node dist/index.js talk
132
159
  **Option 3: Install globally for testing**
133
160
 
134
161
  ```bash
135
- # Build and install globally
162
+ # Build first
136
163
  pnpm build
137
- npm install -g .
138
164
 
165
+ # Option A: Symlink (pnpm) — global runtype uses your local package; rebuild after changes
166
+ # If you get "Unable to find the global bin directory", run: pnpm setup (then restart terminal)
167
+ pnpm link --global
168
+ # Use anywhere: runtype --help, runtype products init --from <url>, etc.
169
+ # To stop: pnpm unlink --global (from packages/cli)
170
+
171
+ # Option B: Install current directory (npm)
172
+ npm install -g .
139
173
  # Now use the runtype command anywhere
140
174
  runtype --help
141
175
  runtype auth login
142
176
  runtype talk
143
-
144
- # After making changes, rebuild and reinstall
145
- pnpm build && npm install -g .
177
+ # After making changes, rebuild and reinstall: pnpm build && npm install -g .
146
178
  ```
147
179
 
148
180
  ### Local Environment Configuration
@@ -163,6 +195,33 @@ RUNTYPE_DEFAULT_TEMPERATURE=0.7
163
195
  DEBUG=true
164
196
  ```
165
197
 
198
+ ### Testing against local API
199
+
200
+ To use the CLI with your local API and dashboard:
201
+
202
+ 1. **Run API and dashboard** (from repo root): `pnpm dev:api` (or `pnpm dev:bun`) and `pnpm dev:dashboard`. Ensure the dashboard has `NEXT_PUBLIC_RUNTYPE_API_URL=http://localhost:8787` so CLI auth creates keys against your local API.
203
+
204
+ 2. **Use a `.env` in `packages/cli`** with `RUNTYPE_API_URL` and `RUNTYPE_DASHBOARD_URL` as above, or set them when running:
205
+
206
+ ```bash
207
+ RUNTYPE_DASHBOARD_URL=http://localhost:3001 RUNTYPE_API_URL=http://localhost:8787 pnpm dev -- auth login
208
+ ```
209
+
210
+ 3. **Or skip browser auth** by creating an API key in the local dashboard, then:
211
+ ```bash
212
+ RUNTYPE_API_URL=http://localhost:8787 pnpm dev -- auth login --api-key YOUR_API_KEY
213
+ ```
214
+
215
+ **Testing a single command** (from `packages/cli`):
216
+
217
+ ```bash
218
+ export RUNTYPE_DASHBOARD_URL=http://localhost:3001
219
+ export RUNTYPE_API_URL=http://localhost:8787
220
+ pnpm dev -- agents list
221
+ ```
222
+
223
+ Or inline: `RUNTYPE_DASHBOARD_URL=http://localhost:3001 RUNTYPE_API_URL=http://localhost:8787 pnpm dev -- flows list`
224
+
166
225
  ### Testing
167
226
 
168
227
  ```bash
@@ -175,7 +234,7 @@ pnpm test:watch
175
234
 
176
235
  ## Environment Variables
177
236
 
178
- - `RUNTYPE_API_URL` - API endpoint URL (default: https://api.runtype.com)
237
+ - `RUNTYPE_API_URL` - API base URL **without** a path (e.g. `http://localhost:8787`). Do not include `/v1`; the CLI adds the version prefix. Default: https://api.runtype.com
179
238
  - `RUNTYPE_DASHBOARD_URL` - Dashboard URL (default: https://use.runtype.com)
180
239
  - `CLERK_PUBLISHABLE_KEY` - Clerk public key for OAuth
181
240
  - `RUNTYPE_DEFAULT_MODEL` - Default AI model (default: gpt-4o)