Command-line interface for Hedge Layer — hedge real-world risks on Polymarket prediction markets.
npm install -g @hedge-layer/cliRequires Node.js 22 or later.
# 1. Create an API token at https://hedgelayer.ai/settings → API Tokens
# 2. Authenticate the CLI
hl auth login
# 3. Start an interactive risk assessment
hl assessThe CLI uses API tokens created in the Hedge Layer web app. Tokens are stored locally in ~/.hedgelayer/config.json.
hl auth login # Paste your API token (interactive)
hl auth status # Check current authentication
hl auth logout # Remove stored tokenYou can also pass a token inline for CI/scripts:
hl --token hl_abc123... assess listPolymarket orderbook tools.
# View orderbook for a specific CLOB token
hl markets orderbook <tokenId>
hl markets orderbook <tokenId> --size 1000Run AI-powered risk assessments interactively.
# Start an interactive chat assessment
hl assess
# List past assessments
hl assess list
hl assess list --status completed
# View a specific assessment
hl assess show <id>
# Delete an assessment
hl assess delete <id>Calculate hedge positions from a risk profile JSON file.
# From a file
hl hedge profile.json
# From stdin
echo '{
"location": "33109",
"assetType": "residential",
"riskTypes": ["hurricane", "flood"],
"assetValue": 500000
}' | hl hedge -hl profile| Flag | Description |
|---|---|
--json |
Machine-readable JSON output |
--api-url <url> |
Override API base URL (default: https://hedgelayer.ai) |
--token <token> |
Override stored API token |
--verbose |
Show HTTP request/response details |
--no-color |
Disable colored output |
Every command supports --json for pipe-friendly output:
hl --json assess list | jq '.[0].id'git clone https://github.com/hedge-layer/hedge-layer-cli.git
cd hedge-layer-cli
npm install
npm run build # Build with tsup
npm run dev # Watch mode
# Test against local dev server
node dist/index.mjs --api-url http://localhost:3000 assess listReleases are automated via GitHub Actions. To publish a new version:
npm version patch # or minor / major
git push --tagsThe workflow builds and publishes to npm when a version tag (v*) is pushed. Authentication uses npm's OIDC trusted publishers — no secrets required.
See CHANGELOG.md for release history.
MIT