--- name: "fakturownia-departments" description: "Fakturownia CLI departments: list, fetch, create, update, delete, and upload department logos, with README-backed request and output discovery." metadata: bundle: "fakturownia" category: "api-area" prerequisite: "fakturownia-shared" related_skills: - "fakturownia-shared" - "fakturownia-users" - "fakturownia-schema" - "fakturownia-doctor" command_refs: - "department list" - "department get" - "department create" - "department update" - "department delete" - "department set-logo" cli_help: "fakturownia department --help" requires_bins: - "fakturownia" discovery_hint: "Use `fakturownia schema department list --json` for output fields and `fakturownia schema department create --json` before building department payloads or uploading a logo." --- > Auto-generated by `go run ./cmd/gen-skills`. Do not edit manually. # Departments > **PREREQUISITE:** Read [`fakturownia-shared`](../shared/SKILL.md) first. ## Use This Skill When - The task is about reading or mutating departments or uploading department logos. - You need README-backed department fields such as `name`, `shortcut`, or `tax_no` before building payloads. ## Covered Commands - `fakturownia department list` — List departments - `fakturownia department get` — Fetch a single department by ID - `fakturownia department create` — Create a department - `fakturownia department update` — Update a department - `fakturownia department delete` — Delete a department - `fakturownia department set-logo` — Upload a department logo ## Notable Flags - `--page` (default `1`): Requested result page - `--per-page` (default `25`): Requested result count per page - `--id` (required): Department ID - `--input` (required): Department JSON input as inline JSON, @file, or - for stdin - `--yes` (required, default `false`): Confirm department deletion - `--file` (required): Logo file path or - for stdin - `--name`: Override the uploaded file name; required when --file - is used ## Environment - `FAKTUROWNIA_PROFILE`: Select a profile unless --profile is provided - `FAKTUROWNIA_URL`: Override the base account URL from any profile - `FAKTUROWNIA_API_TOKEN`: Override the API token from any profile ## Output and Request Discovery - Use `fakturownia schema department list --json` and `fakturownia schema department get --json` before building selectors. - Read `output.known_fields` to discover README-backed department fields such as `name`, `shortcut`, and `tax_no`. - Use `fakturownia schema department create --json` and `fakturownia schema department update --json` to inspect `request_body_schema` and accepted `--input` modes. - `--input` accepts inline JSON, `@file`, or `-` for stdin, and the CLI wraps the inner object into the upstream `department` envelope. - `department set-logo` uploads multipart content using `department[logo]`; when using `--file -`, pass `--name` as well. ## Examples ```bash fakturownia department list --json fakturownia department list --columns id,name,shortcut,tax_no fakturownia department list --page 2 --per-page 25 --raw fakturownia department get --id 10 fakturownia department get --id 10 --fields id,name,shortcut --json fakturownia department get --id 10 --raw fakturownia department create --input '{"name":"Sales","shortcut":"SALES","tax_no":"123-456-78-90"}' --json fakturownia department create --input @department.json fakturownia department create --input '{"name":"Sales"}' --dry-run --json fakturownia department update --id 10 --input '{"shortcut":"SALES"}' --json fakturownia department update --id 10 --input @department-update.json fakturownia department update --id 10 --input '{"name":"Sales"}' --dry-run --json fakturownia department delete --id 10 --yes --json fakturownia department delete --id 10 --yes --dry-run --json fakturownia department set-logo --id 10 --file ./logo.png --json cat ./logo.png | fakturownia department set-logo --id 10 --file - --name logo.png --dry-run --json ``` ## Related Skills - [fakturownia-shared](../shared/SKILL.md) - [fakturownia-users](../users/SKILL.md) - [fakturownia-schema](../schema/SKILL.md) - [fakturownia-doctor](../doctor/SKILL.md)