sevdesk-agent-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesesevdesk-agent-cli
sevdesk-agent-cli
When to use
适用场景
Use this skill when tasks involve sevdesk API access from this workspace, especially when an agent must:
- inspect business/accounting state via read-only endpoints,
- execute write endpoints with explicit guard confirmations,
- produce a context snapshot for later agent runs.
当工作流中需要从当前工作区访问Sevdesk API时,可使用此Skill,尤其是在Agent需要执行以下操作的场景:
- 通过只读端点查看业务/财务状态,
- 在明确确认保护机制后执行写入端点操作,
- 生成上下文快照供后续Agent运行使用。
Preconditions
前置条件
- CLI is runnable, either:
- from a checkout of this repo: (then run
npm install && npm run build), orsevdesk-agent ... - via npx (no local build, run from outside this repo folder):
npx -y -p @codecell-germany/sevdesk-agent-skill sevdesk-agent --help
- from a checkout of this repo:
- API token is available in env:
SEVDESK_API_TOKEN=<token>
- Optional env:
- (default
SEVDESK_BASE_URL)https://my.sevdesk.de/api/v1 SEVDESK_USER_AGENT- (required for write execution)
SEVDESK_ALLOW_WRITE=true
- CLI可正常运行,两种方式可选:
- 从本仓库检出后运行:(之后执行
npm install && npm run build),或sevdesk-agent ... - 通过npx运行(无需本地构建,在本仓库目录外执行):
npx -y -p @codecell-germany/sevdesk-agent-skill sevdesk-agent --help
- 从本仓库检出后运行:
- 环境变量中需配置API令牌:
SEVDESK_API_TOKEN=<token>
- 可选环境变量:
- (默认值为
SEVDESK_BASE_URL)https://my.sevdesk.de/api/v1 SEVDESK_USER_AGENT- (执行写入操作时必填)
SEVDESK_ALLOW_WRITE=true
Core workflow
核心工作流
- Discover operation ids:
sevdesk-agent ops list --read-onlysevdesk-agent op-show <operationId>sevdesk-agent ops-quirks
- Run read calls first:
sevdesk-agent read <operationId> --query key=value- by default, read responses are normalized for known live API quirks
- Shell quoting: params like should be quoted:
contact[id]--query 'contact[id]=123' - Invoice date filters (observed): in our tests, works with
getInvoices/startDateas Unix timestamps (seconds). ISO dates likeendDatemay return empty results. Example:2026-01-01sevdesk-agent read getInvoices --query startDate=1767225600 --query endDate=1769903999 --output json - Generate a full read-op reference doc:
sevdesk-agent docs read-ops --output knowledge/READ_OPERATIONS.md
- For write calls, only with explicit confirmation:
sevdesk-agent write <operationId> --execute --confirm-execute yes --allow-write ...
- Persist agent handoff context:
- stdout (default):
sevdesk-agent context snapshot - optional file export:
sevdesk-agent context snapshot --output .context/sevdesk-context-snapshot.json
- stdout (default):
- 查看操作ID:
sevdesk-agent ops list --read-onlysevdesk-agent op-show <operationId>sevdesk-agent ops-quirks
- 优先执行只读调用:
sevdesk-agent read <operationId> --query key=value- 默认情况下,只读响应会针对已知的实时API特性进行标准化处理
- Shell引号规则:类似的参数需要加引号:
contact[id]--query 'contact[id]=123' - 发票日期过滤(实测情况):在我们的测试中,接口支持以Unix时间戳(秒)作为
getInvoices/startDate参数。使用ISO格式日期如endDate可能会返回空结果。 示例:2026-01-01sevdesk-agent read getInvoices --query startDate=1767225600 --query endDate=1769903999 --output json - 生成完整的只读操作参考文档:
sevdesk-agent docs read-ops --output knowledge/READ_OPERATIONS.md
- 写入调用(需明确确认):
sevdesk-agent write <operationId> --execute --confirm-execute yes --allow-write ...
- 持久化Agent交接上下文:
- 默认输出到标准输出:
sevdesk-agent context snapshot - 可选导出到文件:
sevdesk-agent context snapshot --output .context/sevdesk-context-snapshot.json
- 默认输出到标准输出:
Guardrails
防护机制
- Default behavior is safe: non-GET calls are blocked unless all write guards are set.
- In production workflows, prefer read-only tests and read-only probes first.
- For endpoints, responses are typically JSON wrapped in
*GetPdf(often containingdata.objects,filename, and base64mimetype). The CLI does not automatically write files to disk.content - If the server returns a non-JSON binary content-type (pdf/xml/zip/csv), the CLI prints metadata (,
binary,bytes) instead of raw bytes.contentType - Runtime-required query quirks are enforced for selected operations (e.g. requires
contactCustomerNumberAvailabilityCheckat runtime).customerNumber - Use or
op-showto see operation-specific runtime quirks.ops-quirks
- 默认行为为安全模式:非GET调用会被拦截,除非所有写入保护机制都已配置。
- 在生产工作流中,建议优先执行只读测试和只读探测。
- 对于端点,响应通常是包裹在
*GetPdf中的JSON(通常包含data.objects、filename和base64格式的mimetype)。CLI不会自动将文件写入磁盘。content - 如果服务器返回非JSON的二进制内容类型(如pdf/xml/zip/csv),CLI会打印元数据(、
binary、bytes)而非原始字节。contentType - 部分操作会强制要求运行时查询特性(例如在运行时需要
contactCustomerNumberAvailabilityCheck参数)。customerNumber - 可使用或
op-show查看特定操作的运行时特性。ops-quirks
References
参考资料
- Command cheat sheet:
references/command-cheatsheet.md
- 命令速查表:
references/command-cheatsheet.md