@hardfin/cli 0.0.2-dev.10 → 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.
- package/README.md +69 -3
- package/dist/cli.js +1794 -102
- 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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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,53 @@ 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
|
+
|
|
218
|
+
## Serving an agent
|
|
219
|
+
|
|
220
|
+
```sh
|
|
221
|
+
hardfin mcp
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
It speaks the Model Context Protocol on standard input and output, so Claude, Codex or any
|
|
225
|
+
other client can run Hardfin commands.
|
|
226
|
+
|
|
227
|
+
```sh
|
|
228
|
+
claude mcp add hardfin -- hardfin mcp
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### One tool, and resources for the rest
|
|
232
|
+
|
|
233
|
+
Every tool a server lists sits in the agent's context for the entire session, so this server
|
|
234
|
+
offers one.
|
|
235
|
+
|
|
236
|
+
| Offered as | Holds | Costs context |
|
|
237
|
+
| --- | --- | --- |
|
|
238
|
+
| The `hardfin` tool | A list of arguments, such as `["asset", "list", "--limit", "5"]` | Always, and it is about 400 bytes |
|
|
239
|
+
| `hardfin://guide` | Every command, its flags, and the exit codes | Only when the agent reads it |
|
|
240
|
+
| `hardfin://commands` | The command tree as JSON | Only when the agent reads it |
|
|
241
|
+
|
|
242
|
+
Fifty tools would describe the same surface and crowd out the work. An agent that needs the
|
|
243
|
+
list reads a resource, or runs `["--help"]`.
|
|
244
|
+
|
|
245
|
+
A tool call runs the CLI itself, so an agent and a person get identical parsing, output and
|
|
246
|
+
exit codes.
|
|
247
|
+
|
|
248
|
+
### What it signs in as
|
|
249
|
+
|
|
250
|
+
The server uses whatever credential this machine holds, so an agent acts as the person who
|
|
251
|
+
ran `hardfin login`. Give an agent an API key through `HARDFIN_API_KEY` when it should act
|
|
252
|
+
as an integration instead.
|
|
253
|
+
|
|
188
254
|
## Diagnosing a problem
|
|
189
255
|
|
|
190
256
|
`hardfin status` prints everything a support request needs, and is the first thing to send.
|