@farthershore/cli 0.9.1 → 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 CHANGED
@@ -101,9 +101,10 @@ manifest compiles.
101
101
 
102
102
  ### `farthershore build`
103
103
 
104
- Build a product-as-code `product/product.config.ts` with the repo-local
105
- `./node_modules/.bin/farthershore-manifest-build` binary. The command
106
- emits a Manifest IR envelope to `manifest-ir.json` by default.
104
+ Build a product-as-code `product/product.config.ts` with the Product SDK
105
+ manifest builder. The CLI first uses the builder installed under `product/`,
106
+ then falls back to a root install. The command emits a Manifest IR envelope to
107
+ `manifest-ir.json` by default.
107
108
 
108
109
  ```bash
109
110
  farthershore build
@@ -113,11 +114,17 @@ farthershore build --format json
113
114
  # Optional dry-run compile against core after the local build succeeds
114
115
  farthershore build --validate weather-api --format json
115
116
  farthershore build --validate weather-api --env preview --format json
117
+
118
+ # Apply the accepted lifecycle state through core without relying on GitHub
119
+ farthershore build --apply weather-api --format json
120
+ farthershore build --apply weather-api --env preview --format json
116
121
  ```
117
122
 
118
123
  ### `farthershore product`
119
124
 
120
- Product lifecycle commands direct API, no local manifest upload flow.
125
+ Product lifecycle commands. Creation requires a connected GitHub account because
126
+ Farther Shore always provisions the editable `frontend/` starter repo for a new
127
+ product.
121
128
 
122
129
  ```bash
123
130
  farthershore product list --format json
@@ -149,11 +156,17 @@ farthershore product compile weather-api --branch env/preview --format json
149
156
  ```
150
157
 
151
158
  `product create` provisions a managed GitHub repo and returns clone-URL +
152
- agent bootstrap instructions in the response. Plan pricing lives on the
153
- plan (see `farthershore plan create` below) the product itself no
154
- longer carries a `billingStrategy`. Omitting both meter flags gives the
155
- product a `requests` meter; variable-value meters (tokens, credits, spend)
156
- are settled from upstream `x-fs-cost-{key}` response headers.
159
+ agent bootstrap instructions in the response. That repo is required for the
160
+ starter `frontend/` project and normal customization workflow. Product SDK
161
+ changes can be validated with `farthershore build --validate` and applied to the
162
+ repo-backed product with `farthershore build --apply`.
163
+
164
+ Plan pricing lives on the plan (see `farthershore plan create` below) — the
165
+ product itself no longer carries a `billingStrategy`. Omitting both meter flags
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`.
157
170
 
158
171
  A new product starts as a DRAFT with a generated `frontend/` project ready for
159
172
  customization. Going live mirrors the dashboard's "Finish setting up" checklist:
@@ -239,6 +252,29 @@ Read recent usage off the management API.
239
252
  farthershore usage summary weather-api --format json
240
253
  ```
241
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
+
242
278
  ### `farthershore connect`
243
279
 
244
280
  GitHub OAuth and Stripe Connect flows are browser-only. These commands