You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`npm run setup`| ✅ | — | First-time org wizard — creates `.env.<org>` and `resources/<org>/`. |
74
+
|`npm run validate`| — |`npm run validate -- <org>`| Schema-check local YAML/MD with no network call. **Run before every `apply`.**|
75
+
|`npm run apply`| ✅ |`npm run apply -- <org> [--force]`|**Default deploy verb.** Pull → merge → push in one safe pass; resilient against dashboard drift. |
76
+
|`npm run pull`| ✅ |`npm run pull -- <org> [flags]`| Fetch remote state into local files / state file. Local-first by default — won't clobber local edits. |
77
+
|`npm run push`| ✅ |`npm run push -- <org> [flags]`| Raw push without a pre-pull. **Skip unless you just ran `pull` and are certain state is fresh** — otherwise prefer `apply`. |
78
+
|`npm run cleanup`| ✅ |`npm run cleanup -- <org> [--force --confirm <org>]`| Inspect (default) or delete orphaned remote resources. Destructive run requires `--confirm <org>`. |
79
+
|`npm run rollback`| — |`npm run rollback -- <org> --list` or `--to <ISO>`| Restore from a snapshot in `.vapi-state.<org>.snapshots/` (one is written before every push/apply). |
80
+
|`npm run call`| ✅ |`npm run call -- <org> -a <name>` or `-s <squad>`| Start an interactive WebSocket call against an assistant or squad. |
81
+
|`npm run sim`| — |`npm run sim -- <org> --suite <name> --target <name>`| Run a simulation suite (or specific simulations) against a deployed assistant/squad. |
82
+
|`npm run build`| — | — | Type-check the codebase (`tsc --noEmit`). |
Recipes for common situations. Each one is the safe path — there are faster shortcuts, but use them only when you understand the trade-offs. The single most important habit: **prefer `apply` over `push`**, because `apply` refreshes platform state before mutating, protecting you against dashboard edits made between your last pull and your push.
154
+
155
+
### Daily edit-and-deploy
156
+
157
+
```bash
158
+
# 1. Schema-check locally first — fails fast on YAML shape errors, no network needed.
159
+
npm run validate -- <org>
160
+
161
+
# 2. Deploy via apply: pulls latest platform state, merges with your local
162
+
# changes, then pushes the merged result. Safe against drift.
163
+
npm run apply -- <org>
164
+
```
165
+
166
+
### Iterating on a single file
167
+
168
+
```bash
169
+
npm run validate -- <org>
170
+
npm run apply -- <org> resources/<org>/assistants/my-agent.md
171
+
```
172
+
173
+
`apply` accepts the same path-scoping as `push`, so you get safety + targeted scope in one command.
174
+
175
+
### First push into a fresh org
176
+
177
+
```bash
178
+
# Interactive wizard — pick "no resources" if you'll author from scratch.
179
+
npm run setup
180
+
181
+
# Drop your YAML/MD files into resources/<org>/, then:
182
+
npm run validate -- <org>
183
+
npm run apply -- <org>
184
+
```
185
+
186
+
On a fresh org, `apply`'s pull phase bootstraps `.vapi-state.<org>.json` from the empty dashboard before pushing your local creates.
187
+
188
+
### Pulling without losing local work
189
+
190
+
```bash
191
+
# Local-first by default — won't overwrite locally modified files.
npm run pull -- <org> --type assistants --id <uuid>
199
+
```
200
+
201
+
### Live testing what you just deployed
202
+
203
+
```bash
204
+
# Interactive WebSocket call — speak/listen from the terminal.
205
+
npm run call -- <org> -a <assistant-name>
206
+
npm run call -- <org> -s <squad-name>
207
+
208
+
# Automated simulation suite against the deployed resource.
209
+
npm run sim -- <org> --suite <suite-name> --target <assistant-name>
210
+
```
211
+
212
+
### Recovering from a bad deploy
213
+
214
+
```bash
215
+
# Every push/apply writes a snapshot first. List them:
216
+
npm run rollback -- <org> --list
217
+
218
+
# Re-apply a specific snapshot to undo a deploy:
219
+
npm run rollback -- <org> --to <ISO-timestamp>
220
+
```
221
+
222
+
### Cleaning up orphaned dashboard resources
223
+
224
+
```bash
225
+
# Dry-run by default — shows what would be deleted, makes no changes.
226
+
npm run cleanup -- <org>
227
+
228
+
# Destructive run — requires explicit confirmation:
229
+
npm run cleanup -- <org> --force --confirm <org>
230
+
```
231
+
232
+
**Surgical alternative when the orphan set includes Vapi-default fixtures** (e.g. the seven undeletable stock simulation personalities — see `docs/learnings/simulations.md`): delete individual resources via direct API call, then refresh state:
This avoids `--force` halting on the first immortal-default 404.
241
+
242
+
### When to use raw `push` instead of `apply`
243
+
244
+
Almost never. The only honest case: you just ran `pull`, nothing else has touched the dashboard since, and you need to skip the merge pass for speed. In any multi-developer environment, default to `apply`.
245
+
246
+
If you do use `push`, dry-run it first:
247
+
248
+
```bash
249
+
npm run push -- <org> --dry-run
250
+
```
251
+
252
+
### Pre-flight checklist before any deploy
253
+
254
+
1.`git status` — uncommitted changes are intentional?
255
+
2.`npm run validate -- <org>` — schema clean?
256
+
3.`npm run apply -- <org>` (or `apply -- <org> <path>` for single-file)
257
+
4. After: verify with `npm run call -- <org> -a <name>` or a `npm run sim` suite
258
+
5. If something looks wrong: `npm run rollback -- <org> --list`
259
+
260
+
---
261
+
148
262
## Organization-Based Structure
149
263
150
264
Resources are scoped by organization (not fixed `dev`/`stg`/`prod` names). Each org gets:
0 commit comments