{"id":20607703,"url":"https://github.com/open-feature/cli","last_synced_at":"2026-02-20T01:03:00.396Z","repository":{"id":254110774,"uuid":"837408076","full_name":"open-feature/cli","owner":"open-feature","description":"OpenFeature’s official command-line tool","archived":false,"fork":false,"pushed_at":"2026-02-03T21:02:07.000Z","size":552,"stargazers_count":55,"open_issues_count":21,"forks_count":18,"subscribers_count":7,"default_branch":"main","last_synced_at":"2026-02-04T05:55:59.056Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/open-feature.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-02T22:59:56.000Z","updated_at":"2026-02-03T21:01:59.000Z","dependencies_parsed_at":"2024-11-04T14:35:01.458Z","dependency_job_id":"aacc4000-4782-4f76-b26a-2e7d666f9113","html_url":"https://github.com/open-feature/cli","commit_stats":null,"previous_names":["open-feature/codegen","open-feature/cli"],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/open-feature/cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-feature%2Fcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-feature%2Fcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-feature%2Fcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-feature%2Fcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-feature","download_url":"https://codeload.github.com/open-feature/cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-feature%2Fcli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29637924,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T22:32:43.237Z","status":"ssl_error","status_checked_at":"2026-02-19T22:32:38.330Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":[],"created_at":"2024-11-16T10:08:22.141Z","updated_at":"2026-02-20T01:03:00.390Z","avatar_url":"https://github.com/open-feature.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD033 --\u003e\n\u003c!-- x-hide-in-docs-start --\u003e\n\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/open-feature/community/0e23508c163a6a1ac8c0ced3e4bd78faafe627c7/assets/logo/horizontal/white/openfeature-horizontal-white.svg\" /\u003e\n    \u003cimg align=\"center\" alt=\"OpenFeature Logo\" src=\"https://raw.githubusercontent.com/open-feature/community/0e23508c163a6a1ac8c0ced3e4bd78faafe627c7/assets/logo/horizontal/black/openfeature-horizontal-black.svg\" /\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\n\u003ch2 align=\"center\"\u003eOpenFeature CLI\u003c/h2\u003e\n\u003c!-- x-hide-in-docs-end --\u003e\n\u003c!-- The 'github-badges' class is used in the docs --\u003e\n\u003cp align=\"center\" class=\"github-badges\"\u003e\n  \u003ca href=\"https://github.com/orgs/open-feature/projects/17\"\u003e\n    \u003cimg alt=\"work-in-progress\" src=\"https://img.shields.io/badge/status-WIP-yellow\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://cloud-native.slack.com/archives/C07DY4TUDK6\"\u003e\n    \u003cimg alt=\"Slack\" src=\"https://img.shields.io/badge/slack-%40cncf%2Fopenfeature-brightgreen?style=flat\u0026logo=slack\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003c!-- x-hide-in-docs-start --\u003e\n\n\u003e [!CAUTION]\n\u003e The OpenFeature CLI is experimental!\n\u003e Feel free to give it a shot and provide feedback, but expect breaking changes.\n\n[OpenFeature](https://openfeature.dev) is an open specification that provides a vendor-agnostic, community-driven API for feature flagging that works with your favorite feature flag management tool or in-house solution.\n\n## Overview\n\u003c!-- x-hide-in-docs-end --\u003e\n\nThe OpenFeature CLI is a command-line tool designed to improve the developer experience when working with feature flags.\nIt helps developers manage feature flags consistently across different environments and programming languages by providing powerful utilities for code generation, flag validation, and more.\n\nThe CLI bridges the gap between feature flag management systems and your application code by generating strongly typed flag accessors from a flag manifest. This approach provides:\n\n- **Type Safety**: Generate strongly-typed flag accessors for your preferred language\n- **Developer Experience**: Reduce errors and improve IDE autocomplete support\n- **Language Support**: Generate code for TypeScript, JavaScript, React, Go, C#, and more\n\n## Installation\n\n### via curl\n\nThe OpenFeature CLI can be installed using a shell command.\nThis method is suitable for most Unix-like operating systems.\n\n```bash\ncurl -fsSL https://openfeature.dev/scripts/install_cli.sh | sh\n```\n\n### via Docker\n\nThe OpenFeature CLI is available as a Docker image in the [GitHub Container Registry](https://github.com/open-feature/cli/pkgs/container/cli).\n\nYou can run the CLI in a Docker container using the following command:\n\n```bash\ndocker run -it -v $(pwd):/local -w /local ghcr.io/open-feature/cli:latest\n```\n\n### via Go\n\nIf you have `Go \u003e= 1.23` installed, you can install the CLI using the following command:\n\n```bash\ngo install github.com/open-feature/cli/cmd/openfeature@latest\n```\n\n### via pre-built binaries\n\nDownload the appropriate pre-built binary from the [releases page](https://github.com/open-feature/cli/releases).\n\n## Quick Start\n\n1. Create a flag manifest file in your project root:\n\n```bash\ncat \u003e flags.json \u003c\u003c EOL\n{\n  \"$schema\": \"https://raw.githubusercontent.com/open-feature/cli/refs/heads/main/schema/v0/flag-manifest.json\",\n  \"flags\": {\n    \"enableMagicButton\": {\n      \"flagType\": \"boolean\",\n      \"defaultValue\": false,\n      \"description\": \"Activates a special button that enhances user interaction with magical, intuitive functionalities.\"\n    }\n  }\n}\nEOL\n```\n\n\u003e [!NOTE]\n\u003e This is for demonstration purposes only.\n\u003e In a real-world scenario, you would typically want to fetch this file from a remote flag management service.\n\u003e See [here](https://github.com/open-feature/cli/issues/3), more details.\n\n2. Generate code for your preferred language:\n\n```bash\nopenfeature generate react\n```\n\nSee [here](./docs/commands/openfeature_generate.md) for all available options.\n\n3. View the generated code:\n\n```bash\ncat openfeature.ts\n```\n\n**Congratulations!**\nYou have successfully generated your first strongly typed flag accessors.\nYou can now use the generated code in your application to access the feature flags.\nThis is just scratching the surface of what the OpenFeature CLI can do.\nFor more advanced usage, read on!\n\n## Commands\n\nThe OpenFeature CLI provides the following commands:\n\n| Command | Description |\n|---------|-------------|\n| `init` | Initialize a new flag manifest |\n| `manifest` | Manage flag manifest files (add, list, delete) |\n| `compare` | Compare two flag manifests |\n| `generate` | Generate strongly typed flag accessors |\n| `pull` | Fetch flags from remote sources |\n| `push` | Push flags to remote services |\n| `version` | Display CLI version |\n\n### `init`\n\nInitialize a new flag manifest in your project.\n\n```bash\nopenfeature init\n```\n\nThis command creates a `flags.json` file in your current directory with the proper schema reference.\nYou can customize the manifest path using configuration options.\n\nSee [here](./docs/commands/openfeature_init.md) for all available options.\n\n### `manifest`\n\nManage flag manifest files with subcommands for adding, listing, and deleting flags.\n\n```bash\n# Add a new flag interactively\nopenfeature manifest add\n\n# Add a boolean flag\nopenfeature manifest add new-feature --default-value false\n\n# Add a string flag with description\nopenfeature manifest add welcome-message \\\n  --type string \\\n  --default-value \"Hello!\" \\\n  --description \"Welcome message for users\"\n\n# List all flags in the manifest\nopenfeature manifest list\n\n# Delete a flag from the manifest\nopenfeature manifest delete old-feature\n```\n\nThe manifest command provides:\n- **add**: Add new flags to your manifest file\n- **list**: Display all flags with their configuration\n- **delete**: Remove flags from your manifest file\n\nSee [here](./docs/commands/openfeature_manifest.md) for all available options.\n\n### `compare`\n\nCompare two feature flag manifests and display the differences.\n\n```bash\n# Compare your local manifest against another\nopenfeature compare --against production-flags.json\n\n# Compare with different output formats\nopenfeature compare --against other.json --output json\nopenfeature compare --against other.json --output yaml\nopenfeature compare --against other.json --output flat\n```\n\nOutput formats:\n- **tree**: Hierarchical tree view (default)\n- **flat**: Simple flat list\n- **json**: JSON format\n- **yaml**: YAML format\n\nSee [here](./docs/commands/openfeature_compare.md) for all available options.\n\n### `generate`\n\nGenerate strongly typed flag accessors for your project.\n\n```bash\n# List available languages\nopenfeature generate\n\n# Generate for a specific language\nopenfeature generate typescript\n\n# With custom output directory\nopenfeature generate typescript --output ./src/flags\n```\n\n**Supported Languages:**\n\n| Language | Description |\n|----------|-------------|\n| `react` | React hooks for feature flags |\n| `go` | Go flag accessors |\n| `csharp` | C# flag accessors |\n| `java` | Java flag accessors |\n| `python` | Python flag accessors |\n| `nestjs` | NestJS flag accessors |\n| `nodejs` | Node.js flag accessors |\n| `angular` | Angular flag accessors |\n\nSee [here](./docs/commands/openfeature_generate.md) for all available options.\n\n\u003e **_NOTE:_**\n\u003e Angular generated code requires `@openfeature/angular-sdk` version `1.1.0` or newer.\n\n### `pull`\n\nFetch feature flag configurations from a remote source.\n\n```bash\n# Pull flags from a remote API\nopenfeature pull --flag-source-url https://api.example.com\n\n# With authentication\nopenfeature pull --flag-source-url https://api.example.com --auth-token secret-token\n\n# Pull from a JSON file URL\nopenfeature pull --flag-source-url https://example.com/flags.json\n```\n\nThe pull command supports:\n- HTTP/HTTPS endpoints implementing the OpenFeature Manifest Management API\n- Direct JSON/YAML file URLs\n- Authentication via bearer tokens\n\nSee [here](./docs/commands/openfeature_pull.md) for all available options.\n\n### `push`\n\nPush local flag configurations to a remote flag management service.\n\n```bash\n# Push flags to a remote API\nopenfeature push --flag-source-url https://api.example.com --auth-token secret-token\n\n# Dry run to preview changes\nopenfeature push --flag-source-url https://api.example.com --dry-run\n```\n\nThe push command intelligently:\n- Fetches existing flags from the remote\n- Compares local flags with remote flags\n- Creates new flags that don't exist remotely\n- Updates existing flags that have changed\n\nSee [here](./docs/commands/openfeature_push.md) for all available options.\n\n### `version`\n\nPrint the version number of the OpenFeature CLI.\n\n```bash\nopenfeature version\n```\n\nSee [here](./docs/commands/openfeature_version.md) for all available options.\n\n## Flag Manifest\n\nThe flag manifest is a JSON file that defines your feature flags and their properties.\nIt serves as the source of truth for your feature flags and is used by the CLI to generate strongly typed accessors.\nThe manifest file should be named `flags.json` and placed in the root of your project.\n\n### Flag Manifest Structure\n\nThe flag manifest file should follow the [JSON schema](https://raw.githubusercontent.com/open-feature/cli/refs/heads/main/schema/v0/flag-manifest.json) with the following properties:\n\n- `$schema` - The URL of the JSON schema for validation\n- `flags` - An object containing the feature flags\n  - `flagKey` - A unique key for the flag\n    - `description` - A description of what the flag does\n    - `type` - The type of the flag (`boolean`, `string`, `number`, `object`)\n    - `defaultValue` - The default value of the flag\n\n### Example Flag Manifest\n\n```json\n{\n  \"$schema\": \"https://raw.githubusercontent.com/open-feature/cli/refs/heads/main/schema/v0/flag-manifest.json\",\n  \"flags\": {\n    \"uniqueFlagKey\": {\n      \"description\": \"Description of what this flag does\",\n      \"type\": \"boolean|string|number|object\",\n      \"defaultValue\": \"default-value\",\n    }\n  }\n}\n```\n\n## Remote Flag Management\n\nThe OpenFeature CLI supports synchronizing flags with remote flag management services through a standardized OpenAPI-based approach. This enables teams to:\n\n- **Pull flags** from centralized flag management systems\n- **Push flags** back to maintain consistency across environments\n- **Integrate** with any service that implements the Manifest Management API\n\n### OpenAPI Client Pattern\n\nThe CLI uses an OpenAPI-driven architecture for remote operations:\n\n1. **Standardized API**: All remote operations conform to the [Manifest Management API](./api/v0/sync.yaml) OpenAPI specification\n2. **Type-Safe Clients**: Generated clients provide compile-time safety and better IDE support\n3. **Provider Agnostic**: Any service implementing the API specification can integrate with the CLI\n\nFor detailed information about implementing or extending the OpenAPI client pattern, see the [OpenAPI Client Pattern documentation](./docs/openapi-client-pattern.md).\n\n### Implementing the Manifest Management API\n\nIf you're building a flag management service that needs to integrate with the OpenFeature CLI, implement the endpoints defined in the [sync.yaml](./api/v0/sync.yaml) specification:\n\n- `GET /openfeature/v0/manifest` - Retrieve the project manifest\n- `POST /openfeature/v0/manifest/flags` - Create new flags\n- `PUT /openfeature/v0/manifest/flags/{key}` - Update existing flags\n- `DELETE /openfeature/v0/manifest/flags/{key}` - Archive/delete flags\n\n## Configuration\n\nThe OpenFeature CLI uses an optional configuration file to override default settings and customize behavior.\nThis file can be in JSON or YAML format and should be named either `.openfeature.json` or `.openfeature.yaml`.\n\n### Configuration File Structure\n\n```yaml\n# Example .openfeature.yaml\nmanifest: \"flags/manifest.json\" # Overrides the default manifest path\ngenerate:\n  output: \"src/flags\" # Overrides the default output directory\n  # Any language-specific options can be specified here\n  # For example, for React:\n  react:\n    output: \"src/flags/react\" # Overrides the default React output directory\n  # For Go:\n  go:\n    package: \"github.com/myorg/myrepo/flags\" # Overrides the default Go package name\n    output: \"src/flags/go\" # Overrides the default Go output directory\n```\n\n### Configuration Priority\n\nThe CLI uses a layered approach to configuration, allowing you to override settings at different levels.\nThe configuration is applied in the following order:\n\n```mermaid\nflowchart LR\n  default(\"Default Config\")\n  config(\"Config File\")\n  args(\"Command Line Args\")\n  default --\u003e config\n  config --\u003e args\n```\n\n\u003c!-- x-hide-in-docs-start --\u003e\n## Get Involved\n\n- **GitHub Repository**: [open-feature/cli](https://github.com/open-feature/cli)\n- **CNCF Slack**: Join the conversation in the [#openfeature](https://cloud-native.slack.com/archives/C0344AANLA1) and [#openfeature-cli](https://cloud-native.slack.com/archives/C07DY4TUDK6) channel\n- **Regular Meetings**: Attend our [community calls](https://zoom-lfx.platform.linuxfoundation.org/meetings/openfeature)\n- **GitHub Issues**: Report bugs or request features in our [issue tracker](https://github.com/open-feature/cli/issues)\n- **Social Media**:\n  - Twitter: [@openfeature](https://twitter.com/openfeature)\n  - LinkedIn: [OpenFeature](https://www.linkedin.com/company/openfeature/)\n\nFor more information, visit our [community page](https://openfeature.dev/community/).\n\n## Support the project\n\n- Give this repo a ⭐️!\n- Share your experience and contribute back to the project\n\n## Thanks to everyone who has already contributed\n\n\u003ca href=\"https://github.com/open-feature/cli/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=open-feature/cli\" alt=\"Pictures of the folks who have contributed to the project\" /\u003e\n\u003c/a\u003e\n\nMade with [contrib.rocks](https://contrib.rocks).\n\u003c!-- x-hide-in-docs-end --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-feature%2Fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-feature%2Fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-feature%2Fcli/lists"}