A Python wrapper to provide a pip-installable OpenFGA CLI (fga) binary.
pip install openfga-cli-pyOr install a platform wheel directly from a GitHub Release (for air-gapped/offline use):
pip install https://github.com/neeve-ai/openfga-cli-py/releases/download/v0.7.19.0/openfga_cli_py-0.7.19.0-py2.py3-none-linux_x86_64.whlAfter installation, the fga binary is available in your environment:
fga version
fga store listOr invoke it from Python:
import subprocess
subprocess.run(["fga", "version"], check=True)| Platform | Architecture |
|---|---|
| Linux | x86_64, arm64, i686 |
| macOS | x86_64 (Intel), arm64 (Apple Silicon) |
| Windows | AMD64, ARM64, x86 |
Note: If your platform is not listed above, installation will fail with an error from
setuptools-download. Use a supported platform or build from source.
Note: In air-gapped environments, download the pre-built wheel for your platform from the GitHub Releases page and install it directly with
pip install <wheel-file>.
Add to your .pre-commit-config.yaml:
- repo: https://github.com/neeve-ai/openfga-cli-py
rev: v0.7.19.0
hooks:
- id: fga
args: [model, validate, --file, openfga.json]
pass_filenames: false
always_run: trueThe hook invokes fga directly. Pass any fga subcommands and flags via args.
Use the provided script to regenerate setup.cfg for a new upstream release:
chmod +x update_version.sh
./update_version.sh 0.7.20This downloads the official checksums.txt for the new version and rewrites setup.cfg
with updated URLs and SHA-256 hashes for all 8 platforms.
make install # installs the package and dependencies
make quality # runs: fga version && fga help, pytest, and builds platform wheelApache-2.0 — see LICENSE.