primcli 1.4.0 → 1.6.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 +40 -1
- package/dist/oclif/index.js +2628 -148
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ primitive whoami
|
|
|
16
16
|
prim whoami
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
The same CLI is also published unscoped as [`primcli`](https://www.npmjs.com/package/primcli)
|
|
19
|
+
The same CLI is also published unscoped as [`primcli`](https://www.npmjs.com/package/primcli). `npm install -g primcli` installs an identical build with the same `primitive`/`prim` commands. Use whichever name you prefer; they track the same version.
|
|
20
20
|
|
|
21
21
|
Or with no install:
|
|
22
22
|
|
|
@@ -73,6 +73,45 @@ primitive deliveries replay --id <delivery-id>
|
|
|
73
73
|
|
|
74
74
|
Generated API commands remain available for compatibility and full schema parity, for example `primitive emails:list-emails` and `primitive sending:reply-to-email`.
|
|
75
75
|
|
|
76
|
+
## x402 payments
|
|
77
|
+
|
|
78
|
+
The `primitive payments` command group drives non-custodial x402 USDC payments. One agent registers a payout address and requests a payment; the paying agent signs locally with its own wallet key and settles. The key never leaves your machine. Networks are `base` and `base-sepolia`. Amounts take a human USDC value (`--amount-usdc 0.01`) or token base units (`--amount 10000`, since USDC has 6 decimals). Your org is resolved automatically from your API key, so payout registration takes no org flag.
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Payee, one time: register the default address your org is paid at. Signs an
|
|
82
|
+
# ownership message locally with your wallet key. Org is auto-resolved.
|
|
83
|
+
primitive payments register-payout-address --network base-sepolia --label treasury
|
|
84
|
+
|
|
85
|
+
# Payee: request a payment with a human USDC amount. Prints a summary by default.
|
|
86
|
+
primitive payments charge --network base-sepolia --amount-usdc 0.01
|
|
87
|
+
# Capture the raw challenge JSON to hand to the payer.
|
|
88
|
+
primitive payments charge --network base-sepolia --amount-usdc 0.01 --json > challenge.json
|
|
89
|
+
|
|
90
|
+
# Payer: sign and settle the challenge locally. Reads the challenge inline,
|
|
91
|
+
# from a file, or piped on stdin.
|
|
92
|
+
primitive payments pay --challenge-file challenge.json
|
|
93
|
+
cat challenge.json | primitive payments pay
|
|
94
|
+
|
|
95
|
+
# Inspect a challenge by id, or list your registered payout addresses.
|
|
96
|
+
primitive payments get-challenge --id <challenge-id>
|
|
97
|
+
primitive payments list-payout-addresses
|
|
98
|
+
|
|
99
|
+
# Read and update the org spend policy (kill-switch, per-payment and daily caps,
|
|
100
|
+
# payee allowlist). The update merges: omitted fields keep their value.
|
|
101
|
+
primitive payments get-spend-policy
|
|
102
|
+
primitive payments update-spend-policy --max-per-payment 5000000
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
`charge` is the friendly verb that matches the SDK `charge` and accepts `--amount-usdc`; `create-challenge` is the lower-level command that takes base-unit `--amount`. Either creates a challenge. The signing commands print a human-readable summary by default; pass `--json` for raw JSON suitable for piping.
|
|
106
|
+
|
|
107
|
+
The two signing commands (`register-payout-address` and `pay`) need your wallet key. Set it in `PRIMITIVE_X402_PRIVATE_KEY` (a `0x`-prefixed hex private key) so it never lands in shell history or the process list:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
export PRIMITIVE_X402_PRIVATE_KEY=0x...
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
A hidden `--private-key` flag is available as an escape hatch for scripted use, but the environment variable is preferred. The non-signing commands (`charge`, `get-challenge`, `list-payout-addresses`, `get-spend-policy`, `update-spend-policy`) need only your Primitive API key. Run `primitive payments <command> --help` for the full flag list of any command.
|
|
114
|
+
|
|
76
115
|
## Migrating from `@primitivedotdev/sdk` CLI
|
|
77
116
|
|
|
78
117
|
The CLI previously shipped inside `@primitivedotdev/sdk`. The shipped surface area is identical; only the package name changes.
|