| name | codelynx-cli |
| description | Manage Codelynx business tools via CLI - auth, invoices, payslips, files, billing-entities, tools. Use when user mentions 'codelynx', 'invoice', 'payslip', 'billing entity', 'upload file', 'download PDF', or wants to interact with the Codelynx tools API from the terminal. |
| category | devtools |
codelynx-cli
When To Use This Skill
Use the codelynx-cli skill when you need to:
- inspect the live Codelynx tools catalog and available JSON schemas
- list, fetch, create, update, or delete invoices, payslips, files, or billing entities
- download invoice or payslip PDFs and optionally save them locally
- upload files to the Codelynx file store from a local path or raw base64
- run an arbitrary Codelynx tool endpoint with structured JSON input
Capabilities
- Auth and discovery: store the Codelynx token locally, verify auth against
/api/tools, and inspect available tool definitions.
- Invoice operations: list, get, create, update, delete, and download invoice PDFs.
- Payslip operations: list, get, create, update, delete, and download payslip PDFs.
- File operations: list files with search and cursor pagination, fetch metadata, upload files, and delete files.
- Billing entity operations: list, create, update, and delete reusable billing presets.
- Escape hatch:
tools run lets agents call any named tool directly with a JSON body.
Common Use Cases
- "List the latest invoices and give me the IDs."
- "Create a new invoice from this JSON file."
- "Download payslip 42 as a PDF and save it locally."
- "Upload this PDF to Codelynx and return the public URL."
- "List billing entities so I can reuse one for an invoice."
- "Run a tool endpoint directly and show me the raw JSON."
Setup
If codelynx-cli is missing, rebuild and relink it:
bun --version || curl -fsSL https://bun.sh/install | bash
npx api2cli bundle codelynx
npx api2cli link codelynx
Always use --json for agent-driven calls.
Authentication
codelynx-cli auth set "your-token"
codelynx-cli auth test --json
Auth commands: auth set <token>, auth show, auth remove, auth test
Token path: ~/.config/tokens/codelynx-cli.txt
Resources
auth
| Command | Description |
|---|
codelynx-cli auth set <token> | Save the active Codelynx API token locally. |
codelynx-cli auth show | Show the stored token in masked form. |
codelynx-cli auth remove | Delete the stored token. |
codelynx-cli auth test --json | Validate the token against the Codelynx tools API. |
invoices
| Command | Description |
|---|
codelynx-cli invoices list --limit 20 --json | List invoices. |
codelynx-cli invoices get --id <id> --json | Get an invoice by ID. |
codelynx-cli invoices get --number 123 --json | Get an invoice by invoice number. |
codelynx-cli invoices create --file ./invoice.json --json | Create an invoice from a JSON file. |
codelynx-cli invoices create --body '{"data":{...}}' --json | Create an invoice from inline JSON. |
codelynx-cli invoices update --file ./invoice-update.json --json | Update an invoice from a JSON file. |
codelynx-cli invoices delete --id <id> --json | Delete an invoice by ID. |
codelynx-cli invoices pdf --id <id> --json | Fetch an invoice PDF as base64 JSON. |
codelynx-cli invoices pdf --number 123 --output ./invoice-123.pdf --json | Download and save an invoice PDF locally. |
payslips
| Command | Description |
|---|
codelynx-cli payslips list --limit 20 --json | List payslips. |
codelynx-cli payslips get --id <id> --json | Get a payslip by ID. |
codelynx-cli payslips get --number 123 --json | Get a payslip by payslip number. |
codelynx-cli payslips create --file ./payslip.json --json | Create a payslip from a JSON file. |
codelynx-cli payslips create --body '{"data":{...}}' --json | Create a payslip from inline JSON. |
codelynx-cli payslips update --file ./payslip-update.json --json | Update a payslip from a JSON file. |
codelynx-cli payslips delete --id <id> --json | Delete a payslip by ID. |
codelynx-cli payslips pdf --id <id> --json | Fetch a payslip PDF as base64 JSON. |
codelynx-cli payslips pdf --number 123 --output ./payslip-123.pdf --json | Download and save a payslip PDF locally. |
files
| Command | Description |
|---|
codelynx-cli files list --limit 20 --json | List uploaded files. |
codelynx-cli files list --search "invoice" --json | Search uploaded files by filename. |
codelynx-cli files get --id <id> --json | Get file metadata by ID. |
codelynx-cli files get --key <key> --json | Get file metadata by storage key. |
codelynx-cli files upload --path ./document.pdf --content-type application/pdf --json | Upload a local file. |
codelynx-cli files upload --filename note.txt --base64 'SGVsbG8=' --content-type text/plain --json | Upload from raw base64. |
codelynx-cli files upload --body '{"filename":"x.pdf","base64":"..."}' --json | Upload using a full JSON body. |
codelynx-cli files delete --id <id> --json | Delete a file by ID. |
billing-entities
| Command | Description |
|---|
codelynx-cli billing-entities list --json | List saved billing entities. |
codelynx-cli billing-entities create --name "Client LLC" --address "Dubai" --json | Create a billing entity. |
codelynx-cli billing-entities update --id <id> --name "Client LLC" --json | Update a billing entity name or address. |
codelynx-cli billing-entities delete --id <id> --json | Delete a billing entity by ID. |
tools
| Command | Description |
|---|
codelynx-cli tools list --json | List the live tools catalog and JSON schemas. |
codelynx-cli tools run --name list_invoices --body '{"limit":10}' --json | Run any named tool directly with a JSON body. |
Output Format
--json returns a standardized envelope:
{ "ok": true, "data": { ... }, "meta": { "total": 42 } }
On error:
{ "ok": false, "error": { "code": 500, "message": "500: Internal server error" } }
Quick Reference
codelynx-cli --help
codelynx-cli <resource> --help
codelynx-cli <resource> <action> --help
Global Flags
All commands support: --json, --format <text|json|csv|yaml>, --verbose, --no-color, --no-header
Exit codes: 0 success, 1 API error, 2 usage error