Skip to content

CLI

The hedge CLI is the fastest way for a broker to work with Hedge from a terminal or a script. It wraps the REST API and handles OAuth 2.1 sign-in and token refresh for you. Source lives at github.com/taventech/hedge-cli.

Terminal window
npm i -g hedge-broker
Terminal window
hedge login

By default hedge login uses the OAuth 2.1 device flow: it prints a short code and a URL, you approve the sign-in in the broker portal, and the CLI stores a short-lived token. On a machine with a browser, sign in with a loopback redirect instead:

Terminal window
hedge login --browser

Check who you are signed in as at any time with hedge whoami. For the full auth model, see Authentication.

The table below matches hedge-broker 0.2.0. Run hedge <command> --help for flags and examples on any command.

Command What it does
hedge appetite <class> [--state ST] [--lob slug] Check which markets have appetite for a class of business.
hedge market-requirements <marketId> --lob <slug> [--state ST] [--programs keys] What a market needs to quote a line: the application package plus per-program requirements. Market ids come from hedge appetite --json.
hedge submit --insured <name> --narrative <text> [flags] Create a submission (does not market it yet). Applicant, contact, address, and exposure flags are listed in hedge submit --help; --body <file|-> sends a full JSON body, with explicit flags taking precedence.
hedge upload <submissionId> <file.pdf> [--name label] Attach an ACORD, loss runs, or a supplement.
hedge requirements <submissionId> What the submission still needs (per market, forms, carrier questions).
hedge finalize <submissionId> Start marketing the submission to carriers.
hedge status <submissionId> Submission detail plus the live per-carrier marketing table, status roll-up, and documents on file.
hedge submissions [--status state] [--search q] [--limit n] [--offset n] [--updated-since iso] List your brokerage’s submissions, with filters and paging.
hedge documents <submissionId> List a submission’s finalized documents (ACORDs, quotes, binders).
hedge download <documentId> [-o file] Download a finalized document PDF.
hedge quotes <submissionId> List instant-quote carrier sessions and their open questions.
hedge answer <submissionId> <sessionId> --set k=v [--set k=v ...] Answer a carrier session’s questions.
hedge request-quote <submissionId> <sessionId> Close a carrier session, request an indication, then a quote.
hedge policies List bound policies with term dates.
hedge policy <policyId> Policy detail: term, premium, commission, payment plan, documents. Policy ids come from hedge policies --json.
hedge policy-doc <policyId> <kind> [-o file] Download a policy PDF; kind is binder, policy, or declarations.
hedge payments List payment and invoice status, with invoice links.
hedge whoami Show the signed-in broker and brokerage for the current token.
hedge login / hedge logout Sign in and out.

Prefer building the request in a file or another program? Send a full JSON body with --body. Explicit flags still win: top-level flag values replace matching body keys, applicant flags merge over the body’s applicant, and address flags merge into its mailing_address.

Terminal window
hedge submit --body ./submission.json
cat submission.json | hedge submit --body - --effective 2026-09-01

Every submit sends an Idempotency-Key header (a random UUID each run). Replay only engages when the same key is re-sent within 24 hours, so a scripted retry that must not double-create should pass its own key with --idempotency-key <key>.

  1. Check appetite for the class and state:

    Terminal window
    hedge appetite "roofing" --state CA
  2. Create the submission:

    Terminal window
    hedge submit \
    --insured "Acme Roofing LLC" \
    --state CA \
    --lob commercial_general_liability \
    --narrative "Residential roofing contractor, 12 employees, no prior losses."
  3. Upload supporting documents and confirm readiness:

    Terminal window
    hedge upload <submission-id> ./acord-125.pdf --name "ACORD 125"
    hedge requirements <submission-id>
  4. Hand it to Hedge to market:

    Terminal window
    hedge finalize <submission-id>
  5. Track progress and read results:

    Terminal window
    hedge status <submission-id>
    hedge quotes <submission-id>
    hedge documents <submission-id>
    hedge download <document-id> -o quote.pdf
    hedge policies
    hedge policy <policy-id>
    hedge policy-doc <policy-id> declarations