Unofficial command-line client for the Kantree API.
Project description
ktr-cli
Unofficial command-line client for the Kantree API.
This project is not affiliated with, endorsed by, or maintained by Kantree.
ktr-cli exposes:
kantree: canonical commandktr: short alias
Commands are organized around Kantree workflows: auth, discovery (org, team,
workspace, view), cards, search, import/export, webhooks, automations, and
raw endpoint testing.
Install and run
- Python
3.11+ uv- A Kantree API key (
X-Api-Key)
From PyPI:
uv tool install ktr-cli
kantree --help
ktr --help
From the repository root:
uv venv
uv sync --group dev
uv run kantree --help
uv run ktr --help
To run checks locally:
uv run pytest
gate
Real API smoke tests are opt-in only. See
docs/guides/real-api-smoke-testing.md.
First auth setup
export KANTREE_API_KEY="..."
uv run kantree auth init
uv run kantree auth set \
--profile work \
--base-url https://kantree.io/api/1.0 \
--api-key-env KANTREE_API_KEY
uv run kantree auth use work
uv run kantree auth test
uv run kantree me
auth set stores profile metadata only; the key value is never printed. Use
uv run kantree auth or uv run kantree auth show to inspect active profile
state and defaults.
Config path:
$XDG_CONFIG_HOME/kantree/config.tomlifXDG_CONFIG_HOMEis set~/.config/kantree/config.tomlotherwise
Workspace-aware usage
Most commands need a workspace. Use one of:
uv run kantree card list --workspace Ops
uv run kantree card list --workspace-id 42
uv run kantree --workspace Ops card list
KANTREE_WORKSPACE=Ops uv run kantree card list
Resolution order:
- Command-local
--workspace-id/--workspace - Root
kantree --workspace-id/--workspace KANTREE_WORKSPACE_ID/KANTREE_WORKSPACE- Active profile
default_workspace
If a command depends on a workspace, command-local wins.
Set defaults per profile:
uv run kantree workspace use Ops
uv run kantree workspace current
uv run kantree workspace current --resolve-remote
Delete commands are stricter and require explicit selectors.
uv run kantree workspace delete --workspace-id 42 --yes
Output format
Default output is JSON. List-style commands support:
tabletsvidsndjson
Use:
uv run kantree --format table workspace list
uv run kantree --format tsv --fields id,title,state card list --workspace Ops
uv run kantree --format ids card list --workspace Ops
--verbose enables extra columns when supported.
Common command groups
uv run kantree org list
uv run kantree workspace list --org DSI
uv run kantree team list --org DSI
uv run kantree card list --workspace Ops --filter '@me'
uv run kantree card create --workspace Ops --title "Fix LDAP sync"
uv run kantree card edit 123 --state completed
uv run kantree search cards --query '@me'
uv run kantree search preset list
uv run kantree view list
uv run kantree webhook list --workspace Ops
uv run kantree automation list --workspace Ops
uv run kantree import ./cards.csv
uv run kantree kql validate '@me and state!=completed'
uv run kantree api request GET /me
Use uv run kantree --help and command-level --help for current flags and
subcommand details.
Safety notes
- Keep API keys in env vars or a secret manager.
auth showredacts key metadata only; avoid command-line secrets (--body) in shared terminals and history.- Destructive commands and some destructive batches require explicit
--yes. workspace deleteignores default workspace fallbacks and requires explicit selector.- Prefer
card archivewhen you need a reversible action. - Use
--dry-runwhere available before mutating commands.
Where to continue
docs/README.mddocs/style.mddocs/guides/real-api-smoke-testing.md
Project details
Release history Release notifications | RSS feed
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 ktr_cli-0.1.0.tar.gz.
File metadata
- Download URL: ktr_cli-0.1.0.tar.gz
- Upload date:
- Size: 57.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb476922671b9054c870ac1515cf6bf1b6f3cbe6a2fc7ada5f56a72961e65f3e
|
|
| MD5 |
1f957fd5ba0f671e7af0a6de25b9514d
|
|
| BLAKE2b-256 |
5054c1e54ab5456de271866499d94082429355b7f7e546dda8128593ded17f83
|
File details
Details for the file ktr_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ktr_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 64.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcfe9a87c5a704125de93676f5441dd873518f05bfd4a39c6948564b9cfd75c5
|
|
| MD5 |
1121f0e2997b0054c5869f6f0ce9353a
|
|
| BLAKE2b-256 |
5fdcafd625b6a85c70ee1486d92fbc23855300015e61a7c44e6b245e31de8894
|