@hedge-layer/cli
v0.2.0
Published
CLI for Hedge Layer — hedge real-world risks on Polymarket
Downloads
214
Maintainers
Readme
@hedge-layer/cli
Command-line interface for Hedge Layer — hedge real-world risks on Polymarket prediction markets.
Install
npm install -g @hedge-layer/cliRequires Node.js 22 or later.
Quick Start
# 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 assessAuthentication
The 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 listCommands
Markets
Polymarket orderbook tools.
# View orderbook for a specific CLOB token
hl markets orderbook <tokenId>
hl markets orderbook <tokenId> --size 1000Assess
Run 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>Hedge
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 -Profile
hl profileGlobal Options
| 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 |
JSON output
Every command supports --json for pipe-friendly output:
hl --json assess list | jq '.[0].id'Development
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 listPublishing
Releases 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. Requires an NPM_TOKEN secret in the repo settings.
Changelog
See CHANGELOG.md for release history.
License
MIT
