Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saibotsivad/cloudflare-worker-key-value
CLI tool for interacting with the Cloudflare Worker Key Value store.
https://github.com/saibotsivad/cloudflare-worker-key-value
Last synced: 18 days ago
JSON representation
CLI tool for interacting with the Cloudflare Worker Key Value store.
- Host: GitHub
- URL: https://github.com/saibotsivad/cloudflare-worker-key-value
- Owner: saibotsivad
- License: other
- Created: 2020-02-09T03:52:56.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-03-14T04:18:30.000Z (over 4 years ago)
- Last Synced: 2024-10-03T07:20:57.344Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# cloudflare-worker-key-value
CLI tool for interacting with the Cloudflare Worker Key Value store.
This CLI tool interacts with the Cloudflare API, documented [here](https://api.cloudflare.com/#workers-kv-namespace-properties). The response from the API is piped to stdout, so you can pipe it to files or other tools.
## install
The usual way:
```bash
npm install -g cloudflare-worker-key-value
```This adds the CLI command `cfwkv` to your environment.
## configure
You will need to pass in configuration details, such as your Cloudflare account email address, zone identifier, and the token key.
Pass those properties in by either setting them with the CLI parameter, e.g. `[email protected]` or by setting the appropriate environment variable. (Pass in the `--help` flag for more details.)
## use it
Create a namespace:
```bash
$ cfwkv namespace create "My Test Namespace"{
"result": {
"id": "b39d89e33d3c4cc99697afde12958bf9",
"title": "My Test Namespace",
"supports_url_encoding": true
},
"success": true,
"errors": [],
"messages": []
}
```Set a key value in that namespace:
```bash
$ cfwkv key set b39d89e33d3c4cc99697afde12958bf9 key1 "hello world"{
"result": null,
"success": true,
"errors": [],
"messages": []
}
```Get a key value in that namespace:
```bash
$ cfwkv key get b39d89e33d3c4cc99697afde12958bf9 key1hello world
```## compatability
This CLI tool doesn't yet support the bulk operations, but if you need them please open a new issue in Github and I can add them.
## license
All content released and published under the [Very Open License](http://veryopenlicense.com).
Made with love ❤️ by [Tobias Davis](https://davistobias.com)