CLI for the Surf data platform — crypto market data, on-chain analytics, and more.
Every API endpoint is available as a CLI command, dynamically generated from the Surf OpenAPI spec.
curl -fsSL https://downloads.asksurf.ai/cli/releases/install.sh | shInstalls to ~/.local/bin. No sudo required.
To install a specific version:
curl -fsSL https://downloads.asksurf.ai/cli/releases/install.sh | sh -s v0.1.3go install github.com/asksurf-ai/surf-cli/cmd/surf@latest# Save your API key
surf auth --api-key sk-xxx
# Query market data
surf market-futures --symbol BTC
surf search-project --q bitcoin
# Update available commands from latest API spec
surf sync
# Show version
surf version
# Show auth status
surf auth
# Clear saved API key
surf auth --clearRun surf help to see all available commands.
API keys are resolved in this order:
SURF_API_KEYenvironment variable- OS keychain (macOS Keychain, Linux secret-service, Windows Credential Manager)
~/.surf/config.json(file fallback)
surf auth --api-key sk-xxx # Save (prefers keychain, falls back to file)
surf auth # Show current key source and masked value
surf auth --clear # Clear from both keychain and fileConfiguration is stored in ~/.surf/.
| Variable | Purpose | Default |
|---|---|---|
SURF_API_KEY |
API authentication token | — |
SURF_API_BASE_URL |
Override API gateway base URL | https://api.asksurf.ai/gateway/v1 |
Prerequisites: Go 1.25+
Build the binary and symlink it into ~/.local/bin/surf so the surf in your
PATH resolves to your local build:
go build -o bin/surf ./cmd/surf
ln -sf "$(pwd)/bin/surf" ~/.local/bin/surf
surf version # confirm you're on the local build
surf helpRebuild after changes — the symlink keeps pointing at bin/surf, so a fresh
go build -o bin/surf ./cmd/surf is all you need to re-run against new code.
To test against the staging CDN + API, install from the staging installer:
curl -fsSL https://downloads-stg.asksurf.ai/cli/releases/install.sh | shDo not run
surf installafterwards. It pulls the production binary fromdownloads.asksurf.aiand overwrites the staging one you just installed. Usesurf sync(spec refresh only) and direct API commands for testing instead.
To go back to production, re-run the production installer from the Install section.
Releases are built with GoReleaser and published to S3/CloudFront.
git tag v0.x.x
goreleaser release --cleanBuilds binaries for Linux, macOS, and Windows (amd64/arm64) and uploads to the configured release bucket.