uictlapi
Curl-like CLI for the UniFi Controller / UniFi OS Web UI API — with login and CSRF handled for you.
Auth and CSRF come from
requests-unifi-auth. This package is
only the HTTP CLI: any Web UI / proxy URL, any method. It is not a typed UniFi SDK and
does not invent domain commands (routes apply, inventory, multi-controller orchestration).
Live auth/CSRF compatibility against real controllers is tracked in
requests-unifi-auth COMPATIBILITY.md.
Installation
pip
pip install uictlapi
Requires requests-unifi-auth>=0.1.5.
Docker
docker run --rm akinfold/uictlapi:latest --help
Usage
Auth (-a / --auth):
user:pass@hostuser:pass— host is taken from the request URL (password must not contain@)- two-line file —
usernameon line 1,passwordon line 2 (password may contain:and@); host from the request URL @/path/to/file— file contains any of the forms above (trailing newline is fine)
Keep credentials out of the shell history:
mkdir -p ~/.config/uictlapi
printf '%s\n' 'user' 'pass' > ~/.config/uictlapi/auth
chmod 600 ~/.config/uictlapi/auth
uictlapi get -a @$HOME/.config/uictlapi/auth --no-verify \
'https://192.168.1.1/proxy/network/v2/api/site/default/trafficroutes'
# Inline (host in the auth string)
uictlapi get -a 'user:pass@192.168.1.1' --no-verify \
'https://192.168.1.1/proxy/network/v2/api/site/default/trafficroutes'
# Same via Docker (mount the auth file)
docker run --rm -v "$HOME/.config/uictlapi/auth:/auth:ro" akinfold/uictlapi:latest \
get -a @/auth --no-verify \
'https://192.168.1.1/proxy/network/v2/api/site/default/trafficroutes'
# POST JSON body (from string or @file)
uictlapi post -a @$HOME/.config/uictlapi/auth --no-verify \
-j '{"enabled":true}' \
'https://192.168.1.1/proxy/network/v2/api/site/default/some-endpoint'
uictlapi --version
Common flags mirror curl-ish habits: -H / -p / -d / -j / -o / --show-headers /
--status-only / --no-verify / -t. Exit status 1 on HTTP ≥ 400, 2 on transport errors.
Releasing
Version lives in pyproject.toml and src/uictlapi/__init__.py. Bump on main first
(GitHub Actions → Bump version, or locally with bump-my-version), then:
git tag vX.Y.Z
git push origin vX.Y.Z
The Publish workflow runs tests, uploads to PyPI, pushes multi-arch Docker images
(X.Y.Z, X.Y, and latest when appropriate), and creates a GitHub Release.
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file uictlapi-0.1.2.tar.gz.
File metadata
- Download URL: uictlapi-0.1.2.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcf5fd3004df2b89bef79a5f810a0a186deb6a29c61271554fcb0712c7abc88d
|
|
| MD5 |
68543af998f813d5818bd1dda6333c4e
|
|
| BLAKE2b-256 |
81678e77a808e1e11d77d25e85d1a90ee04c942b0f31daee40288c5dd32b40ab
|
Provenance
The following attestation bundles were made for uictlapi-0.1.2.tar.gz:
Publisher:
publish.yml on akinfold/uictlapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
uictlapi-0.1.2.tar.gz -
Subject digest:
bcf5fd3004df2b89bef79a5f810a0a186deb6a29c61271554fcb0712c7abc88d - Sigstore transparency entry: 2568904599
- Sigstore integration time:
-
Permalink:
akinfold/uictlapi@904c0cf0fcbc03a657693aef9bdf4dac490e0519 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/akinfold
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@904c0cf0fcbc03a657693aef9bdf4dac490e0519 -
Trigger Event:
push
-
Statement type:
File details
Details for the file uictlapi-0.1.2-py3-none-any.whl.
File metadata
- Download URL: uictlapi-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7bfabba0f53b9f8988d8dcd7807f523647320776dbed379b9078586678e048f
|
|
| MD5 |
c26d526356ed46e0f1b17be23997edbd
|
|
| BLAKE2b-256 |
a2b13d3421759cacd0d578f36ec05cfa59293405d234c46238b882cb36faa1df
|
Provenance
The following attestation bundles were made for uictlapi-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on akinfold/uictlapi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
uictlapi-0.1.2-py3-none-any.whl -
Subject digest:
f7bfabba0f53b9f8988d8dcd7807f523647320776dbed379b9078586678e048f - Sigstore transparency entry: 2568904603
- Sigstore integration time:
-
Permalink:
akinfold/uictlapi@904c0cf0fcbc03a657693aef9bdf4dac490e0519 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/akinfold
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@904c0cf0fcbc03a657693aef9bdf4dac490e0519 -
Trigger Event:
push
-
Statement type: