@getlarge/keto-cli

中文文档
0.2.13发布于 2025/05/05MITTypeScriptESM + CJS近 30 天下载 2794

CLI wrapper for the Ory Keto API

原始使用文档
文档目录10 节
  1. Install
  2. Usage
  3. To check if a permission is granted
  4. To create a relationship
  5. To delete a relationship
  6. To expand a relation tuple
  7. To list all relationships
  8. Development
  9. Building
  10. Running unit tests

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.

版本与发布记录

@getlarge/keto-cli 共发布 16 个版本,首次发布于 2024/04/03;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.2.13latest2025/05/051.5 年前
0.2.122025/03/251.6 年前
0.2.102025/02/021.8 年前
0.2.92025/02/011.8 年前
0.2.82024/11/122 年前
0.2.72024/11/072 年前

关于 @getlarge/keto-cli 的常见问题

@getlarge/keto-cli 是什么?

CLI wrapper for the Ory Keto API

如何安装 @getlarge/keto-cli?

在项目目录运行 npm install @getlarge/keto-cli,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@nestjs/config(^3 || ^4)、@nestjs/common(^10 || ^11)、class-transformer(^0.5.1)、class-validator(^0.14.1)、@ory/client(^1)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。它还提供命令行工具 keto-cli,可以用 npx keto-cli 直接运行。

@getlarge/keto-cli 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@getlarge/keto-cli 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@getlarge/keto-cli 可以商用吗?

@getlarge/keto-cli 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@getlarge/keto-cli 的下载量有多少?

根据 npm 官方下载统计,@getlarge/keto-cli 在 2026/10/17 – 2026/11/15 这 30 天内被下载 2,794 次,日均约 93 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@getlarge/keto-cli 还在维护吗?

最新版本 0.2.13 发布于 2025/05/05(1.5 年前);至今共发布 16 个版本,其中过去 12 个月发布了 0 个;首次发布于 2024/04/03。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。