Skill Wiki v0.1.0

文档 / reference / cli

本页目录

CLI 参考

prime 这个二进制覆盖编写、编译和分发三件事。源码在 packages/cli/src/index.ts

命令

命令参数用途
init交互式新建一份 .prime 文件。
compile<file> [--deep].prime 编译成原子目录加 index。
check<file> | --registry只校验,不写产物。
test<file>跑评估准则测试。
graph<file> [--format ascii\|svg]把关系图画出来。
decompose<SKILL.md>AI 辅助:把 Skill 拆成原子。
compose--name <name>把原子拼成一份新的 SKILL.md。
list[--scope @s] [--dir]列出本地 registry 里的原子。
show<@scope/name>打印原子详情和边。
deps<@scope/name>遍历依赖树。
install[name] [--remote]从 registry 装 Prime。
publish[--remote] [--token]发布当前 Prime。
search<query> [--remote]搜索 registry。
info<name>看某个 Prime 的详情。
ls[--dir]列出已装的 Prime。

全局选项

  • --version-v —— 打印版本号
  • --help-h —— 打印用法
  • --dir <path> —— 覆盖默认的 sources / compiled 目录
  • --remote <url> —— registry 地址(publish / install / search / info 用)
  • --json —— 机器可读输出(在适用的命令上)

退出码

含义
0成功。
1一般错误(解析、IO、网络)。
2校验错误(L1 / L3 抛出的诊断)。
3命令用法错(缺必填参数、命令名不认识)。

环境变量

  • PRIME_DIR —— 运行时和 MCP server 默认读的编译产物目录。
  • DEEPSEEK_API_KEY —— 启用 L2 LLM 检查。
  • ANTHROPIC_API_KEY —— 备选的 L2 后端。
  • PRIME_REGISTRY —— 没传 --remote 时的默认值。

Help 输出

$ prime --help

prime v0.1.0 — A protocol layer for AI knowledge.

Usage: prime <command> [options]

Core:
  init                    Create a new .prime file
  compile <file>          Compile .prime → atom dir + index
  check <file>            Validate without emitting
  test <file>             Run evaluation criteria tests
  graph <file>            Visualise relationship graph

Authoring:
  decompose <SKILL.md>    AI-assisted Skill → Primes decomposition
  compose --name <name>   Compose Primes into a new Skill

Registry (local):
  list [--scope @s]       List atoms
  show <@scope/name>      Print atom details + edges
  deps <@scope/name>      Walk dependency tree
  install <@scope/name>   Resolve atom + verify deps locally

Distribution:
  install [name]          Install Skill(s) from prime.dev
  publish                 Publish to prime.dev
  search <query>          Search the registry
  info <name>             View Skill details
  ls                      List installed Skills (.primes/)