返回顶部
b

baasAiPexBase BaaS服务

Use aipexbase-cli to operate AiPexBase BaaS service, supporting database operations, application management, user authentication, etc.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
129
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

baas

AiPexBase CLI 技能

关于 AiPexBase

AiPexBase 是一个 BaaS(后端即服务)平台,提供数据库、身份验证、文件存储和其他后端能力。

GitHub: https://github.com/kuafuai/aipexbase

前置条件

  • - 已部署的 AiPexBase 服务(用于获取 baseUrl)
  • API 密钥(从服务管理后台获取)
  • 已安装 aipexbase-cli:npm install -g aipexbase-cli

核心命令格式:
bash
baas -c <配置文件> <命令> [选项]

重要提示:所有命令必须使用 -c 参数指定配置文件!

配置文件

必须先创建配置文件(即使是空文件也可以):
bash
echo {} > config.json

  • - 可以通过 config 命令填充或更新配置。

命令参考

1. 配置管理

bash

设置配置


baas -c config.json config --base-url http://localhost:8080 --api-key your-api-key

查看配置

baas -c config.json config --show

2. 数据库操作

查询:
bash

查询全部


baas -c config.json db list <表名>

等值查询

baas -c config.json db list <表名> --where {status: active}

比较查询

baas -c config.json db list <表名> --where {price: {gt: 100}}

多条件查询

baas -c config.json db list <表名> --where {price: {gte: 100, lte: 1000}, status: active}

分页查询

baas -c config.json db page <表名> --page-num 1 --page-size 20

排序查询

baas -c config.json db list <表名> --order created_at:desc

单条记录

baas -c config.json db get <表名> --where {id: rec_xxx}

修改:
bash

插入


baas -c config.json db insert <表名> --data {field1: value1, field2: value2}

更新

baas -c config.json db update <表名> --where {id: rec_xxx} --data {field1: new-value}

删除

baas -c config.json db delete <表名> --where {id: rec_xxx}

where 操作符:

操作符描述示例
直接值等于{status: active}
gt
大于 | {price: {gt: 100}} |
| gte | 大于等于 | {age: {gte: 18}} |
| lt | 小于 | {stock: {lt: 10}} |
| lte | 小于等于 | {score: {lte: 60}} |
| neq | 不等于 | {status: {neq: deleted}} |
| like | 模糊匹配 | {name: {like: Zhang}} |
| in | 在数组中 | {status: {in: [active, pending]}} |
| between | 范围 | {price: {between: [100, 1000]}} |

3. 应用和表管理

bash

创建应用


baas -c config.json manage create-app --name 应用名称 --user-id 用户ID

创建表

baas -c config.json manage create-table \ --app-id 应用ID \ --table-name 表名称 \ --columns [ {columnName: name, columnType: string, columnComment: 名称}, {columnName: age, columnType: number, columnComment: 年龄} ]

字段类型:

类型描述类型描述
string短文本password密码(加密)
text
长文本 | phone | 电话(验证) |
| number | 整数 | email | 邮箱(验证) |
| decimal | 小数 | images | 图片 |
| boolean | 布尔值 | files | 文件 |
| date | 日期 | videos | 视频 |
| datetime | 日期时间 | quote | 引用 |

4. 用户认证

bash

登录


baas -c config.json login --phone 13800138000 --code 123456

登出

baas -c config.json logout

生成登录链接

baas -c config.json login-link --channel web --user-id user123

5. 文件上传

bash
baas -c config.json upload --file /path/to/file.jpg --table 表名称



参数规范

JSON 格式要求

规则:

  1. 1. 外层使用单引号 ...
  2. 内层使用双引号 ...
  3. JSON 必须有效

正确示例:
bash
✓ --data {name: 张三, age: 25}
✓ --where {status: active}

错误示例:
bash
✗ --data {name: 张三} # 外层不能使用双引号
✗ --data {name: 张三} # 内层不能使用单引号

columns 格式

json
[
{
columnName: 字段名称,
columnType: 字段类型,
columnComment: 字段描述
}
]



快速示例

bash

1. 创建配置文件


echo {} > config.json

2. 设置配置

baas -c config.json config --base-url http://localhost:8080 --api-key your-key

3. 创建应用

baas -c config.json manage create-app --name 我的应用 --user-id admin

4. 创建表

baas -c config.json manage create-table \ --app-id baas_xxx \ --table-name users \ --columns [{columnName: username, columnType: string, columnComment: 用户名}]

5. 插入数据

baas -c config.json db insert users --data {username: zhangsan}

6. 查询数据

baas -c config.json db list users --where {username: zhangsan}

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 aipexbase-cli-1776008295 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 aipexbase-cli-1776008295 技能

通过命令行安装

skillhub install aipexbase-cli-1776008295

下载

⬇ 下载 baas v1.0.0(免费)

文件大小: 2.54 KB | 发布时间: 2026-4-13 09:17

v1.0.0 最新 2026-4-13 09:17
aipexbase-cli 1.0.0

- Initial release providing CLI integration with AiPexBase BaaS service.
- Supports database CRUD operations, application and table management, user authentication, and file uploads.
- Includes detailed command reference and configuration guidance.
- Provides JSON parameter formatting rules and common usage examples.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部