@primitivedotdev/cli 0.24.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 ADDED
@@ -0,0 +1,47 @@
1
+ # @primitivedotdev/cli
2
+
3
+ Official Primitive CLI. Deploy Primitive Functions, send and inspect mail, manage endpoints, all from the terminal.
4
+
5
+ ```bash
6
+ npm install -g @primitivedotdev/cli
7
+ primitive whoami
8
+ ```
9
+
10
+ Or with no install:
11
+
12
+ ```bash
13
+ npx @primitivedotdev/cli@latest <command>
14
+ ```
15
+
16
+ This package wraps the [@primitivedotdev/sdk](https://www.npmjs.com/package/@primitivedotdev/sdk) runtime client with one-shot commands. For in-handler use (calling Primitive from inside a Function), import `createPrimitiveClient` from `@primitivedotdev/sdk/api` directly; the CLI is for operator and deploy workflows.
17
+
18
+ ## Quickstart
19
+
20
+ ```bash
21
+ export PRIMITIVE_API_KEY=prim_...
22
+
23
+ primitive whoami
24
+ primitive functions:init my-fn
25
+ cd my-fn && npm install && npm run build
26
+ primitive functions:deploy --name my-fn --file ./dist/handler.js
27
+
28
+ primitive send --to alice@example.com --body "Hello!" --wait
29
+ primitive emails:latest --limit 5
30
+ ```
31
+
32
+ Run `primitive --help` for the full command list. Per-command help (`primitive functions:deploy --help`) carries enough detail that an agent can compose any operation without leaving the terminal.
33
+
34
+ ## Migrating from `@primitivedotdev/sdk` CLI
35
+
36
+ The CLI previously shipped inside `@primitivedotdev/sdk`. The shipped surface area is identical; only the package name changes.
37
+
38
+ | Before | After |
39
+ |--------|-------|
40
+ | `npm install -g @primitivedotdev/sdk` | `npm install -g @primitivedotdev/cli` |
41
+ | `npx @primitivedotdev/sdk@latest <cmd>` | `npx @primitivedotdev/cli@latest <cmd>` |
42
+
43
+ `@primitivedotdev/sdk` continues to ship the runtime SDK (webhook, API client, contract, parser, openapi). Use it in your application code; use `@primitivedotdev/cli` in your shell and CI.
44
+
45
+ ## License
46
+
47
+ MIT
package/bin/run.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { execute } from "@oclif/core";
4
+
5
+ await execute({ dir: import.meta.url });