Skip to content

Repository files navigation

openfga-cli-py

A Python wrapper to provide a pip-installable OpenFGA CLI (fga) binary.

CI PyPI

Installation

pip install openfga-cli-py

Or 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.whl

Usage

After installation, the fga binary is available in your environment:

fga version
fga store list

Or invoke it from Python:

import subprocess
subprocess.run(["fga", "version"], check=True)

Supported Platforms

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>.

As a pre-commit hook

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: true

The hook invokes fga directly. Pass any fga subcommands and flags via args.

Updating to a new OpenFGA CLI version

Use the provided script to regenerate setup.cfg for a new upstream release:

chmod +x update_version.sh
./update_version.sh 0.7.20

This downloads the official checksums.txt for the new version and rewrites setup.cfg with updated URLs and SHA-256 hashes for all 8 platforms.

Development

make install   # installs the package and dependencies
make quality   # runs: fga version && fga help, pytest, and builds platform wheel

License

Apache-2.0 — see LICENSE.

About

python3/pip3 wrapper for installing openfga cli

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages