-
-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Thomas Poignant <[email protected]>
- Loading branch information
1 parent
71c7f0b
commit 6484b9f
Showing
5 changed files
with
90 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
sidebar_position: 1 | ||
title: Command Line | ||
description: The GO Feature Flag Command Line is a CLI tool to interact with GO Feature Flag in your terminal. | ||
--- | ||
|
||
# Command Line Tool | ||
|
||
The GO Feature Flag Command Line is a CLI tool to interact with GO Feature Flag in your terminal. | ||
|
||
It offers a variety of commands to interact with GO Feature Flag, for now the supported commands are: | ||
- [`evaluate`](./evaluate) to evaluate feature flags directly in your terminal | ||
- [`lint`](./linter) to validate a configuration file format. | ||
|
||
## Install the GO Feature Flag Command Line | ||
|
||
### Install using Homebrew (mac and linux) | ||
```shell | ||
brew tap thomaspoignant/homebrew-tap | ||
brew install go-feature-flag-cli | ||
``` | ||
|
||
### Install using Scoop (windows) | ||
```shell | ||
scoop bucket add org https://github.com/go-feature-flag/scoop.git | ||
scoop install go-feature-flag-cli | ||
``` | ||
|
||
### Install using Docker | ||
```shell | ||
docker pull thomaspoignant/go-feature-flag-cli:latest | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
sidebar_position: 11 | ||
title: Evaluate command line | ||
description: Evaluate feature flags directly in your terminal | ||
--- | ||
|
||
# Evaluate feature flags directly in your terminal | ||
|
||
Sometimes for debug or testing purposes, you may want to be able to know what will be the variant used during the evaluation of your feature flag. | ||
With the GO Feature Flag Command Line, you can evaluate a feature flag directly in your terminal. | ||
|
||
:::tip | ||
You can also use the `evaluate` command to use feature flags in your CI/CD pipelines. | ||
::: | ||
|
||
## Install the Command Line | ||
|
||
Check the [installation guide](./cli) to install the `go-feature-flag-cli`. | ||
|
||
## Use the evaluate command in your terminal | ||
|
||
```shell | ||
./go-feature-flag-cli evaluate \ | ||
--config="<location_of_your_flag_configuration_file>" \ | ||
--format="yaml" \ | ||
--flag="<name_of_your_flag_to_evaluate>" \ | ||
--ctx='<evaluation_ctx_as_json_string>' | ||
``` | ||
|
||
| param | description | | ||
|------------|------------------------------------------------------------------------------------------------------------------------| | ||
| `--config` | **(mandatory)** The location of your configuration file. | | ||
| `--ctx` | **(mandatory)** The evaluation context used to evaluate the flag in json format (ex: `{"targetingKey":"123"}`). | | ||
| `--format` | The format of your configuration flag _(acceptable values:`yaml`, `json`, `toml`)_.<br/>Default: **`yaml`** | | ||
| `--flag` | The name of the flag you want to evaluate, if omitted all flags will be evaluated | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters