{"id":23895474,"url":"https://github.com/michimani/cfkvs","last_synced_at":"2025-02-23T07:16:12.208Z","repository":{"id":254122846,"uuid":"844547184","full_name":"michimani/cfkvs","owner":"michimani","description":"A simple command line tool for CloudFront Key Value Store.","archived":false,"fork":false,"pushed_at":"2024-10-04T16:00:24.000Z","size":182,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-21T22:51:28.246Z","etag":null,"topics":["aws","aws-cloudfront"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michimani.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-19T13:34:39.000Z","updated_at":"2024-10-04T16:00:09.000Z","dependencies_parsed_at":"2024-09-17T09:10:22.645Z","dependency_job_id":null,"html_url":"https://github.com/michimani/cfkvs","commit_stats":null,"previous_names":["michimani/cfkvs"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michimani%2Fcfkvs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michimani%2Fcfkvs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michimani%2Fcfkvs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michimani%2Fcfkvs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michimani","download_url":"https://codeload.github.com/michimani/cfkvs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240280984,"owners_count":19776418,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-cloudfront"],"created_at":"2025-01-04T15:57:19.259Z","updated_at":"2025-02-23T07:16:12.084Z","avatar_url":"https://github.com/michimani.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"cfkvs\n===\n\nThis is a simple command line tool for CloudFront Key Value Store.\n\n[![codecov](https://codecov.io/gh/michimani/cfkvs/graph/badge.svg?token=PWKPWONA8G)](https://codecov.io/gh/michimani/cfkvs)\n\n## Features\n\n- KeyValueStore\n  - list\n  - create\n  - info\n  - sync\n- Item (Key-Value pair)\n  - list\n  - get\n  - put\n  - delete\n\n### Comparison with AWS CLI commands\n\n| AWS CLI | cfkvs |\n| --- | --- |\n| `cloudfront create-key-value-store` | `cfkvs kvs create` |\n| `cloudfront delete-key-value-store` | `cfkvs kvs delete` |\n| `cloudfront describe-key-value-store` | `cfkvs kvs info` |\n| `cloudfront list-key-value-stores` | `cfkvs kvs list` |\n| `cloudfront update-key-value-store` | - |\n| `cloudfront-keyvaluestore delete-key` | `cfkvs item delete` |\n| `cloudfront-keyvaluestore describe-key-value-store` | `cfkvs kvs info` |\n| `cloudfront-keyvaluestore get-key` | `cfkvs item get` |\n| `cloudfront-keyvaluestore list-keys` | `cfkvs item list` |\n| `cloudfront-keyvaluestore put-key` | `cfkvs item put` |\n| `cloudfront-keyvaluestore update-keys` | - |\n| - | `cfkvs kvs sync` |\n\n## Installation\n\n### Homebrew\n\n```bash\nbrew install michimani/tap/cfkvs\n```\n\n## Usage\n\n```\n$ cfkvs -h\n\nUsage: cfkvs \u003ccommand\u003e [flags]\n\nA simple cli tool to manage CloudFront Key Value Stores.\n\nFlags:\n  -h, --help              Show context-sensitive help.\n  -D, --debug             Enable debug mode.\n      --output=\"table\"    Output format. One of: json, table.\n      --version           Print version information and quit\n\nCommands:\n  kvs list       List key value stores in your account.\n  kvs create     Create a key value store.\n  kvs info       Show information of the key value store.\n  kvs sync       Sync items in the key value store with S3 object or specified JSON file.\n  item list      List items in the key value store.\n  item get       Get an item in the key value store.\n  item put       Put an item in the key value store.\n  item delete    Delete an item in the key value store.\n```\n\nRun `cfkvs \u003ccommand\u003e --help` for more information on a command.\n\n## Examples\n\n### Sync items in the key value store with S3 object\n\nAssume that the following key-value pairs exist in the KeyValueStore `cf-kvs-sample`.\n\n```\n+-------+---------+\n| KEY   | VALUE   |\n+-------+---------+\n| key-1 | value-1 |\n| key-2 | value-2 |\n| key-3 | value-3 |\n+-------+---------+\n```\n\nConsider synchronizing this KeyValueStore with the data of the following S3 object named `data.json`.\n\n```json\n{\n  \"data\": [\n    {\"key\": \"key-1\", \"value\": \"v 1\"},\n    {\"key\": \"key-2\", \"value\": \"value-2\"},\n    {\"key\": \"key-4\", \"value\": \"v 4\"}\n  ]\n}\n```\n\nYou can check the changes in the KeyValueStore by synchronizing it with `data.json` using the following command.\n\n```bash\n$ cfkvs kvs sync \\\n--kvs-name='cf-kvs-sample' \\\n--bucket=\"${YOUR_BUCKET_NAME}\" \\\n--key='data.json'\n```\n\n```\n[ADDED] Following items will be added.\n+---+-------+-------+\n| # | KEY   | VALUE |\n+---+-------+-------+\n| 1 | key-4 | v 4   |\n+---+-------+-------+\n\n[UPDATED] Following items will be updated.\n+---+-------+--------------+-------------+\n| # | KEY   | BEFORE VALUE | AFTER VALUE |\n+---+-------+--------------+-------------+\n| 1 | key-1 | value-1      | v 1         |\n+---+-------+--------------+-------------+\n\n[DELETED] No items will be deleted.\n```\n\nIf you want to delete keys that do not exist in `data.json`, add the `--delete` flag.\n\n```bash\n$ cfkvs kvs sync \\\n--name='cf-kvs-sample' \\\n--bucket=\"${YOUR_BUCKET_NAME}\" \\\n--key='data.json' \\\n--delete\n```\n\n```\n[ADDED] Following items will be added.\n+---+-------+-------+\n| # | KEY   | VALUE |\n+---+-------+-------+\n| 1 | key-4 | v 4   |\n+---+-------+-------+\n\n[UPDATED] Following items will be updated.\n+---+-------+--------------+-------------+\n| # | KEY   | BEFORE VALUE | AFTER VALUE |\n+---+-------+--------------+-------------+\n| 1 | key-1 | value-1      | v 1         |\n+---+-------+--------------+-------------+\n\n[DELETED] Following items will be deleted.\n+---+-------+---------+\n| # | KEY   | VALUE   |\n+---+-------+---------+\n| 1 | key-3 | value-3 |\n+---+-------+---------+\n```\n\nIf you add the `--yes` or `-y` flag, the synchronization will actually be executed.\n\n```bash\n$ cfkvs kvs sync \\\n--name='cf-kvs-sample' \\\n--bucket=\"${YOUR_BUCKET_NAME}\" \\\n--key='data.json' \\\n--delete \\\n--yes\n```\n\n### Sync items in the key value store with a JSON file\n\nYou can synchronize the key-value store with the JSON file specified by the `--file` flag in the same way as synchronizing with an S3 object.\n\nIf you specify the `--file` flag and `--bucket` and `--key` at the same time, the `--file` flag takes precedence.\n\n\n```bash\n$ cfkvs kvs sync \\\n--name='cf-kvs-sample' \\\n--file='./path/to/data.json'\n```\n\n### Describe a key value store\n\nThe Describe action for CloudFront Key Value Store has two actions: **CloudFront:DescribeKeyValueStore** and **CloudFrontKeyValueStore:DescribeKeyValueStore**. The `cfkvs kvs info` command can get the merged information of these actions.\n\n```bash\n$ cfkvs kvs info --kvs-name='cf-kvs-sample' --output=json\n```\n\nOutput:\n\n```json\n{\n    \"id\": \"xxxxxxxx-0000-0000-0000-xxxxxxxxxxxx\",\n    \"arn\": \"arn:aws:cloudfront::000000000000:key-value-store/xxxxxxxx-0000-0000-0000-xxxxxxxxxxxx\",\n    \"name\": \"cf-kvs-sample\",\n    \"comment\": \"sample kvs\",\n    \"status\": \"READY\",\n    \"itemCount\": 2,\n    \"totalSizeInBytes\": 8,\n    \"created\": \"2024-08-30T14:12:09.334Z\",\n    \"lastModified\": \"2024-08-30T14:12:09.334Z\",\n    \"failureReason\": \"\",\n    \"eTag\": \"E3XXXXXXXXXXXX\"\n}\n```\n\n\n## License\n\n[MIT](https://github.com/michimani/cfkvs/blob/main/LICENSE)\n\n## Author\n\n[michimani](https://github.com/michimani)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichimani%2Fcfkvs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichimani%2Fcfkvs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichimani%2Fcfkvs/lists"}