GitHub

KSeF2 CLI

Command-line interface for the ksef2 Python SDK.

On this page

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

Command shape

The package exposes two equivalent executables:

ksef2
ksef2-cli
bash

Global options come before the command group:

ksef2 --env test --nip 5261040828 --test-cert --json auth login
bash

The command groups mirror the SDK domains:

  • auth
  • invoices
  • online
  • batch
  • tokens
  • sessions
  • certificates
  • permissions
  • limits
  • peppol
  • encryption
  • testdata
  • config