KSeF2 CLI
KSeF2 CLI wraps the ksef2 Python SDK in a script-friendly command-line tool.
It is intended for local operations, CI jobs, and operational scripts that need
to authenticate with KSeF, query invoices, submit invoices, inspect sessions, or
manage administrative resources without writing Python code.
The CLI is intentionally stateless by default. Authenticated commands accept credentials through global options or environment variables. A local config file is available for developer workstations, but secrets should normally come from environment variables or a trusted secret manager in shared environments.
Start here
Section titled “Start here”- Install and run the CLI
- Run the quickstart
- Choose an authentication method
- Use local configuration
- Work with invoices and sessions
- Review the command reference
Command shape
Section titled “Command shape”The package exposes two equivalent executables:
ksef2ksef2-cliGlobal options come before the command group:
ksef2 --env test --nip 5261040828 --test-cert auth login --jsonThe command groups mirror the SDK domains:
authinvoicesonlinebatchtokenssessionscertificatespermissionslimitspeppolencryptiontestdataconfig