Skip to main content

Scripts and AI agents

kobana was designed to be called by programs: structured output, errors with codes, introspection and simulation.

In scripts and CI​

#!/usr/bin/env bash
set -euo pipefail

export KOBANA_BILLING_TOKEN="$BILLING_TOKEN"

kobana billing invoices list --params '{"status": "open"}' --page-all --fields "id,total" \
| jq -r '[.id, .total] | @tsv'
  • The result goes to stdout, everything else to stderr.
  • The exit code says what went wrong: 1 API error, 2 authentication, 3 validation, 4 schema, 5 internal.
  • Use KOBANA_<PRODUCT>_TOKEN instead of interactive login, and --env sandbox to test.
  • Fix --idempotency-key on calls that may be retried.
  • A .env in the current folder cannot define tokens or credentials: the CLI warns and ignores them. See Environment variables.

With AI agents​

An agent finds out what to do without reading long documentation:

  1. kobana schema --list — which resources exist.
  2. kobana schema billing.subscriptions.create — what the endpoint asks for.
  3. kobana billing subscriptions create --json '…' --dry-run — the request, with no effect.
  4. The same command without --dry-run.

Prefer --fields and --page-all to avoid filling the context, and treat every value from outside as untrusted: the CLI validates identifiers against ../, control characters and URL injection, but the decision to send is yours.

Skills​

The repository ships ready-made skills per product (kobana-billing, kobana-finance, kobana-kadu…) for agents that support them.

Documentation for machines​