@fredlackey/cli-cloudflare 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -12
- package/package.json +1 -1
- package/src/bin/cloudflare.js +0 -0
package/README.md
CHANGED
|
@@ -8,30 +8,49 @@ Command-line interface for [Cloudflare](https://www.cloudflare.com) zone, DNS, a
|
|
|
8
8
|
npm install -g @fredlackey/cli-cloudflare
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
## Configure
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
cloudflare configure \
|
|
15
|
-
--api-token <token> \
|
|
16
|
-
--account-id <id>
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Running `cloudflare configure` without flags prompts for each value interactively. Credentials are stored in `~/.config/cli-cloudflare/config.json` and that file is the only config source. There are no environment variables to set.
|
|
20
|
-
|
|
21
11
|
## Usage
|
|
22
12
|
|
|
13
|
+
Every command accepts credentials directly as flags. No setup step is required.
|
|
14
|
+
|
|
23
15
|
```
|
|
24
|
-
cloudflare zone list
|
|
25
|
-
cloudflare dns list --zone example.com
|
|
16
|
+
cloudflare zone list --api-token <token>
|
|
17
|
+
cloudflare dns list --zone example.com --api-token <token>
|
|
26
18
|
cloudflare dns create \
|
|
19
|
+
--api-token <token> \
|
|
27
20
|
--zone example.com \
|
|
28
21
|
--type A \
|
|
29
22
|
--name www \
|
|
30
23
|
--content 192.168.1.1
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
If you've already run `cloudflare configure`, you can omit the credential flags:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
cloudflare zone list
|
|
31
30
|
cloudflare accounts catalog --zone "*.com"
|
|
32
31
|
cloudflare token verify
|
|
33
32
|
```
|
|
34
33
|
|
|
34
|
+
## Configure (Optional)
|
|
35
|
+
|
|
36
|
+
**The `configure` command is optional.** Every command accepts credentials directly as flags (e.g. `--api-token`, `--account-id`). You never need to run `configure` to use this tool. It exists as a convenience so you don't have to pass the same flags on every invocation.
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
cloudflare configure \
|
|
40
|
+
--api-token <token> \
|
|
41
|
+
--account-id <id>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Running `cloudflare configure` without flags prompts for each value interactively. Credentials are stored in `~/.config/cli-cloudflare/config.json` and that file is the only config source. There are no environment variables to set.
|
|
45
|
+
|
|
46
|
+
If a required credential is missing at runtime, the error tells you exactly what to do:
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"error": "Missing required value: --api-token. Pass it as a flag or run \"cloudflare configure\"."
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
35
54
|
## Full Command Reference
|
|
36
55
|
|
|
37
56
|
For the complete list of commands and flags, see [COMMANDS.md](COMMANDS.md).
|
package/package.json
CHANGED
package/src/bin/cloudflare.js
CHANGED
|
File without changes
|