@hardfin/cli 0.0.2-dev.11 → 0.0.2-dev.12

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 (3) hide show
  1. package/README.md +33 -3
  2. package/dist/cli.js +1594 -88
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -47,9 +47,28 @@ and the shape of the last segment decide the verb.
47
47
  | `PATCH /asset/{assetKey}` | `hardfin asset update <assetKey>` |
48
48
  | `PATCH /asset/{assetKey}/accounting` | `hardfin asset accounting update <assetKey>` |
49
49
 
50
- A path parameter becomes a positional argument. A query parameter becomes a flag, named in
51
- kebab case, and an array parameter becomes a flag you repeat. An enum parameter carries its
52
- values, so a wrong value fails locally with exit code 2 rather than at the API.
50
+ Everything an endpoint takes becomes a flag or an argument. No command asks for JSON.
51
+
52
+ | The document says | You type |
53
+ | --- | --- |
54
+ | A path parameter | a positional argument |
55
+ | A query or body field | `--field-name`, in kebab case |
56
+ | A field inside a nested object | `--address-city`, the path joined |
57
+ | An array of values | the flag, repeated |
58
+ | An array of objects | the flag, repeated, each carrying that element's fields as `key=value` |
59
+ | A file upload | `--file <path>`, sent as multipart |
60
+
61
+ ```sh
62
+ hardfin asset ownership create ast_4f9xk2mq7plr8stz \
63
+ --customer-id cst_a1 --date 2026-09-23 --sale-price 1500.00
64
+
65
+ hardfin asset move execute create \
66
+ --move assetId=ast_a1,locationId=loc_x \
67
+ --move assetId=ast_b2,locationId=loc_y
68
+ ```
69
+
70
+ An enum carries its values, so a wrong one fails locally with exit code 2 rather than at the
71
+ API. A required field missing is caught the same way, before any request is made.
53
72
 
54
73
  ### Overrides
55
74
 
@@ -185,6 +204,17 @@ environment, so `hardfin login` works out of the box.
185
204
  | `clientId`, or `HARDFIN_CLIENT_ID` | the client this CLI names itself as | the seeded Hardfin CLI client |
186
205
  | `issuerUrl`, or `HARDFIN_ISSUER_URL` | the authorization server | the API's host root |
187
206
 
207
+ ## Completing commands in your shell
208
+
209
+ ```sh
210
+ source <(hardfin completion zsh) # this shell, now
211
+ hardfin completion zsh >> ~/.zshrc # every shell after this one
212
+ ```
213
+
214
+ `bash`, `zsh`, `fish` and `powershell` each get a script. The script asks the CLI what may
215
+ follow what you have typed, so completions never fall behind the commands, including the ones
216
+ generated from the API document.
217
+
188
218
  ## Serving an agent
189
219
 
190
220
  ```sh