Skip to content

sandwichfarm/burrow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

burrow

burrow is a Bunny.net CLI written in Go.

Install (from source)

  1. Install Go (1.21+)
  2. Build and run:
go build ./cmd/burrow
./burrow --help

Or:

make build
./bin/burrow --help

Install to your $GOBIN / $GOPATH/bin:

make install
burrow --help

Setup

Authenticate once (stores your API key securely when possible):

burrow auth login
burrow auth status

Non-interactive options:

export BUNNY_API_KEY="..."
burrow auth login

printf "%s" "$BUNNY_API_KEY" | burrow auth login --stdin

Credential store selection:

  • macOS: Keychain (security)
  • Linux: secret-tool, then pass, else file fallback
  • Windows: Registry (value encrypted via DPAPI using powershell)

Override with BURROW_CREDENTIAL_STORE=keychain|secret-tool|pass|registry|file.

Usage

Generic API caller (works for any Bunny.net endpoint when you know METHOD + PATH):

burrow api GET /pullzone
burrow api GET /pullzone/123 --pretty
burrow api POST /pullzone --json '{"Name":"example"}'

Base URL resolution:

  • --base-url https://...
  • BURROW_BASE_URL=https://...
  • burrow config set --base-url https://...

Discover endpoints from the local contract:

burrow endpoints list
burrow endpoints resolve GET /pullzone/123
burrow endpoints call GET /pullzone/{id} --param id=123

endpoints call uses base_url from the contract when available (e.g. Stream API uses https://video.bunnycdn.com).

Setup diagnostics:

burrow doctor
burrow doctor --check-auth

Contracts + Scraping

Contracts are local JSON describing endpoints (see contracts/contract.json for the format).

Initialize and validate:

burrow contracts init
burrow contracts validate

Sync from Bunny.net API reference docs (recommended):

burrow contracts sync
burrow contracts validate

Import from an OpenAPI JSON document (if Bunny publishes one):

burrow contracts import-openapi --file ./openapi.json
# or:
burrow contracts import-openapi --url https://example.com/openapi.json

Queue a docs scrape and run it:

burrow scrape enqueue --url "https://docs.example.com/api-reference"
burrow scrape run

Bulk-enqueue from a sitemap:

burrow scrape sitemap --url "https://docs.example.com/sitemap.xml"
burrow scrape run

Optional LLM-assisted analyzer:

  • Set BURROW_LLM_ANALYZER to an executable that reads analyzer input JSON on stdin and prints an updated contract JSON on stdout.
  • Reference implementation (heuristic, no LLM): go build ./cmd/burrow-analyzer then export BURROW_LLM_ANALYZER=./burrow-analyzer.

Analyzer protocol:

  • stdin: JSON { "url": "...", "html": "<raw>", "contract": { ... } }
  • stdout: updated contract JSON (and nothing else)

About

cli for bunny.net

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published