@samva/cli 0.2.0 → 0.3.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/AGENTS.md +6 -14
- package/README.md +23 -8
- package/dist/bin.mjs +17507 -11473
- package/package.json +14 -12
package/AGENTS.md
CHANGED
|
@@ -17,8 +17,8 @@ each requires `--template-id`, because a reference is a statement about one temp
|
|
|
17
17
|
|
|
18
18
|
`samva templates workspace <open|diff|patch|check|fixture|save|history|publish>` is the
|
|
19
19
|
hosted project workspace over the CLI, for a caller with no clone: an agent in a sandbox, a CI job,
|
|
20
|
-
a script. It reaches the same
|
|
21
|
-
|
|
20
|
+
a script. It reaches the same operations the hosted MCP tools reach, so an agent can start a journey in one
|
|
21
|
+
and finish it in the other. Every subcommand prints its complete
|
|
22
22
|
result as JSON because these outputs — revisions, digests, diagnostics — are inputs to the next
|
|
23
23
|
call. `open` returns the revision every other subcommand is fenced to; a workspace that moved refuses
|
|
24
24
|
them, and reopening is the recovery. A source that does not build is a successful call carrying a
|
|
@@ -35,26 +35,18 @@ with the template and the JSON pointer rather than generated as `unknown`.
|
|
|
35
35
|
|
|
36
36
|
`samva templates init --name <name>` creates a starter-backed Artifact project and clones its Git
|
|
37
37
|
repository. `samva templates clone <template-id>` clones an existing project. Both configure a
|
|
38
|
-
repository-local credential helper that exchanges Samva authorization for a
|
|
38
|
+
repository-local credential helper that exchanges Samva authorization for a short-lived,
|
|
39
39
|
repository-scoped credential; the token is never stored in the remote URL or Git config. Normal
|
|
40
40
|
`git fetch`, `git pull`, `git add`, `git commit`, and `git push` remain the synchronization commands.
|
|
41
|
-
|
|
41
|
+
Install from the project's lockfile (`bun install --frozen-lockfile` or `npm ci`) before `samva templates check` or `samva templates build`, then
|
|
42
42
|
publish a clean, pushed commit with `samva templates publish`. Publish checks that the selected
|
|
43
43
|
commit is an ancestor of the fetched `origin/<default-branch>` and creates an immutable receipt; it
|
|
44
44
|
does not push or rewrite history. The CLI loads the project's installed authoring toolchain so its
|
|
45
45
|
compiler and editor versions stay pinned by the project lockfile.
|
|
46
|
-
Template authoring commands
|
|
46
|
+
Template authoring commands run that toolchain under Node.js and name the Node.js version they need
|
|
47
|
+
when it is missing; other CLI commands are self-contained.
|
|
47
48
|
|
|
48
49
|
`@samva/cli` ships the JavaScript implementation and its runtime dependencies. Its launcher prefers
|
|
49
50
|
the matching platform-specific `@samva/cli-*` executable and falls back to the packaged JavaScript
|
|
50
51
|
CLI through Bun when npm omits optional dependencies. Depend on `@samva/cli`, never a native
|
|
51
52
|
artifact directly.
|
|
52
|
-
|
|
53
|
-
## Command handler tracing
|
|
54
|
-
|
|
55
|
-
Every `Command.withHandler` body uses `Effect.fnUntraced`, and that is the convention for the whole
|
|
56
|
-
command surface rather than an omission at each site. A handler is the process: it runs once, prints,
|
|
57
|
-
and exits, so a span would name the run instead of a step inside it, and the CLI installs no tracer
|
|
58
|
-
to receive one. Reusable work that outlives a single call still carries a name, as
|
|
59
|
-
`src/config/store.ts` does with `Effect.fn("CliConfig.writeConfig")` and
|
|
60
|
-
`Effect.fn("CliConfig.writeCredentials")`.
|
package/README.md
CHANGED
|
@@ -63,17 +63,17 @@ the device flow with `samva login --no-browser`; `--no-input`, `--json`, and `--
|
|
|
63
63
|
If a stored OAuth record is malformed, run `samva logout` and then `samva login`; API-key calls do
|
|
64
64
|
not read or decode stored OAuth credentials.
|
|
65
65
|
|
|
66
|
-
Profiles hold non-secret
|
|
66
|
+
Profiles hold non-secret organization settings. Credentials stay in the OS keyring.
|
|
67
67
|
|
|
68
68
|
```sh
|
|
69
|
-
samva profile create
|
|
70
|
-
samva profile use
|
|
71
|
-
samva --profile
|
|
69
|
+
samva profile create acme --org acme
|
|
70
|
+
samva profile use acme
|
|
71
|
+
samva --profile acme email doctor
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
The profile resolves as `--profile`, then `SAMVA_PROFILE`, then the active profile, then `default`.
|
|
75
|
-
The API URL resolves as `--api-url`, then `SAMVA_API_URL`, then
|
|
76
|
-
|
|
75
|
+
The API URL resolves as `--api-url`, then `SAMVA_API_URL`, then `https://api.samva.dev`. Profiles
|
|
76
|
+
do not select an API; a config whose profile sets `target` fails to load and names these overrides.
|
|
77
77
|
|
|
78
78
|
## Common operations
|
|
79
79
|
|
|
@@ -113,6 +113,21 @@ samva email design pull
|
|
|
113
113
|
samva email design push --dry-run
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
+
## DKIM rotation
|
|
117
|
+
|
|
118
|
+
Stage a new selector with an explicit retry key:
|
|
119
|
+
|
|
120
|
+
```sh
|
|
121
|
+
samva email domains rotate-dkim dom_abc123 --idempotency-key rotation-2026-09 --dry-run
|
|
122
|
+
samva email domains rotate-dkim dom_abc123 --idempotency-key rotation-2026-09 --json
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Reuse the same key for retries. Publish the returned `record`, then run
|
|
126
|
+
`samva email domains check dom_abc123` to advance verification and cut over.
|
|
127
|
+
Keep `formerRecord` published. `minimumRetainUntil` is only a minimum retention horizon;
|
|
128
|
+
retirement requires separate approval and verification that at least two actual former-record
|
|
129
|
+
TTLs have elapsed. The command never removes DNS records.
|
|
130
|
+
|
|
116
131
|
## Template projects
|
|
117
132
|
|
|
118
133
|
Create a starter-backed project, or clone an existing template project. Samva creates the project
|
|
@@ -241,7 +256,7 @@ samva email send --to ada@example.com --subject "Hello" --text "Hi!" --dry-run -
|
|
|
241
256
|
samva messages list --all --jsonl
|
|
242
257
|
|
|
243
258
|
# Suppress successful human output.
|
|
244
|
-
samva --quiet profile use
|
|
259
|
+
samva --quiet profile use acme
|
|
245
260
|
```
|
|
246
261
|
|
|
247
262
|
`--json` writes one bounded, versioned result envelope to stdout:
|
|
@@ -300,7 +315,7 @@ samva webhooks test wep_abc123 --data '{"event":"webhook.test"}' --json
|
|
|
300
315
|
samva webhooks test wep_abc123 --data @payload.json --json
|
|
301
316
|
```
|
|
302
317
|
|
|
303
|
-
`samva email doctor` reports resolved profile,
|
|
318
|
+
`samva email doctor` reports resolved profile, API URL, auth source, organization access,
|
|
304
319
|
sending domains, senders, and domain-verification readback. It is read-only and does not inspect
|
|
305
320
|
receiving configuration, verify DNS, send an email, replay fixtures, or check provider readiness.
|
|
306
321
|
Use `samva email receiving status <domain-id>` to read a domain's receiving prerequisite status.
|