Command-line Tools
Casbin CLIs expose the Casbin API from the command line so you can load models and policies, run enforce checks, and manage policy from your shell. Implementations are available for Go, Java, Node.js, Python, .NET, and Rust.
การติดตั้ง
Go (casbin-go-cli)
-
Clone the repository:
git clone https://github.com/apache/casbin-go-cli.git -
Build the CLI:
cd casbin-go-cli
go build -o casbin
Rust (casbin-rust-cli)
Install from crates.io
cargo install casbin-rust-cli
Build from source
-
Clone the repository:
git clone https://github.com/casbin-rs/casbin-rust-cli.git -
Build with release optimizations:
cd casbin-rust-cli
cargo build --release
Java (casbin-java-cli)
-
Clone the repository:
git clone https://github.com/jcasbin/casbin-java-cli.git -
Build using Maven (the JAR file will be created in the
targetdirectory):cd casbin-java-cli
mvn clean install
Python (casbin-python-cli)
-
Clone the repository:
git clone https://github.com/apache/casbin-python-cli.git -
Install required dependencies:
cd casbin-python-cli
pip install -r requirements.txt -
Run the CLI:
python -m casbin_cli.client [command] [options] [args]
.NET (casbin-dotnet-cli)
-
Clone the repository:
git clone https://github.com/casbin-net/casbin-dotnet-cli.git -
Build the project:
cd casbin-dotnet-cli
dotnet build