@farthershore/cli 0.3.9 → 0.3.11

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.
Files changed (43) hide show
  1. package/README.md +49 -0
  2. package/dist/index.js +433 -94
  3. package/dist/mcp.js +201 -0
  4. package/package.json +17 -12
  5. package/dist/auth.d.ts +0 -1
  6. package/dist/auth.js +0 -17
  7. package/dist/build-info.d.ts +0 -1
  8. package/dist/build-info.js +0 -10
  9. package/dist/client.d.ts +0 -89
  10. package/dist/client.js +0 -82
  11. package/dist/commands/apply.d.ts +0 -3
  12. package/dist/commands/apply.js +0 -296
  13. package/dist/commands/billing.d.ts +0 -3
  14. package/dist/commands/billing.js +0 -99
  15. package/dist/commands/feature.d.ts +0 -3
  16. package/dist/commands/feature.js +0 -109
  17. package/dist/commands/helpers.d.ts +0 -15
  18. package/dist/commands/helpers.js +0 -93
  19. package/dist/commands/init.d.ts +0 -3
  20. package/dist/commands/init.js +0 -43
  21. package/dist/commands/login.d.ts +0 -2
  22. package/dist/commands/login.js +0 -144
  23. package/dist/commands/meter.d.ts +0 -3
  24. package/dist/commands/meter.js +0 -121
  25. package/dist/commands/plan-transition.d.ts +0 -40
  26. package/dist/commands/plan-transition.js +0 -504
  27. package/dist/commands/plan.d.ts +0 -3
  28. package/dist/commands/plan.js +0 -234
  29. package/dist/commands/product.d.ts +0 -3
  30. package/dist/commands/product.js +0 -137
  31. package/dist/commands/transition.d.ts +0 -3
  32. package/dist/commands/transition.js +0 -80
  33. package/dist/commands/validate.d.ts +0 -28
  34. package/dist/commands/validate.js +0 -216
  35. package/dist/config.d.ts +0 -6
  36. package/dist/config.js +0 -58
  37. package/dist/index.d.ts +0 -2
  38. package/dist/output.d.ts +0 -8
  39. package/dist/output.js +0 -28
  40. package/dist/remediation.d.ts +0 -6
  41. package/dist/remediation.js +0 -53
  42. package/dist/types.d.ts +0 -75
  43. package/dist/types.js +0 -23
package/README.md CHANGED
@@ -14,6 +14,12 @@ Or use directly with npx:
14
14
  npx @farthershore/cli init my-api
15
15
  ```
16
16
 
17
+ The package also ships an MCP stdio server for agents:
18
+
19
+ ```bash
20
+ FARTHERSHORE_TOKEN=mk_xxx npx -p @farthershore/cli farthershore-mcp
21
+ ```
22
+
17
23
  ## Authentication
18
24
 
19
25
  Create an API token at [farthershore.com/settings/tokens](https://farthershore.com/settings/tokens), then:
@@ -34,6 +40,25 @@ export FARTHERSHORE_TOKEN=mk_xxx
34
40
 
35
41
  Tokens are stored in `~/.farthershore/credentials.json`.
36
42
 
43
+ ## Environment scope
44
+
45
+ Most product commands can run against production or a named environment.
46
+ Production is the default. `production`, `prod`, and `main` all mean the
47
+ production scope.
48
+
49
+ ```bash
50
+ farthershore env create preview --branch env/preview --format json
51
+ farthershore env use preview --format json
52
+ farthershore plan list --env preview --format json
53
+ farthershore --env preview meter list --format json
54
+ farthershore env run preview -- plan add pro --price-monthly 2900 --format json
55
+ farthershore env use production --format json
56
+ ```
57
+
58
+ `env use` is stored per product in `~/.farthershore/config.json`, so
59
+ switching products does not accidentally carry the previous product's
60
+ environment.
61
+
37
62
  ## Commands
38
63
 
39
64
  ### `farthershore init <name>`
@@ -77,6 +102,7 @@ the accepted config hash and GitHub sync state.
77
102
 
78
103
  ```bash
79
104
  farthershore product status --format json
105
+ farthershore product status --env preview --format json
80
106
  ```
81
107
 
82
108
  ### `farthershore product config`
@@ -88,6 +114,7 @@ valid source of truth.
88
114
  ```bash
89
115
  farthershore product config --format json
90
116
  farthershore product config --format yaml
117
+ farthershore product config --env preview --format json
91
118
  ```
92
119
 
93
120
  ### `farthershore product attempts`
@@ -98,6 +125,7 @@ product state.
98
125
 
99
126
  ```bash
100
127
  farthershore product attempts --format json
128
+ farthershore product attempts --env preview --format json
101
129
  ```
102
130
 
103
131
  ### `farthershore meter`
@@ -114,6 +142,7 @@ farthershore meter add ai_tokens \
114
142
  --format json
115
143
 
116
144
  farthershore meter list --format json
145
+ farthershore meter list --env preview --format json
117
146
  ```
118
147
 
119
148
  ### `farthershore feature`
@@ -126,6 +155,7 @@ farthershore feature add chat_completions \
126
155
  --format json
127
156
 
128
157
  farthershore feature bind chat_completions --plan pro --format json
158
+ farthershore feature list --env preview --format json
129
159
  ```
130
160
 
131
161
  ### `farthershore plan`
@@ -147,6 +177,8 @@ farthershore plan add pro \
147
177
  --meter ai_tokens \
148
178
  --feature chat_completions \
149
179
  --format json
180
+
181
+ farthershore plan list --env preview --format json
150
182
  ```
151
183
 
152
184
  ### `farthershore billing`
@@ -156,6 +188,7 @@ policy.
156
188
 
157
189
  ```bash
158
190
  farthershore billing strategy get --format json
191
+ farthershore billing strategy get --env preview --format json
159
192
 
160
193
  farthershore billing strategy set prepaid_credits \
161
194
  --transition preserve_current_period \
@@ -174,6 +207,7 @@ subscribers before applying them.
174
207
 
175
208
  ```bash
176
209
  farthershore transition preview --format json
210
+ farthershore transition preview --env preview --format json
177
211
  ```
178
212
 
179
213
  ### `farthershore validate [file]`
@@ -201,8 +235,23 @@ farthershore apply my-weather-api
201
235
 
202
236
  # Validate and remote-compile without applying
203
237
  farthershore apply --dry-run --format json
238
+ farthershore apply --env preview --dry-run --format json
239
+ ```
240
+
241
+ ## MCP tools
242
+
243
+ Run the MCP server with a maker token:
244
+
245
+ ```bash
246
+ FARTHERSHORE_TOKEN=mk_xxx farthershore-mcp
204
247
  ```
205
248
 
249
+ The MCP server exposes the same product-building workflow as the CLI:
250
+ product create/status/config, environment list/create/use, billing strategy
251
+ set, meter add, feature add, plan add, transition preview, and apply.
252
+ Every tool accepts optional `product` and `env` fields where relevant and
253
+ returns secret-free JSON.
254
+
206
255
  ### `farthershore set-key [token]`
207
256
 
208
257
  Set your API token. Interactive when run in a terminal, or pass the token as an argument for scripts.