https://github.com/belingud/py-flagsmith-cli
flagsmith-cli Python Implementation
https://github.com/belingud/py-flagsmith-cli
flagsmith flagsmith-cli py-flagsmith-cli python python-cli
Last synced: 2 months ago
JSON representation
flagsmith-cli Python Implementation
- Host: GitHub
- URL: https://github.com/belingud/py-flagsmith-cli
- Owner: belingud
- License: mit
- Created: 2024-06-02T14:19:15.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-24T11:37:51.000Z (6 months ago)
- Last Synced: 2025-04-09T18:57:46.199Z (2 months ago)
- Topics: flagsmith, flagsmith-cli, py-flagsmith-cli, python, python-cli
- Language: Python
- Homepage:
- Size: 125 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# py-flagsmith-cli
[](https://pypi.org/project/py-flagsmith-cli/) [](https://opensource.org/licenses/MIT)  
[](https://github.com/belingud/py-flagsmith-cli/actions/workflows/github-code-scanning/codeql) [](https://coveralls.io/github/belingud/py-flagsmith-cli?branch=master)
flagsmith-cli Python Implementation.
Homepage: https://github.com/belingud/py-flagsmith-cli
You can install with pip:
```shell
pip install py-flagsmith-cli
```Recommand use `pipx`:
```shell
pipx install py-flagsmith-cli
```And use in cmd:
```shell
pysmith -hUsage: pysmith [OPTIONS] COMMAND [ARGS]...
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --install-completion Install completion for the current shell. │
│ --show-completion Show completion for the current shell, to copy it or customize the │
│ installation. │
│ --help -h Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────╮
│ get Retrieve flagsmith features from the Flagsmith API and output them to file. │
│ showenv Show the current flagsmith environment setup. Including environment id and api host. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```Include two commands `get` and `showenv`.
`pysmith get`
```shell
pysmith get -hUsage: pysmith get [OPTIONS] [ENVIRONMENT]
Retrieve flagsmith features from the Flagsmith API and output them to file.
EXAMPLES
$ pysmith get$ FLAGSMITH_ENVIRONMENT=x pysmith get
$ pysmith get
$ pysmith get -o ./my-file.json
$ pysmith get -a https://flagsmith.example.com/api/v1/
$ pysmith get -i flagsmith_identity
$ pysmith get -np
╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────╮
│ environment [ENVIRONMENT] The flagsmith environment key to use, defaults to the environment variable │
│ FLAGSMITH_ENVIRONMENT │
│ [env var: FLAGSMITH_ENVIRONMENT] │
│ [default: None] │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --output -o The file path output [default: None] │
│ --api -a The API URL to fetch the feature flags from │
│ [default: https://edge.api.flagsmith.com/api/v1/] │
│ --identity -i The identity for which to fetch feature flags [default: None] │
│ --no-pretty -np Do not prettify the output JSON │
│ --entity -e The entity to fetch, this will either be the flags or an environment document │
│ used for Local Evaluation Mode. Refer to │
│ https://docs.flagsmith.com/clients/server-side. │
│ [default: flags] │
│ --help -h Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
````pysmith showenv`
```shell
pysmith showenv -hUsage: pysmith showenv [OPTIONS]
Show the current flagsmith environment setup. Including environment id and api host.
EXAMPLES:
$ pysmith showenv
Current flagsmith env setup>>>
flagsmith environment ID:
flagsmith host:╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help -h Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```**Note**: There is some differences with `flagsmith-cli`:
1. `pysmith` will not save into json file if you don't specify `-o`
2. `pysmith` will pretty json output as default, use `-np` to disable it. `flagsmith-cli` does the oppositeRefer to:
1. https://docs.flagsmith.com/clients/CLI
2. https://github.com/Flagsmith/flagsmith-cli## License
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fbelingud%2Fpy-flagsmith-cli?ref=badge_large)