Skip to content

Commit 5d11f87

Browse files
committed
Add project
1 parent 958ada3 commit 5d11f87

1 file changed

Lines changed: 380 additions & 0 deletions

File tree

_oss/bunny-cli.md

Lines changed: 380 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,380 @@
1+
---
2+
title: Bunny CLI
3+
period: 2026-Present
4+
date: 2026-04-09
5+
github: https://github.com/built-fast/bunny-cli
6+
license: MIT
7+
tags:
8+
- bunny
9+
- cli
10+
- cdn
11+
- dns
12+
- go
13+
languages:
14+
- name: Go
15+
icon: go
16+
tagline: CLI for the bunny.net API
17+
excerpt: |
18+
Command-line interface for the bunny.net API. Manage DNS zones, pull
19+
zones, storage, edge scripts, Shield security, and Stream video directly
20+
from your terminal.
21+
---
22+
23+
A command-line interface for the [bunny.net](https://bunny.net) API. Built in
24+
Go with interactive configuration, multiple output formats, built-in jq
25+
filtering, and watch mode for polling resources.
26+
27+
## Installation
28+
29+
### Homebrew
30+
31+
```bash
32+
brew install built-fast/devtools/bunny-cli
33+
```
34+
35+
### Go install
36+
37+
```bash
38+
go install github.com/built-fast/bunny-cli@latest
39+
```
40+
41+
### From source
42+
43+
```bash
44+
make build # produces ./bin/bunny
45+
```
46+
47+
## Quick Start
48+
49+
```bash
50+
# Interactive setup — creates ~/.config/bunny/config.toml
51+
bunny configure
52+
53+
# List pull zones
54+
bunny pullzones list --limit 50
55+
56+
# Get a DNS zone
57+
bunny dns get <zone_id>
58+
59+
# Create a DNS zone
60+
bunny dns create --domain example.com
61+
62+
# Upload a file to storage
63+
bunny storage cp local-file.txt my-zone/remote/path/
64+
65+
# Destructive operations require confirmation (or --yes)
66+
bunny dns delete <zone_id> --yes
67+
```
68+
69+
## Configuration
70+
71+
Three-tier configuration with flags taking highest priority:
72+
73+
1. **Command-line flags** (highest)
74+
2. **Environment variables**
75+
3. **Config file** `~/.config/bunny/config.toml` (lowest)
76+
77+
### Environment Variables
78+
79+
| Variable | Description |
80+
|----------|-------------|
81+
| `BUNNY_API_KEY` | API key (overrides config file) |
82+
| `BUNNY_API_URL` | API base URL (override for testing) |
83+
| `BUNNY_STORAGE_URL` | Storage API base URL (override for testing) |
84+
| `BUNNY_STREAM_URL` | Stream API base URL (override for testing) |
85+
86+
## API Reference
87+
88+
### DNS Zones
89+
90+
```bash
91+
bunny dns list
92+
bunny dns get <zone_id>
93+
bunny dns create --domain <domain>
94+
bunny dns update <zone_id>
95+
bunny dns delete <zone_id>
96+
bunny dns export <zone_id>
97+
bunny dns import <zone_id> <file>
98+
```
99+
100+
### DNS Records
101+
102+
```bash
103+
bunny dns records list <zone_id>
104+
bunny dns records add <zone_id> --type A --name www --value 1.2.3.4
105+
bunny dns records update <zone_id> <record_id>
106+
bunny dns records delete <zone_id> <record_id>
107+
```
108+
109+
### DNSSEC
110+
111+
```bash
112+
bunny dns dnssec enable <zone_id>
113+
bunny dns dnssec disable <zone_id>
114+
```
115+
116+
### Pull Zones
117+
118+
```bash
119+
bunny pullzones list
120+
bunny pullzones get <id>
121+
bunny pullzones create --name <name> --origin-url <url>
122+
bunny pullzones update <id> [--name <name>]
123+
bunny pullzones delete <id>
124+
bunny pullzones purge <id>
125+
```
126+
127+
### Pull Zones - Edge Rules
128+
129+
```bash
130+
bunny pullzones edge-rules list <pull_zone_id>
131+
bunny pullzones edge-rules add <pull_zone_id>
132+
bunny pullzones edge-rules enable <pull_zone_id> <edge_rule_id>
133+
bunny pullzones edge-rules disable <pull_zone_id> <edge_rule_id>
134+
bunny pullzones edge-rules delete <pull_zone_id> <edge_rule_id>
135+
```
136+
137+
### Pull Zones - Hostnames
138+
139+
```bash
140+
bunny pullzones hostnames list <pull_zone_id>
141+
bunny pullzones hostnames add <pull_zone_id> --hostname <hostname>
142+
bunny pullzones hostnames remove <pull_zone_id>
143+
```
144+
145+
### Storage Zones
146+
147+
```bash
148+
bunny storagezones list
149+
bunny storagezones get <id>
150+
bunny storagezones create --name <name> --region <region>
151+
bunny storagezones update <id>
152+
bunny storagezones delete <id>
153+
bunny storagezones reset-password <id>
154+
```
155+
156+
### Storage (File Operations)
157+
158+
```bash
159+
bunny storage ls <zone>[/<path>]
160+
bunny storage cp <src> <dst>
161+
bunny storage rm <zone>/<path>
162+
```
163+
164+
### Edge Scripts
165+
166+
```bash
167+
bunny scripts list
168+
bunny scripts get <id>
169+
bunny scripts create --name <name>
170+
bunny scripts update <id>
171+
bunny scripts delete <id>
172+
bunny scripts statistics <id>
173+
bunny scripts rotate-key <id>
174+
bunny scripts publish <script_id> [uuid]
175+
```
176+
177+
### Edge Scripts - Code, Releases, Secrets, Variables
178+
179+
```bash
180+
bunny scripts code get <id>
181+
bunny scripts code set <id>
182+
183+
bunny scripts releases list <script_id>
184+
bunny scripts releases active <script_id>
185+
186+
bunny scripts secrets list <script_id>
187+
bunny scripts secrets add <script_id>
188+
bunny scripts secrets update <script_id> <secret_id>
189+
bunny scripts secrets delete <script_id> <secret_id>
190+
191+
bunny scripts variables list <script_id>
192+
bunny scripts variables get <script_id> <variable_id>
193+
bunny scripts variables add <script_id>
194+
bunny scripts variables update <script_id> <variable_id>
195+
bunny scripts variables delete <script_id> <variable_id>
196+
```
197+
198+
### Shield - Zones
199+
200+
```bash
201+
bunny shield zones list
202+
bunny shield zones get <shield_zone_id>
203+
bunny shield zones get-by-pullzone <pull_zone_id>
204+
bunny shield zones create
205+
bunny shield zones update <shield_zone_id>
206+
```
207+
208+
### Shield - WAF
209+
210+
```bash
211+
bunny shield waf rules list <shield_zone_id>
212+
bunny shield waf profiles
213+
bunny shield waf engine
214+
215+
bunny shield waf custom-rules list <shield_zone_id>
216+
bunny shield waf custom-rules get <id>
217+
bunny shield waf custom-rules create
218+
bunny shield waf custom-rules update <id>
219+
bunny shield waf custom-rules delete <id>
220+
221+
bunny shield waf triggered list <shield_zone_id>
222+
bunny shield waf triggered update <shield_zone_id>
223+
```
224+
225+
### Shield - Rate Limits
226+
227+
```bash
228+
bunny shield rate-limits list <shield_zone_id>
229+
bunny shield rate-limits get <id>
230+
bunny shield rate-limits create
231+
bunny shield rate-limits update <id>
232+
bunny shield rate-limits delete <id>
233+
```
234+
235+
### Shield - Access Lists
236+
237+
```bash
238+
bunny shield access-lists list <shield_zone_id>
239+
bunny shield access-lists get <shield_zone_id> <id>
240+
bunny shield access-lists create <shield_zone_id>
241+
bunny shield access-lists update <shield_zone_id> <id>
242+
bunny shield access-lists delete <shield_zone_id> <id>
243+
bunny shield access-lists config
244+
bunny shield access-lists update <shield_zone_id> <config_id>
245+
```
246+
247+
### Shield - Bot Detection & Upload Scanning
248+
249+
```bash
250+
bunny shield bot-detection get <shield_zone_id>
251+
bunny shield bot-detection update <shield_zone_id>
252+
253+
bunny shield upload-scanning get <shield_zone_id>
254+
bunny shield upload-scanning update <shield_zone_id>
255+
```
256+
257+
### Shield - Event Logs & Metrics
258+
259+
```bash
260+
bunny shield event-logs <shield_zone_id> <date>
261+
262+
bunny shield metrics overview <shield_zone_id>
263+
bunny shield metrics detailed <shield_zone_id>
264+
bunny shield metrics rate-limits <shield_zone_id>
265+
bunny shield metrics waf-rule <shield_zone_id> <rule_id>
266+
bunny shield metrics bot-detection <shield_zone_id>
267+
bunny shield metrics upload-scanning <shield_zone_id>
268+
```
269+
270+
### Stream - Libraries
271+
272+
```bash
273+
bunny stream libraries list
274+
bunny stream libraries get <id>
275+
bunny stream libraries create --name <name>
276+
bunny stream libraries update <id>
277+
bunny stream libraries delete <id>
278+
bunny stream libraries reset-api-key <id>
279+
bunny stream libraries languages
280+
```
281+
282+
### Stream - Videos
283+
284+
```bash
285+
bunny stream videos list <library_id>
286+
bunny stream videos get <library_id> <video_id>
287+
bunny stream videos create <library_id> --title <title>
288+
bunny stream videos update <library_id> <video_id>
289+
bunny stream videos delete <library_id> <video_id>
290+
bunny stream videos upload <library_id> <file>
291+
bunny stream videos fetch <library_id> --url <url>
292+
bunny stream videos reencode <library_id> <video_id>
293+
bunny stream videos transcribe <library_id> <video_id>
294+
```
295+
296+
### Stream - Collections & Captions
297+
298+
```bash
299+
bunny stream collections list <library_id>
300+
bunny stream collections get <library_id> <collection_id>
301+
bunny stream collections create <library_id>
302+
bunny stream collections update <library_id> <collection_id>
303+
bunny stream collections delete <library_id> <collection_id>
304+
305+
bunny stream captions add <library_id> <video_id>
306+
bunny stream captions delete <library_id> <video_id>
307+
```
308+
309+
### Stream - Statistics
310+
311+
```bash
312+
bunny stream statistics <library_id>
313+
bunny stream heatmap <library_id> <video_id>
314+
```
315+
316+
### Account
317+
318+
```bash
319+
bunny account api-keys list
320+
bunny account audit-log <date>
321+
```
322+
323+
### Billing
324+
325+
```bash
326+
bunny billing details
327+
bunny billing records
328+
bunny billing summary
329+
bunny billing invoice <billing-record-id>
330+
```
331+
332+
### Global Resources
333+
334+
```bash
335+
bunny statistics # Global CDN statistics
336+
bunny regions # List CDN regions
337+
bunny countries # List countries
338+
```
339+
340+
## Output Format
341+
342+
```bash
343+
# Table (default), JSON, or pretty JSON
344+
bunny pullzones list --output table
345+
bunny pullzones list --output json
346+
bunny pullzones list --output json-pretty
347+
348+
# Select specific fields
349+
bunny pullzones list --field id,Name,Enabled
350+
351+
# Built-in jq filtering (no external jq needed)
352+
bunny pullzones list --jq '.[] | select(.Enabled == true) | .Name'
353+
```
354+
355+
## Watch Mode
356+
357+
Poll a resource on an interval:
358+
359+
```bash
360+
bunny pullzones get <id> --watch 10s
361+
```
362+
363+
## Shell Completion
364+
365+
```bash
366+
bunny completion bash
367+
bunny completion zsh
368+
bunny completion fish
369+
bunny completion powershell
370+
```
371+
372+
## Claude Code Skill
373+
374+
Install the bundled Claude Code skill to let Claude manage bunny.net resources directly:
375+
376+
```bash
377+
bunny skill install
378+
bunny skill uninstall
379+
bunny skill path
380+
```

0 commit comments

Comments
 (0)