Skip to content

Repository files navigation

HarborClient CLI Request Plugin

Adds a CLI tab to the request editor that shows an equivalent harborclient command for the configured request. The command is editable — change it and click Update to apply the parsed request back to the active tab. A Copy button copies the current editor text.

Screenshot

Install

Build the plugin, then install the .hcp package or load the project folder unpacked:

pnpm install
pnpm build

In HarborClient: Settings → Plugins → Load unpacked… and select this directory.

Requires HarborClient with hc.host.applyRequestDraft support (SDK @harborclient/sdk ≥ 1.1.31).

Development

pnpm dev

Rebuilds dist/renderer.js on change when HarborClient file watching is enabled for unpacked plugins.

Bidirectional editing

  1. Open a request and switch to the CLI tab to see the generated command.
  2. Edit the command in the editor (method, URL, headers, body flags).
  3. Click Update to parse the command and replace the active request’s method, URL, headers, and body.
  4. Click Copy to copy the current editor contents.

The editor resyncs when you edit the request in other tabs (Params, Headers, Body, etc.).

Example commands

harborclient GET https://httpbin.org/get
harborclient POST https://httpbin.org/post -H 'X-Token: secret' --json '{"hello":"world"}'
harborclient POST https://httpbin.org/post -d 'plain text'

Limitations

Aspect Behavior
Variables Resolved from collection + active environment (environment wins on dupes)
Cookie jar Not included unless a Cookie header is set manually
Pre/post scripts Do not affect displayed CLI; Update does not modify scripts
urlencoded / multipart Exported as best-effort -d body text; body type may not round-trip
Auth tab Generated Authorization headers round-trip as headers, not Auth tab mode
Execution flags --timeout, --no-verify-ssl, and -v are ignored on Update

License

MIT

About

Adds a CLI request editor tab that shows an editable harborclient command and can update the request from pasted CLI.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages