{"id":19298190,"url":"https://github.com/casbin/casbin-go-cli","last_synced_at":"2025-04-22T09:32:10.606Z","repository":{"id":247932402,"uuid":"826894813","full_name":"casbin/casbin-go-cli","owner":"casbin","description":"Go CLI for Casbin","archived":false,"fork":false,"pushed_at":"2025-01-15T12:46:29.000Z","size":40,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-06T02:23:15.133Z","etag":null,"topics":["abac","acl","auth","authorization","authz","casbin","cli","go","golang","rbac"],"latest_commit_sha":null,"homepage":"https://casbin.org","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/casbin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"casbin"}},"created_at":"2024-07-10T15:38:24.000Z","updated_at":"2025-01-28T03:30:03.000Z","dependencies_parsed_at":"2025-01-28T00:39:17.637Z","dependency_job_id":null,"html_url":"https://github.com/casbin/casbin-go-cli","commit_stats":{"total_commits":6,"total_committers":2,"mean_commits":3.0,"dds":"0.16666666666666663","last_synced_commit":"a768d6529b6d7359a542a0fdb5cd5e09c49284fe"},"previous_names":["casbin/casbin-go-cli"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Fcasbin-go-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Fcasbin-go-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Fcasbin-go-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/casbin%2Fcasbin-go-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/casbin","download_url":"https://codeload.github.com/casbin/casbin-go-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248953449,"owners_count":21188638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["abac","acl","auth","authorization","authz","casbin","cli","go","golang","rbac"],"created_at":"2024-11-09T23:07:13.530Z","updated_at":"2025-04-22T09:32:10.599Z","avatar_url":"https://github.com/casbin.png","language":"Go","funding_links":["https://github.com/sponsors/casbin"],"categories":[],"sub_categories":[],"readme":"# casbin-go-cli\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/casbin/casbin-go-cli)](https://goreportcard.com/report/github.com/casbin/casbin-go-cli)\n[![Build](https://github.com/casbin/casbin-go-cli/actions/workflows/build.yml/badge.svg)](https://github.com/casbin/casbin-go-cli/actions/workflows/build.yml)\n[![Coverage Status](https://coveralls.io/repos/github/casbin/casbin-go-cli/badge.svg?branch=master)](https://coveralls.io/github/casbin/casbin-go-cli?branch=master)\n[![Godoc](https://godoc.org/github.com/casbin/casbin-go-cli?status.svg)](https://pkg.go.dev/github.com/casbin/casbin-go-cli)\n[![Release](https://img.shields.io/github/release/casbin/casbin-go-cli.svg)](https://github.com/casbin/casbin-go-cli/releases/latest)\n[![Discord](https://img.shields.io/discord/1022748306096537660?logo=discord\u0026label=discord\u0026color=5865F2)](https://discord.gg/S5UjpzGZjN)\n\ncasbin-go-cli is a command-line tool based on Casbin (Go language), enabling you to use all of Casbin APIs in the shell.\n\n## Installation\n\n1. Clone project from repository\n\n```shell\ngit clone https://github.com/casbin/casbin-go-cli.git\n```\n\n2. Build project\n\n```shell\ncd casbin-go-cli\ngo build -o casbin\n```\n\n## Options\n| options        | description                                  | must |                    \n|----------------|----------------------------------------------|------|\n| `-m, --model`  | The path of the model file or model text     | y    |\n| `-p, --policy` | The path of the policy file or policy text   | y    |  \n| `enforce`      | Check permissions                            | n    |\n| `enforceEx`    | Check permissions and get which policy it is | n    |\n\n## Get started\n\n- Check whether Alice has read permission on data1\n\n    ```shell\n    ./casbin enforce -m \"test/basic_model.conf\" -p \"test/basic_policy.csv\" \"alice\" \"data1\" \"read\"\n    ```\n    \u003e {\"allow\":true,\"explain\":[]}\n\n- Check whether Alice has write permission for data1 (with explanation)\n\n    ```shell\n    ./casbin enforceEx -m \"test/basic_model.conf\" -p \"test/basic_policy.csv\" \"alice\" \"data1\" \"write\"\n    ```\n    \u003e {\"allow\":false,\"explain\":[]}\n\n- Check whether Alice has read permission on data1 in domain1 (with explanation)\n\n    ```shell\n    ./casbin enforceEx -m \"test/rbac_with_domains_model.conf\" -p \"test/rbac_with_domains_policy.csv\" \"alice\" \"domain1\" \"data1\" \"read\"\n    ```\n    \u003e {\"allow\":true,\"explain\":[\"admin\",\"domain1\",\"data1\",\"read\"]}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasbin%2Fcasbin-go-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcasbin%2Fcasbin-go-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcasbin%2Fcasbin-go-cli/lists"}