@elevasis/sdk 0.4.4 → 0.4.6

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.
@@ -0,0 +1,496 @@
1
+ ---
2
+ title: CLI Reference
3
+ description: Full reference for every elevasis CLI command -- scaffold, validate, deploy, execute, and inspect resources
4
+ ---
5
+
6
+ The `elevasis` CLI is the primary interface for working with your Elevasis SDK project. Install it as part of `@elevasis/sdk` and use it to scaffold projects, validate resource definitions, deploy to the platform, and inspect execution history.
7
+
8
+ **Installation:**
9
+
10
+ ```bash
11
+ npm install @elevasis/sdk
12
+ ```
13
+
14
+ After installation, the `elevasis` binary is available in your project's `node_modules/.bin/`. Most commands require `ELEVASIS_API_KEY` to be set in your environment or a `.env` file.
15
+
16
+ ---
17
+
18
+ ## elevasis init
19
+
20
+ Scaffold a new Elevasis SDK project in the specified directory.
21
+
22
+ **Synopsis:**
23
+
24
+ ```
25
+ elevasis init [directory]
26
+ ```
27
+
28
+ **Behavior:**
29
+
30
+ - Derives the organization slug from the directory name
31
+ - Checks for file conflicts before writing any files
32
+ - Scaffolds project structure including `src/index.ts`, `elevasis.config.ts`, `package.json`, `tsconfig.json`, and a `CLAUDE.md` with CLI reference and SDK patterns
33
+ - Non-interactive: all values are derived automatically
34
+
35
+ **Flags:**
36
+
37
+ | Flag | Description |
38
+ | ---- | ----------- |
39
+ | (none) | Uses current directory if no argument is provided |
40
+
41
+ **Example:**
42
+
43
+ ```bash
44
+ elevasis init my-project
45
+ ```
46
+
47
+ ```
48
+ Scaffolding my-project/...
49
+
50
+ Created 18 files.
51
+
52
+ Next steps:
53
+ cd my-project
54
+ npm install
55
+ elevasis check
56
+ ```
57
+
58
+ ---
59
+
60
+ ## elevasis check
61
+
62
+ Validate all resource definitions in your project without deploying.
63
+
64
+ **Synopsis:**
65
+
66
+ ```
67
+ elevasis check
68
+ ```
69
+
70
+ **Behavior:**
71
+
72
+ - Imports your `src/index.ts` and runs it through `ResourceRegistry` validation
73
+ - Catches the same errors that the platform catches at deploy time:
74
+ - Duplicate `resourceId` within the organization
75
+ - Invalid model configuration (temperature and token bounds)
76
+ - `ExecutionInterface` form fields not matching `inputSchema`
77
+ - Broken workflow step chains (`next` referencing non-existent steps)
78
+ - Relationship declarations referencing non-existent resources
79
+ - Exits with code 0 on success, code 1 on validation failure
80
+
81
+ **Flags:**
82
+
83
+ | Flag | Description |
84
+ | ---- | ----------- |
85
+ | `--api-url <url>` | Override the API base URL |
86
+
87
+ **Example output (success):**
88
+
89
+ ```
90
+ $ elevasis check
91
+
92
+ Validating... done (4 resources, 0 errors)
93
+ ```
94
+
95
+ **Example output (failure):**
96
+
97
+ ```
98
+ $ elevasis check
99
+
100
+ Validating...
101
+ ERROR Duplicate resource ID 'onboard-client' in organization 'Acme Corp'
102
+ ERROR Workflow step 'send-email' references non-existent next step 'notify'
103
+
104
+ 2 errors.
105
+ ```
106
+
107
+ ---
108
+
109
+ ## elevasis deploy
110
+
111
+ Bundle your project with esbuild and deploy it to the Elevasis platform.
112
+
113
+ **Synopsis:**
114
+
115
+ ```
116
+ elevasis deploy
117
+ ```
118
+
119
+ **Behavior:**
120
+
121
+ - Authenticates with `ELEVASIS_API_KEY` and resolves your organization name
122
+ - Runs the same `ResourceRegistry` validation as `elevasis check`
123
+ - Bundles your `src/index.ts` and all dependencies into a single self-contained JS file (`dist/bundle.js`, approximately 50-200 KB)
124
+ - Uploads the bundle plus resource metadata to `POST /api/external/deploy`
125
+ - Streams deploy status and prints the result
126
+ - Resources are live immediately after a successful deploy
127
+
128
+ **Flags:**
129
+
130
+ | Flag | Description |
131
+ | ---- | ----------- |
132
+ | `--api-url <url>` | Override the API base URL (default: production) |
133
+
134
+ **Environment variables:**
135
+
136
+ | Variable | Description |
137
+ | -------- | ----------- |
138
+ | `ELEVASIS_API_KEY` | Required. Your `sk_...` API key |
139
+ | `ELEVASIS_API_URL` | Optional. Override the API base URL |
140
+
141
+ **Example output (success):**
142
+
143
+ ```
144
+ $ elevasis deploy
145
+
146
+ Authenticating... done (acme-corp)
147
+ Validating... done (4 resources, 0 errors)
148
+ Bundling... done (142 KB)
149
+ Uploading... done
150
+
151
+ Deployed! 4 resources live.
152
+ Deployment: deploy_abc123
153
+ ```
154
+
155
+ **Example output (validation failure):**
156
+
157
+ ```
158
+ $ elevasis deploy
159
+
160
+ Authenticating... done (acme-corp)
161
+ Validating...
162
+ ERROR Duplicate resource ID 'onboard-client' in organization 'Acme Corp'
163
+ ERROR Workflow step 'send-email' references non-existent next step 'notify'
164
+
165
+ 2 errors. Deploy aborted.
166
+ ```
167
+
168
+ ---
169
+
170
+ ## elevasis exec
171
+
172
+ Execute a deployed resource by ID.
173
+
174
+ **Synopsis:**
175
+
176
+ ```
177
+ elevasis exec <resource> --input '{...}'
178
+ ```
179
+
180
+ **Behavior:**
181
+
182
+ - Executes the named resource synchronously by default and streams the result
183
+ - Use `--async` to return an `executionId` immediately and poll for completion
184
+ - `--input` accepts a JSON string matching the resource's `inputSchema`
185
+ - Organization is derived from your API key -- no org prefix needed
186
+
187
+ **Flags:**
188
+
189
+ | Flag | Description |
190
+ | ---- | ----------- |
191
+ | `--input <json>` | JSON input matching the resource's input schema |
192
+ | `--async` | Execute asynchronously, return execution ID immediately |
193
+ | `--json` | Output raw JSON instead of formatted display |
194
+ | `--api-url <url>` | Override the API base URL |
195
+
196
+ **Example:**
197
+
198
+ ```bash
199
+ elevasis exec onboard-client --input '{"clientName": "Jane", "email": "jane@example.com"}'
200
+ ```
201
+
202
+ ```
203
+ Executing onboard-client...
204
+
205
+ Status: completed
206
+ Duration: 1.4s
207
+
208
+ Output:
209
+ {
210
+ "success": true,
211
+ "clientId": "client_1708521600000",
212
+ "welcomeEmailSent": true
213
+ }
214
+ ```
215
+
216
+ **Async example:**
217
+
218
+ ```bash
219
+ elevasis exec onboard-client --input '{"clientName": "Jane"}' --async
220
+ ```
221
+
222
+ ```
223
+ Execution started: exec_550e8400
224
+ Poll with: elevasis execution onboard-client exec_550e8400
225
+ ```
226
+
227
+ ---
228
+
229
+ ## elevasis resources
230
+
231
+ List all deployed resources for your organization.
232
+
233
+ **Synopsis:**
234
+
235
+ ```
236
+ elevasis resources
237
+ ```
238
+
239
+ **Behavior:**
240
+
241
+ - Lists all resources registered to your organization on the platform
242
+ - In production, only `status: 'prod'` resources are shown
243
+ - Displays resource ID, type, name, and status
244
+
245
+ **Flags:**
246
+
247
+ | Flag | Description |
248
+ | ---- | ----------- |
249
+ | `--json` | Output raw JSON |
250
+ | `--api-url <url>` | Override the API base URL |
251
+
252
+ **Example output:**
253
+
254
+ ```
255
+ $ elevasis resources
256
+
257
+ onboard-client workflow Onboard Client prod
258
+ send-report workflow Send Weekly Report prod
259
+ email-assistant agent Email Assistant prod
260
+ support-bot agent Support Bot dev
261
+ ```
262
+
263
+ ---
264
+
265
+ ## elevasis executions
266
+
267
+ View execution history for a resource.
268
+
269
+ **Synopsis:**
270
+
271
+ ```
272
+ elevasis executions [resource]
273
+ ```
274
+
275
+ **Behavior:**
276
+
277
+ - Lists recent executions for the specified resource
278
+ - If `resource` is omitted, lists executions across all resources
279
+ - Supports filtering by status and limiting result count
280
+
281
+ **Flags:**
282
+
283
+ | Flag | Description |
284
+ | ---- | ----------- |
285
+ | `--limit <n>` | Maximum number of executions to return (default: 20) |
286
+ | `--status <status>` | Filter by status: `running`, `completed`, `failed`, `cancelled` |
287
+ | `--json` | Output raw JSON |
288
+ | `--api-url <url>` | Override the API base URL |
289
+
290
+ **Example:**
291
+
292
+ ```bash
293
+ elevasis executions onboard-client --limit 5
294
+ ```
295
+
296
+ ```
297
+ exec_abc001 completed 2026-02-25 14:32:01 1.2s
298
+ exec_abc002 completed 2026-02-25 13:18:44 0.9s
299
+ exec_abc003 failed 2026-02-25 12:05:22 0.3s
300
+ exec_abc004 completed 2026-02-24 17:51:09 1.8s
301
+ exec_abc005 completed 2026-02-24 16:30:55 1.1s
302
+ ```
303
+
304
+ ---
305
+
306
+ ## elevasis execution
307
+
308
+ View full detail for a single execution.
309
+
310
+ **Synopsis:**
311
+
312
+ ```
313
+ elevasis execution <resource> <id>
314
+ ```
315
+
316
+ **Behavior:**
317
+
318
+ - Shows the complete execution record: input, output, logs, duration, and error (if any)
319
+ - Use `--json` to get the raw JSON response for programmatic use
320
+
321
+ **Flags:**
322
+
323
+ | Flag | Description |
324
+ | ---- | ----------- |
325
+ | `--json` | Output raw JSON |
326
+ | `--api-url <url>` | Override the API base URL |
327
+
328
+ **Example:**
329
+
330
+ ```bash
331
+ elevasis execution onboard-client exec_abc001
332
+ ```
333
+
334
+ ```
335
+ Resource: onboard-client
336
+ Status: completed
337
+ Started: 2026-02-25 14:32:01
338
+ Duration: 1.2s
339
+
340
+ Input:
341
+ {
342
+ "clientName": "Jane",
343
+ "email": "jane@example.com"
344
+ }
345
+
346
+ Output:
347
+ {
348
+ "success": true,
349
+ "clientId": "client_1708521600000",
350
+ "welcomeEmailSent": true
351
+ }
352
+
353
+ Logs:
354
+ [14:32:01.123] Starting onboard-client workflow
355
+ [14:32:01.456] Created client record
356
+ [14:32:01.891] Welcome email sent to jane@example.com
357
+ ```
358
+
359
+ ---
360
+
361
+ ## elevasis deployments
362
+
363
+ List all deployments for your organization.
364
+
365
+ **Synopsis:**
366
+
367
+ ```
368
+ elevasis deployments
369
+ ```
370
+
371
+ **Behavior:**
372
+
373
+ - Shows deployment history with status, timestamp, and resource count
374
+ - Active deployment is marked; previous deployments show as `stopped`
375
+
376
+ **Flags:**
377
+
378
+ | Flag | Description |
379
+ | ---- | ----------- |
380
+ | `--json` | Output raw JSON |
381
+ | `--api-url <url>` | Override the API base URL |
382
+
383
+ **Example output:**
384
+
385
+ ```
386
+ $ elevasis deployments
387
+
388
+ deploy_abc123 active 2026-02-25 14:00:00 4 resources
389
+ deploy_abc122 stopped 2026-02-24 09:30:00 3 resources
390
+ deploy_abc121 stopped 2026-02-23 11:15:00 3 resources
391
+ ```
392
+
393
+ ---
394
+
395
+ ## elevasis describe
396
+
397
+ Show the definition of a deployed resource.
398
+
399
+ **Synopsis:**
400
+
401
+ ```
402
+ elevasis describe <resource>
403
+ ```
404
+
405
+ **Behavior:**
406
+
407
+ - Displays resource metadata: name, type, description, status, and domains
408
+ - Shows the full `inputSchema` and `outputSchema` as JSON
409
+ - Type is color-coded: yellow for workflows, magenta for agents
410
+
411
+ **Flags:**
412
+
413
+ | Flag | Description |
414
+ | ---- | ----------- |
415
+ | `--json` | Output raw JSON response |
416
+ | `--api-url <url>` | Override the API base URL |
417
+
418
+ **Example:**
419
+
420
+ ```bash
421
+ elevasis describe onboard-client
422
+ ```
423
+
424
+ ```
425
+ onboard-client [workflow]
426
+
427
+ Name: Onboard Client
428
+ Description: Creates a client record and sends a welcome email
429
+ Status: prod
430
+ Domains: crm, email
431
+
432
+ Input Schema:
433
+ {
434
+ "type": "object",
435
+ "properties": {
436
+ "clientName": { "type": "string" },
437
+ "email": { "type": "string", "format": "email" }
438
+ },
439
+ "required": ["clientName", "email"]
440
+ }
441
+ ```
442
+
443
+ ---
444
+
445
+ ## elevasis env
446
+
447
+ Manage environment variables for your project.
448
+
449
+ **Synopsis:**
450
+
451
+ ```
452
+ elevasis env list
453
+ elevasis env set <key> <value>
454
+ elevasis env remove <key>
455
+ ```
456
+
457
+ **Behavior:**
458
+
459
+ - `list` -- display all environment variables configured for the project
460
+ - `set` -- add or update an environment variable
461
+ - `remove` -- delete an environment variable
462
+
463
+ **Flags:**
464
+
465
+ | Flag | Description |
466
+ | ---- | ----------- |
467
+ | `--api-url <url>` | Override the API base URL |
468
+
469
+ **Examples:**
470
+
471
+ ```bash
472
+ elevasis env list
473
+ elevasis env set OPENAI_API_KEY sk-proj-***
474
+ elevasis env remove OPENAI_API_KEY
475
+ ```
476
+
477
+ ---
478
+
479
+ ## Global Flags
480
+
481
+ These flags are accepted by all commands:
482
+
483
+ | Flag | Description |
484
+ | ---- | ----------- |
485
+ | `--api-url <url>` | Override the API base URL. Priority: flag > `ELEVASIS_API_URL` env var > `NODE_ENV`-based default |
486
+ | `--json` | Output raw JSON (available on most commands) |
487
+
488
+ **API base URL resolution:**
489
+
490
+ - Production (default): `https://api.elevasis.io`
491
+ - Development (`NODE_ENV=development`): `http://localhost:<port>`
492
+ - Override: set `ELEVASIS_API_URL` or pass `--api-url`
493
+
494
+ ---
495
+
496
+ **Last Updated:** 2026-02-25