"Sevdesk: invoices/quotes/contacts via a read-first CLI (guarded writes) + context snapshots for agent handoffs."
Resources
2Install
npx skillscat add codecell-germany/sevdesk-agent-skill/sevdesk-agent-cli Install via the SkillsCat registry.
SKILL.md
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.
Preconditions
- CLI is runnable, either:
- from a checkout of this repo:
npm install && npm run build(then runsevdesk-agent ...), or - 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:
- if
sevdesk-agent ...fails withpermission denied, run the same command via:node dist/index.js <command> ...
- API token is available in env:
SEVDESK_API_TOKEN=<token>
- Optional env:
SEVDESK_BASE_URL(defaulthttps://my.sevdesk.de/api/v1)SEVDESK_USER_AGENTSEVDESK_ALLOW_WRITE=true(required for write execution)
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- local contact search helper:
sevdesk-agent find-contact <term> --output json - by default, read responses are normalized for known live API quirks
- Shell quoting: params like
contact[id]should be quoted:--query 'contact[id]=123' - Invoice date filters (observed): in our tests,
getInvoicesworks withstartDate/endDateas Unix timestamps (seconds). ISO dates like2026-01-01may return empty results.
Example:sevdesk-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 ...- for
createContact/createOrder, local preflight validation runs by default - add
--verifyto run read-only post-write checks
- 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):
Standard runbook: Kontakt + Angebot + PDF
- Discovery:
sevdesk-agent ops list --read-onlysevdesk-agent op-show createContactsevdesk-agent op-show createOrder
- Kontakt finden/erstellen:
sevdesk-agent find-contact "<name or customerNumber>" --output jsonsevdesk-agent write createContact ... --execute --confirm-execute yes --allow-write --verify
- Angebot erstellen:
sevdesk-agent write createOrder ... --execute --confirm-execute yes --allow-write --verify
- PDF export ohne Status-Nebeneffekt:
sevdesk-agent read orderGetPdf --path orderId=<id> --decode-pdf output/<file>.pdfpreventSendBy=1wird standardmäßig gesetzt (--no-safe-pdfdeaktiviert das)
- Handoff:
sevdesk-agent context snapshot --include-default
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
*GetPdfendpoints, responses are typically JSON wrapped indata.objects(often containingfilename,mimetype, and base64content). The CLI does not automatically write files to disk. - for
orderGetPdf/invoiceGetPdf, CLI now appliespreventSendBy=1by default (safe PDF mode). - use
--decode-pdf <path>for direct PDF file output withoutjq/base64. - If the server returns a non-JSON binary content-type (pdf/xml/zip/csv), the CLI prints metadata (
binary,bytes,contentType) instead of raw bytes. - Runtime-required query quirks are enforced for selected operations (e.g.
contactCustomerNumberAvailabilityCheckrequirescustomerNumberat runtime). - Use
op-showorops-quirksto see operation-specific runtime quirks. ops-quirks --jsonreturns an object mapping, not an array. Parse withjq 'to_entries[]'.
References
- Command cheat sheet:
references/command-cheatsheet.md - Offer/order write notes (live behavior):
knowledge/SEVDESK_ORDER_WRITE_LEARNINGS.md