Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script example for docker with configuration file #78

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,23 @@ accounts:
domain: <default-cloudflare-domain>
```

### Setup local `cloudflare-cli` command running docker with a config file
You can supply the docker version with your configuration file automatically with a small script. See above regarding the API Token creation.

```bash
mkdir -p $HOME/bin ; touch $HOME/bin/cloudflare-cli ; chmod 755 $HOME/bin/cloudflare-cli
cat > $HOME/bin/cloudflare-cli << END
#!/bin/bash
# CLI for interacting with Cloudflare
# https://github.com/danielpigott/cloudflare-cli
docker run --rm -it -v ~/.cfcli.yml:/root/.cfcli.yml dpig/cloudflare-cli "$@"
```

You can now run the `cloudflare-cli` command directly
```bash
cloudflare-cli ls
```

### Environment Variables

* Environment variables take precedence over the configuration file.
Expand Down