{"id":20376878,"url":"https://github.com/xjonathanlei/cf-pages-cli","last_synced_at":"2026-03-10T14:01:43.911Z","repository":{"id":154865289,"uuid":"632446105","full_name":"xJonathanLEI/cf-pages-cli","owner":"xJonathanLEI","description":"A simple command line utility for managing Cloudflare Pages projects","archived":false,"fork":false,"pushed_at":"2023-04-25T15:48:13.000Z","size":46,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-20T04:53:36.843Z","etag":null,"topics":["cloudflare","cloudflare-pages"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/cf-pages-cli","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xJonathanLEI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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,"zenodo":null}},"created_at":"2023-04-25T12:28:03.000Z","updated_at":"2024-11-29T18:07:07.000Z","dependencies_parsed_at":"2023-07-11T07:32:45.267Z","dependency_job_id":null,"html_url":"https://github.com/xJonathanLEI/cf-pages-cli","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/xJonathanLEI/cf-pages-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xJonathanLEI%2Fcf-pages-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xJonathanLEI%2Fcf-pages-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xJonathanLEI%2Fcf-pages-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xJonathanLEI%2Fcf-pages-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xJonathanLEI","download_url":"https://codeload.github.com/xJonathanLEI/cf-pages-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xJonathanLEI%2Fcf-pages-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30336061,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T12:41:07.687Z","status":"ssl_error","status_checked_at":"2026-03-10T12:41:06.728Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cloudflare","cloudflare-pages"],"created_at":"2024-11-15T01:39:51.925Z","updated_at":"2026-03-10T14:01:43.864Z","avatar_url":"https://github.com/xJonathanLEI.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003ecf-pages-cli\u003c/h1\u003e\n\u003c/p\u003e\n\n**Command line utility for managing Cloudflare Pages projects**\n\n[![crates-badge](https://img.shields.io/crates/v/cf-pages-cli.svg)](https://crates.io/crates/cf-pages-cli)\n\n## What is `cf-pages-cli`\n\n`cf-pages-cli` is a line utility for managing [Cloudflare Pages](https://pages.cloudflare.com/) projects. Currently, its only capability is managing environment variables, which is useful in CI/CD workflows to synchronize projects with variables stored in Git.\n\n## Installation\n\nWith `cargo` installed, install from crates.io:\n\n```console\ncargo install --locked --version 0.2.1 cf-pages-cli\n```\n\n## Usage\n\n### Synchronize variables\n\nFirst, make sure you have your Cloudflare account ID, as well as a valid Cloudflare API token (with the `Cloudflare Pages:Edit` permission). Export them as environment variables:\n\n```console\n$ export CLOUDFLARE_ACCOUNT=\"YOUR_ACCOUNT_ID\"\n$ export CLOUDFLARE_TOKEN=\"YOUR_API_TOKEN\"\n```\n\n_(It's also possible to use them as command line options via `--account` and `--token`, respectively, but it's easier to just export them as they're used in many commands.)_\n\nBy default, the command exports the latest settings for both the production and preview environments. You can also export the variables from a specific deployment by adding a `--deployment DEPLOYMENT_ID` option. Note that since each deployment only targets one environment, the other environment will be left as `null` in the resulting JSON file.\n\nThen, export the environment variables of your project:\n\n```console\n$ cf-pages get-env-vars --project YOUR_PROJECT_NAME --output ./vars.json\nEnvironment variables written to: ./vars.json\n```\n\n_(It's also possible to set the project name and file path via the `CF_PAGES_PROJECT` and `CF_PAGES_OUTPUT` environment variables, respectively.)_\n\nYou can also print the generated file content to stdout by omitting the `--output` option.\n\nNow, make changes to the `vars.json` file, and upload to Cloudflare:\n\n```console\n$ cf-pages set-env-vars --project YOUR_PROJECT_NAME --file ./vars.json\nEnvironment variables successfully updated\n```\n\n### Generate `.env` files\n\nThe `vars.json` file exported with the `get-env-vars` can also be used to generate `.env` files, which are useful for front-end development:\n\n```console\n$ cf-pages to-env-file --output ./.env ./vars.json\nEnvironment variables written to: ./.env\n```\n\nYou can also print the generated file content to stdout by omitting the `--output` option.\n\nBy default, environment variables for the production environment are exported. To export the preview environment instead, add the `--environment preview` option.\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](./LICENSE-APACHE) or \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n- MIT license ([LICENSE-MIT](./LICENSE-MIT) or \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxjonathanlei%2Fcf-pages-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxjonathanlei%2Fcf-pages-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxjonathanlei%2Fcf-pages-cli/lists"}