@farthershore/cli 0.9.2 → 0.10.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 +27 -2
- package/dist/index.js +53 -53
- package/dist/mcp.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -163,8 +163,10 @@ repo-backed product with `farthershore build --apply`.
|
|
|
163
163
|
|
|
164
164
|
Plan pricing lives on the plan (see `farthershore plan create` below) — the
|
|
165
165
|
product itself no longer carries a `billingStrategy`. Omitting both meter flags
|
|
166
|
-
gives the product a `requests` meter
|
|
167
|
-
|
|
166
|
+
gives the product a `requests` meter. Plain request counting is
|
|
167
|
+
platform-managed. Variable-value meters such as tokens, credits, or compute must
|
|
168
|
+
be declared in the Product SDK as route `reports` and reported by the upstream
|
|
169
|
+
with `@farthershore/metering`.
|
|
168
170
|
|
|
169
171
|
A new product starts as a DRAFT with a generated `frontend/` project ready for
|
|
170
172
|
customization. Going live mirrors the dashboard's "Finish setting up" checklist:
|
|
@@ -250,6 +252,29 @@ Read recent usage off the management API.
|
|
|
250
252
|
farthershore usage summary weather-api --format json
|
|
251
253
|
```
|
|
252
254
|
|
|
255
|
+
### `farthershore metering-token`
|
|
256
|
+
|
|
257
|
+
Provision runtime metering tokens for upstream services. Core stores only token
|
|
258
|
+
hashes; the raw token is returned once and should be deployed as
|
|
259
|
+
`FARTHERSHORE_METERING_TOKEN`.
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
farthershore metering-token list weather-api --format json
|
|
263
|
+
farthershore metering-token create weather-api --name "prod-api" --format json
|
|
264
|
+
farthershore metering-token create weather-api --name "preview-api" --env preview --format json
|
|
265
|
+
farthershore metering-token revoke weather-api <tokenId> --yes --format json
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
Pair the token with `@farthershore/metering` in the upstream:
|
|
269
|
+
|
|
270
|
+
```ts
|
|
271
|
+
import { withUsage } from "@farthershore/metering";
|
|
272
|
+
|
|
273
|
+
return withUsage(request, Response.json(result), {
|
|
274
|
+
tokens_used: result.tokensUsed,
|
|
275
|
+
});
|
|
276
|
+
```
|
|
277
|
+
|
|
253
278
|
### `farthershore connect`
|
|
254
279
|
|
|
255
280
|
GitHub OAuth and Stripe Connect flows are browser-only. These commands
|