Skip to main content

Imperative UniFi homelab actions the Integration API can't express

Project description

unifictl

Imperative UniFi homelab actions that the official Integration API can't express. Companion to unifi-mcp (reads): same gateway, same API key, but unifictl hits the private controller API to do things — starting with toggling switch-port link aggregation around PXE-booting cluster nodes.

Status: set lag implemented. The first feature works end-to-end against the private controller API (API-key auth). See SPEC.md for the design and decisions/ for the architecture decision records.

Install

uv tool install unifictl        # or: pipx install unifictl

Usage

unifictl set lag off            # dissolve the LAGs so nodes can PXE boot
unifictl set lag on             # restore the LACP bonds
unifictl set lag off --dry-run  # print the computed change, apply nothing

A real apply prints the diff, prompts for confirmation, and snapshots the switch's current port_overrides to a timestamped backup before writing.

Configuration

Connection and secrets come from the environment (never committed), matching unifi-mcp:

Variable Purpose
UNIFI_BASE_URL Gateway address, e.g. https://192.168.1.1
UNIFI_API_KEY Integration API key (also authenticates the private endpoints)
UNIFI_SITE Controller site (default default)
UNIFI_CA_CERT Optional path to the controller CA certificate (PEM)
UNIFI_INSECURE_TLS Last-resort TLS bypass
UNIFI_TIMEOUT_MS Per-request timeout (default 30000)

Operational parameters (switch MAC and LAG leader ports) live in an XDG TOML file at ~/.config/unifictl/config.toml; CLI flags override them.

Development

uv sync                 # create the venv and install deps
task dev:check          # lint, format-check, typecheck, import boundaries, tests
task dev:hooks-install  # install git hooks (prek)

See SPEC.md for the build reference and decisions/ for the architecture decision records.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unifictl-0.1.0.tar.gz (73.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unifictl-0.1.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file unifictl-0.1.0.tar.gz.

File metadata

  • Download URL: unifictl-0.1.0.tar.gz
  • Upload date:
  • Size: 73.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for unifictl-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6c38b7ddba665842b1f119ded15489ad095453b1b53ac20aa5d796c9cbc040ea
MD5 0ef4403bdbfef4420fdddb107628cc3e
BLAKE2b-256 98c6e7312bbff136cfed703cbdd05df4124dca736d69294b31854376c5b5e8dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for unifictl-0.1.0.tar.gz:

Publisher: release.yaml on yo61/unifictl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file unifictl-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: unifictl-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for unifictl-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0d217b3d0b97815312dc4755298337903aeebd6d80e4e8639ae6c65dacd4dd32
MD5 87d9fdd4b6cc85776581ec37c9561208
BLAKE2b-256 107cb2f4ac6042e44e0264c4f3fc28697124e8e07bd157d6adeac417ef12e592

See more details on using hashes here.

Provenance

The following attestation bundles were made for unifictl-0.1.0-py3-none-any.whl:

Publisher: release.yaml on yo61/unifictl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page