Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jordantrizz/cloudflare-cli

CLI utility managing CloudFlare services using CloudFlare API
https://github.com/jordantrizz/cloudflare-cli

api cli cloudflare dns php shell

Last synced: 10 days ago
JSON representation

CLI utility managing CloudFlare services using CloudFlare API

Awesome Lists containing this project

README

        

## DESCRIPTION

CLI utility managing CloudFlare services - highly focused on DNS -
using CloudFlare API

## SYNOPSIS

```
Usage: cloudflare [Options]
Options:
--details, -d Display detailed info where possible
--debug, -D Display API debugging info
--quiet, -q Less verbose
-E
-T
Environment variables:
CF_ACCOUNT - email address (as -E option)
CF_TOKEN - API token (as -T option)
Enter "cloudflare help" to list available commands.
```

## COMMAND REFERENCE

```
$ cloudflare help
Commands:
show, add, delete, change, clear, invalidate, check
```

```
$ cloudflare show
Parameters:
zones, settings, records, listing
```

```
$ cloudflare show zones
example.net active #IDSTRING OLD-NS1,OLD-NS2 NEW-NS1,NEW-NS2
```

```
$ cloudflare show settings
Usage: cloudflare show settings
```

```
$ cloudflare show settings example.net
advanced_ddos off
always_online on
automatic_https_rewrites off
...
```

```
$ cloudflare show records
Usage: cloudflare show records
```

```
$ cloudflare show records example.net
www auto CNAME example.net. ; proxiable,proxied #IDSTRING
@ auto A 198.51.100.1 ; proxiable,proxied #IDSTRING
* 3600 A 198.51.100.2 ; #IDSTRING
...
```

```
$ cloudflare show listings
198.51.100.0/24 whitelist 2014-10-30T05:31:30.099176Z # NOTES
198.51.100.4 block 2014-10-30T05:31:30.099176Z # NOTES
CN challenge 2014-10-30T05:31:30.099176Z # NOTES
...
```

```
$ cloudflare add
Parameters:
zone, record, whitelist, blacklist, challenge
```

```
$ cloudflare add zone
Usage: cloudflare add zone
```

```
$ cloudflare add record
Usage: cloudflare add record [ttl] [prio] [service] [protocol] [weight] [port]
domain zone to register the record in, see 'show zones' command
one of: A, AAAA, CNAME, MX, NS, SRV, TXT, SPF, LOC
subdomain name, or "@" to refer to the domain's root
IP address for A, AAAA
FQDN for CNAME, MX, NS, SRV
any text for TXT, spf definition text for SPF
coordinates for LOC (see RFC 1876 section 3)
[ttl] Time To Live, 1 = auto
[prio] required only by MX and SRV records, enter "10" if unsure
These ones are only for SRV records:
[service] service name, eg. "sip"
[protocol] tcp, udp, tls
[weight] relative weight for records with the same priority
[port] layer-4 port number
```

```
$ cloudflare add whitelist
Usage: cloudflare add [] [] [note]
```

```
$ cloudflare delete
Parameters:
zone, record, listing
```

```
$ cloudflare delete zone
Usage: cloudflare delete zone
```

```
$ cloudflare delete record
Usage: cloudflare delete record [ [ | first] | [|] ]
```

```
$ cloudflare delete record ftp.example.net
```

```
$ cloudflare delete record example.net 1234567890abcdef1234567890abcdef
```

```
$ cloudflare delete listing
Usage: cloudflare delete listing [] [first]
```

```
$ cloudflare change
Parameters:
zone, record
```

```
$ cloudflare change zone
Usage: cloudflare change zone [ [ ... ]]
```

```
$ cloudflare change zone example.net
Settings:
security_level [under_attack | high | medium | low | essentially_off]
cache_level [aggressive | basic | simplified]
rocket_loader [on | off | manual]
minify
development_mode [on | off]
mirage [on | off]
ipv6 [on | off]
Other: see output of 'show zone' command
```

```
$ cloudflare change record
Usage: cloudflare set record [type | first | oldcontent ] [ [ ... ]]
You must enter "type" and the record type (A, MX, ...) when the record name is ambiguous,
or enter "first" to modify the first matching record in the zone,
or enter "oldcontent" and the exact content of the record you want to modify if there are more records with the same name and type.
Settings:
newname Rename the record
newtype Change type
content See description in 'add record' command
ttl See description in 'add record' command
proxied Turn CF proxying on/off
```

```
$ cloudflare clear
Parameters:
cache
```

```
$ cloudflare clear cache
Usage: cloudflare clear cache
```

```
$ cloudflare invalidate
Usage: cloudflare invalidate [url-2 [url-3 [...]]]
```

```
$ cloudflare check
Parameters:
zone
```

```
$ cloudflare check zone
Usage: cloudflare check zone
```

## REQUIREMENTS

- bash 4.x
- curl
- php (php-cli) 5.x

## DONATE

Support me to improve cloudflare-cli