@runtypelabs/cli 0.1.9 → 0.1.10

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
@@ -132,17 +132,22 @@ node dist/index.js talk
132
132
  **Option 3: Install globally for testing**
133
133
 
134
134
  ```bash
135
- # Build and install globally
135
+ # Build first
136
136
  pnpm build
137
- npm install -g .
138
137
 
138
+ # Option A: Symlink (pnpm) — global runtype uses your local package; rebuild after changes
139
+ # If you get "Unable to find the global bin directory", run: pnpm setup (then restart terminal)
140
+ pnpm link --global
141
+ # Use anywhere: runtype --help, runtype products init --from <url>, etc.
142
+ # To stop: pnpm unlink --global (from packages/cli)
143
+
144
+ # Option B: Install current directory (npm)
145
+ npm install -g .
139
146
  # Now use the runtype command anywhere
140
147
  runtype --help
141
148
  runtype auth login
142
149
  runtype talk
143
-
144
- # After making changes, rebuild and reinstall
145
- pnpm build && npm install -g .
150
+ # After making changes, rebuild and reinstall: pnpm build && npm install -g .
146
151
  ```
147
152
 
148
153
  ### Local Environment Configuration
@@ -163,6 +168,33 @@ RUNTYPE_DEFAULT_TEMPERATURE=0.7
163
168
  DEBUG=true
164
169
  ```
165
170
 
171
+ ### Testing against local API
172
+
173
+ To use the CLI with your local API and dashboard:
174
+
175
+ 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.
176
+
177
+ 2. **Use a `.env` in `packages/cli`** with `RUNTYPE_API_URL` and `RUNTYPE_DASHBOARD_URL` as above, or set them when running:
178
+
179
+ ```bash
180
+ RUNTYPE_DASHBOARD_URL=http://localhost:3001 RUNTYPE_API_URL=http://localhost:8787 pnpm dev -- auth login
181
+ ```
182
+
183
+ 3. **Or skip browser auth** by creating an API key in the local dashboard, then:
184
+ ```bash
185
+ RUNTYPE_API_URL=http://localhost:8787 pnpm dev -- auth login --api-key YOUR_API_KEY
186
+ ```
187
+
188
+ **Testing a single command** (from `packages/cli`):
189
+
190
+ ```bash
191
+ export RUNTYPE_DASHBOARD_URL=http://localhost:3001
192
+ export RUNTYPE_API_URL=http://localhost:8787
193
+ pnpm dev -- agents list
194
+ ```
195
+
196
+ Or inline: `RUNTYPE_DASHBOARD_URL=http://localhost:3001 RUNTYPE_API_URL=http://localhost:8787 pnpm dev -- flows list`
197
+
166
198
  ### Testing
167
199
 
168
200
  ```bash
@@ -175,7 +207,7 @@ pnpm test:watch
175
207
 
176
208
  ## Environment Variables
177
209
 
178
- - `RUNTYPE_API_URL` - API endpoint URL (default: https://api.runtype.com)
210
+ - `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
211
  - `RUNTYPE_DASHBOARD_URL` - Dashboard URL (default: https://use.runtype.com)
180
212
  - `CLERK_PUBLISHABLE_KEY` - Clerk public key for OAuth
181
213
  - `RUNTYPE_DEFAULT_MODEL` - Default AI model (default: gpt-4o)