baixing-agent-cli

Installs baixing-agent-cli from the npm registry only (command `baixing`), then runs Baixing HTTP APIs—init UUID, post, posts, search, detail—and parses stdout/stderr and exit codes per the CLI contract. Does not assume a private source checkout. Use when integrating agents or scripts with baixing-agent-cli, BX_CONFIG_PATH, or Baixing neo/search/fabu APIs from the terminal.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "baixing-agent-cli" with this command: npx skills add tujinsama/baixing-agent-cli

baixing-agent-cli 使用说明(Agent)

百姓网 HTTP API 的薄 CLI,入口命令为 baixing(npm 包名 baixing-agent-cli)。若环境中还有 PHP 站内 CLI(如 cli.php),与本 npm 包无关——本包只调对外 HTTP 接口。

前置条件

  • Node.js 18+fetchcrypto.randomUUID

安装

唯一对外安装方式:从 npm 安装(勿假定存在私有源码仓库)。

全局安装后命令名为 baixing

npm install -g baixing-agent-cli
baixing --help

不需要全局安装时可用 npx(同样调用 baixing):

npx baixing-agent-cli --help

Agent 必须遵守的契约

调用形式

baixing [全局选项] <子命令> [子命令选项] [子命令参数]
  • 全局选项:-v / --verbose(调试信息打到 stderr,不改变 stdout JSON)。
  • API 根 URL:内置默认 https://www.baixing.com。一般用法不要要求用户设置环境变量;仅在对接镜像/预发等场景才需要 BX_API_BASE_URLinit --base-url。优先级:环境变量 BX_API_BASE_URL > 配置文件 baseUrl > 默认

stdout / stderr

用途
stdout成功时的主结果:init 成功时为一行 uuid;其余成功子命令多为 格式化 JSONJSON.stringify(..., null, 2)),可对整段 stdout JSON.parsepost --dry-run 亦为 JSON(含 _baseUrl)。
stderr人类可读提示与错误;-v 时含 HTTP 方法与大致 URL。不要把 stderr 当 API 响应解析。

建议:成功路径只解析 stdout;失败时读 stderr 文本。

退出码

含义
0成功(含「已有 uuid 未 force 仍打印已有 uuid」)。
1失败:参数、网络、非 2xx、JSON 解析失败,或业务 JSON 中 code !== 0

必须用退出码判断成败,不能仅凭 stdout 是否非空。

稳定性与容错

  • 优先使用长选项(如 --dry-run--base-url)作为稳定契约。
  • 响应 JSON 结构由服务端决定;解析时应容错未知字段。

推荐自动化流程

  1. baixing init(覆盖旧 uuid:baixing init --force);从 stdout 取 uuid 或依赖写入后的配置。
  2. baixing post -t "<标题>" -c "<正文>";对接前可用 baixing post ... --dry-run
  3. baixing postsbaixing posts --uuid <id>
  4. baixing search <关键词...>(多词空格分隔;整句含空格时对参数加引号)。
  5. search / postsdata.items[].adId 取 ID,执行 baixing detail <adId>

多进程/多租户:为不同进程设置不同 BX_CONFIG_PATH,避免互相覆盖 uuid 配置。

子命令速查

子命令作用要点
init生成 UUID v4 写入配置--base-url 可选(默认即生产根 URL);--force;已有 uuid 且无 -f 时 stderr 提示、stdout 仍为 uuid、退出 0
postPOST /neo/fabu/neoPost-t-c 必填--uuid--dry-run
postsGET /neo/queryByUuid--uuid-p/--page-s/--size(页码从 1)
searchGET /neo/search关键词为参数;无关键词则退出 1
detailGET /neo/detail/<adId>adId 为非空数字串,来自列表里的 adId

环境变量

变量说明
BX_API_BASE_URL可选。未设置时使用默认 https://www.baixing.com。只有需要指向非生产根地址时才设置;设置后覆盖配置文件里的 baseUrl。Agent 默认流程中不应向用户索要此项。
BX_CONFIG_PATH可选(多实例/CI 时用)。配置文件绝对路径;未设置时默认 ~/.config/baixing-agent/config.json(Windows 路径见 npm 包 README)。

完整文档

选项表、边界行为与发布说明见 reference.md

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

Dependency Breaking Technique Executor

Select and execute the right dependency-breaking technique from Michael Feathers' catalog of 24 named techniques (Part III of Working Effectively with Legacy...

Registry SourceRecently Updated
Coding

Clipcat - AI Viral Video Maker for TikTok Shop

Clipcat - TikTok e-commerce video creation skill. Video search, product insights, viral replication, product-to-video generation, breakdown analysis, and vid...

Registry SourceRecently Updated
Coding

azure-infra-engineer

> Azure cloud infrastructure expert specializing in network design, identity integration, PowerShell automation with Az modules, and infrastructure-as-code p...

Registry SourceRecently Updated
Coding

Legacy Code Symptom Router

Diagnose any legacy-code situation in plain language and route to the right technique. Use as the FIRST skill when a developer has a vague or specific compla...

Registry SourceRecently Updated