@hardfin/cli 0.1.0-dev.23 → 0.1.0-dev.25

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
@@ -224,13 +224,37 @@ environment, so `hardfin login` works out of the box.
224
224
  ## Completing commands in your shell
225
225
 
226
226
  ```sh
227
- source <(hardfin completion zsh) # this shell, now
228
- hardfin completion zsh >> ~/.zshrc # every shell after this one
227
+ hardfin completion install # every shell after this one
229
228
  ```
230
229
 
231
- `bash`, `zsh`, `fish` and `powershell` each get a script. The script asks the CLI what may
232
- follow what you have typed, so completions never fall behind the commands, including the ones
233
- generated from the API document.
230
+ `install` finds your shell from `$SHELL`, shows what it will change, and asks before changing
231
+ it. Name the shell to install for another one, and pass `--yes` to skip the question.
232
+
233
+ | Shell | The script is written to | And loaded from |
234
+ | ---------- | ----------------------------------------- | ------------------------------------------ |
235
+ | bash | `~/.local/share/hardfin/completion.bash` | `~/.bashrc`, or `~/.bash_profile` on macOS |
236
+ | zsh | `~/.local/share/hardfin/completion.zsh` | `~/.zshrc` |
237
+ | fish | `~/.config/fish/completions/hardfin.fish` | fish, by itself |
238
+ | PowerShell | `~/.local/share/hardfin/completion.ps1` | the profile PowerShell reports |
239
+
240
+ The lines added to a startup file sit between `# >>> hardfin completion >>>` and
241
+ `# <<< hardfin completion <<<`. Installing again replaces them, and
242
+ `hardfin completion uninstall` removes them with the script. Install again after upgrading, so
243
+ the script matches the CLI.
244
+
245
+ To complete in the current shell without installing anything:
246
+
247
+ ```sh
248
+ source <(hardfin completion zsh)
249
+ ```
250
+
251
+ The script asks the CLI what may follow what you have typed, so completions never fall behind
252
+ the commands, including the ones generated from the API document. It offers commands, flags,
253
+ the values a flag accepts, and file paths where a flag takes one. zsh, fish and PowerShell
254
+ show a description beside each.
255
+
256
+ The script calls `hardfin` by name, so it needs `hardfin` on your `PATH`. Running
257
+ `node dist/cli.js` from a checkout leaves nothing for it to call, and `npm link` fixes that.
234
258
 
235
259
  ## Serving an agent
236
260
 
@@ -354,7 +378,7 @@ npm run check-types # tsc
354
378
  npm run lint # eslint, with type-aware rules
355
379
  npm run prettier:write # formatting
356
380
  npm test # vitest
357
- npm run build # tsdown, into dist/cli.js
381
+ npm run build # tsdown, into dist/, then the completion tree
358
382
  ```
359
383
 
360
384
  CI runs all five on every pull request, plus a check that the generated commands still match