@getlarge/keto-cli
TypeScript icon, indicating that this package has built-in type declarations

0.2.8 • Public • Published

keto-cli

npm

This CLI interacts with the Ory Keto API.

Install

npm install @getlarge/keto-cli

Usage

To check if a permission is granted

# base path is the Ory Keto Public API URL - it can be passed via ORY_KETO_PUBLIC_URL environment variable
npx @getlarge/keto-cli check --tuple Group:admin#members@User:1 \
--basePath http://localhost:4466

To create a relationship

# base path is the Ory Keto Admin API URL - it can be passed via ORY_KETO_PUBLIC_URL environment variable
# access token is the Ory Keto Admin API access token - it should be passed via ORY_KETO_API_KEY environment variable
npx @getlarge/keto-cli create --tuple Group:admin#members@User:1 \
--basePath http://localhost:4467 --accessToken my-access-token

To delete a relationship

# base path is the Ory Keto Admin API URL - it can be passed via ORY_KETO_PUBLIC_URL environment variable
# access token is the Ory Keto Admin API access token - it should be passed via ORY_KETO_API_KEY environment variable
npx @getlarge/keto-cli delete --tuple Group:admin#members@User:1 \
--basePath http://localhost:4467 --accessToken my-access-token

To expand a relation tuple

npx @getlarge/keto-cli expand --tuple Group:admin#members --depth 2 \
--basePath http://localhost:4466

To list all relationships

# base path is the Ory Keto Admin API URL - it can be passed via ORY_KETO_PUBLIC_URL environment variable
# access token is the Ory Keto Admin API access token - it should be passed via ORY_KETO_API_KEY environment variable
npx @getlarge/keto-cli get --namespace Group --object admin \
--basePath http://localhost:4467 --accessToken my-access-token

Development

Building

Run nx build keto-cli to build the library.

Running unit tests

Run nx test keto-cli to execute the unit tests via Jest.

Dependencies (4)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @getlarge/keto-cli

    Weekly Downloads

    21

    Version

    0.2.8

    License

    MIT

    Unpacked Size

    55.5 kB

    Total Files

    27

    Last publish

    Collaborators

    • getlarge