ktr-cli 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kantree_cli/__init__.py +3 -0
- kantree_cli/cli.py +7922 -0
- kantree_cli/core/__init__.py +1 -0
- kantree_cli/core/client.py +230 -0
- kantree_cli/core/config.py +226 -0
- kantree_cli/core/context.py +141 -0
- kantree_cli/core/errors.py +32 -0
- kantree_cli/core/output.py +64 -0
- kantree_cli/core/response.py +86 -0
- kantree_cli/services/__init__.py +1 -0
- kantree_cli/services/cards.py +726 -0
- kantree_cli/services/importers.py +304 -0
- kantree_cli/services/kql.py +43 -0
- kantree_cli/services/resolver.py +236 -0
- kantree_cli/services/search.py +67 -0
- kantree_cli/services/views.py +124 -0
- kantree_cli/services/webhooks.py +120 -0
- kantree_cli/services/workspaces.py +1300 -0
- ktr_cli-0.1.0.dist-info/METADATA +173 -0
- ktr_cli-0.1.0.dist-info/RECORD +22 -0
- ktr_cli-0.1.0.dist-info/WHEEL +4 -0
- ktr_cli-0.1.0.dist-info/entry_points.txt +4 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ktr-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Unofficial command-line client for the Kantree API.
|
|
5
|
+
Author: Sebastien De Reviere
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Requires-Dist: click>=8.3,<9
|
|
8
|
+
Requires-Dist: requests>=2.33,<3
|
|
9
|
+
Requires-Python: >=3.11
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
|
|
12
|
+
# ktr-cli
|
|
13
|
+
|
|
14
|
+
Unofficial command-line client for the Kantree API.
|
|
15
|
+
|
|
16
|
+
This project is not affiliated with, endorsed by, or maintained by Kantree.
|
|
17
|
+
|
|
18
|
+
`ktr-cli` exposes:
|
|
19
|
+
|
|
20
|
+
* `kantree`: canonical command
|
|
21
|
+
* `ktr`: short alias
|
|
22
|
+
|
|
23
|
+
Commands are organized around Kantree workflows: auth, discovery (`org`, `team`,
|
|
24
|
+
`workspace`, `view`), cards, search, import/export, webhooks, automations, and
|
|
25
|
+
raw endpoint testing.
|
|
26
|
+
|
|
27
|
+
## Install and run
|
|
28
|
+
|
|
29
|
+
* Python `3.11+`
|
|
30
|
+
* `uv`
|
|
31
|
+
* A Kantree API key (`X-Api-Key`)
|
|
32
|
+
|
|
33
|
+
From PyPI:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
uv tool install ktr-cli
|
|
37
|
+
kantree --help
|
|
38
|
+
ktr --help
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
From the repository root:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
uv venv
|
|
45
|
+
uv sync --group dev
|
|
46
|
+
uv run kantree --help
|
|
47
|
+
uv run ktr --help
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
To run checks locally:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
uv run pytest
|
|
54
|
+
gate
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Real API smoke tests are opt-in only. See
|
|
58
|
+
`docs/guides/real-api-smoke-testing.md`.
|
|
59
|
+
|
|
60
|
+
## First auth setup
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
export KANTREE_API_KEY="..."
|
|
64
|
+
uv run kantree auth init
|
|
65
|
+
uv run kantree auth set \
|
|
66
|
+
--profile work \
|
|
67
|
+
--base-url https://kantree.io/api/1.0 \
|
|
68
|
+
--api-key-env KANTREE_API_KEY
|
|
69
|
+
uv run kantree auth use work
|
|
70
|
+
uv run kantree auth test
|
|
71
|
+
uv run kantree me
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`auth set` stores profile metadata only; the key value is never printed. Use
|
|
75
|
+
`uv run kantree auth` or `uv run kantree auth show` to inspect active profile
|
|
76
|
+
state and defaults.
|
|
77
|
+
|
|
78
|
+
Config path:
|
|
79
|
+
|
|
80
|
+
* `$XDG_CONFIG_HOME/kantree/config.toml` if `XDG_CONFIG_HOME` is set
|
|
81
|
+
* `~/.config/kantree/config.toml` otherwise
|
|
82
|
+
|
|
83
|
+
## Workspace-aware usage
|
|
84
|
+
|
|
85
|
+
Most commands need a workspace. Use one of:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
uv run kantree card list --workspace Ops
|
|
89
|
+
uv run kantree card list --workspace-id 42
|
|
90
|
+
uv run kantree --workspace Ops card list
|
|
91
|
+
KANTREE_WORKSPACE=Ops uv run kantree card list
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Resolution order:
|
|
95
|
+
|
|
96
|
+
1. Command-local `--workspace-id` / `--workspace`
|
|
97
|
+
2. Root `kantree --workspace-id` / `--workspace`
|
|
98
|
+
3. `KANTREE_WORKSPACE_ID` / `KANTREE_WORKSPACE`
|
|
99
|
+
4. Active profile `default_workspace`
|
|
100
|
+
|
|
101
|
+
If a command depends on a workspace, command-local wins.
|
|
102
|
+
|
|
103
|
+
Set defaults per profile:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
uv run kantree workspace use Ops
|
|
107
|
+
uv run kantree workspace current
|
|
108
|
+
uv run kantree workspace current --resolve-remote
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Delete commands are stricter and require explicit selectors.
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
uv run kantree workspace delete --workspace-id 42 --yes
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Output format
|
|
118
|
+
|
|
119
|
+
Default output is JSON. List-style commands support:
|
|
120
|
+
|
|
121
|
+
* `table`
|
|
122
|
+
* `tsv`
|
|
123
|
+
* `ids`
|
|
124
|
+
* `ndjson`
|
|
125
|
+
|
|
126
|
+
Use:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
uv run kantree --format table workspace list
|
|
130
|
+
uv run kantree --format tsv --fields id,title,state card list --workspace Ops
|
|
131
|
+
uv run kantree --format ids card list --workspace Ops
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
`--verbose` enables extra columns when supported.
|
|
135
|
+
|
|
136
|
+
## Common command groups
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
uv run kantree org list
|
|
140
|
+
uv run kantree workspace list --org DSI
|
|
141
|
+
uv run kantree team list --org DSI
|
|
142
|
+
uv run kantree card list --workspace Ops --filter '@me'
|
|
143
|
+
uv run kantree card create --workspace Ops --title "Fix LDAP sync"
|
|
144
|
+
uv run kantree card edit 123 --state completed
|
|
145
|
+
uv run kantree search cards --query '@me'
|
|
146
|
+
uv run kantree search preset list
|
|
147
|
+
uv run kantree view list
|
|
148
|
+
uv run kantree webhook list --workspace Ops
|
|
149
|
+
uv run kantree automation list --workspace Ops
|
|
150
|
+
uv run kantree import ./cards.csv
|
|
151
|
+
uv run kantree kql validate '@me and state!=completed'
|
|
152
|
+
uv run kantree api request GET /me
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Use `uv run kantree --help` and command-level `--help` for current flags and
|
|
156
|
+
subcommand details.
|
|
157
|
+
|
|
158
|
+
## Safety notes
|
|
159
|
+
|
|
160
|
+
* Keep API keys in env vars or a secret manager.
|
|
161
|
+
* `auth show` redacts key metadata only; avoid command-line secrets (`--body`)
|
|
162
|
+
in shared terminals and history.
|
|
163
|
+
* Destructive commands and some destructive batches require explicit `--yes`.
|
|
164
|
+
* `workspace delete` ignores default workspace fallbacks and requires explicit
|
|
165
|
+
selector.
|
|
166
|
+
* Prefer `card archive` when you need a reversible action.
|
|
167
|
+
* Use `--dry-run` where available before mutating commands.
|
|
168
|
+
|
|
169
|
+
## Where to continue
|
|
170
|
+
|
|
171
|
+
* `docs/README.md`
|
|
172
|
+
* `docs/style.md`
|
|
173
|
+
* `docs/guides/real-api-smoke-testing.md`
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
kantree_cli/__init__.py,sha256=Y2gVcE_sRBLoh8iXnMc3_NdR3U5nob1Ll9rlkuwd6qs,61
|
|
2
|
+
kantree_cli/cli.py,sha256=yNDG_ffIbNBsUsZv0oaoO6se0llQc_wrMslWth-ia8o,264345
|
|
3
|
+
kantree_cli/core/__init__.py,sha256=FQMMj4gKb26ET_cnZBJdhISJNMWucmQqHwNjZTwxhSM,40
|
|
4
|
+
kantree_cli/core/client.py,sha256=VNQ0o0AyH9yGOBmhPv0h7MEfuLl2szwUoQ6bmM_pfIQ,8265
|
|
5
|
+
kantree_cli/core/config.py,sha256=xbYl7JkZbcSBVgiHBpAOf4II1kHyZLJ9FgmA9WYsoxM,7575
|
|
6
|
+
kantree_cli/core/context.py,sha256=CLn43rM8gvt12i4z3Nuzo8_dYqjLWt9ma9TZhaqaCS0,4644
|
|
7
|
+
kantree_cli/core/errors.py,sha256=0humRvCkdlItUVKTeyN_9Ygoa6zKYRR7pAxjRmLM8IU,506
|
|
8
|
+
kantree_cli/core/output.py,sha256=I3Mmcb8kFiEcZaCmMjQk1xV6RNlvgSAsBy2mP3KWJ2w,2007
|
|
9
|
+
kantree_cli/core/response.py,sha256=n17MreS3PvTnDahO-L6_eRNN00uyZhZ3p9QnMWVqMpw,2513
|
|
10
|
+
kantree_cli/services/__init__.py,sha256=_mSHedwEQ_39oBTt2j1fCbvIMHPaMAk9Cgl_W4_hB5w,51
|
|
11
|
+
kantree_cli/services/cards.py,sha256=JfwlhW6g8vMDEGmfnIw91acgQps_EZZS_shnmgJyeq8,20753
|
|
12
|
+
kantree_cli/services/importers.py,sha256=eNnun33kfbhQ4YBWhU-t54PJXh9UjqAJOpnh6K7135Y,9930
|
|
13
|
+
kantree_cli/services/kql.py,sha256=9l2bHvFTo6GJKkWDRK-Sr4qB_IpGzn8huZhKLNHqf_k,1375
|
|
14
|
+
kantree_cli/services/resolver.py,sha256=j0-8XGUuWVdRcP3l8y2k8rC4aE8vyv2kaEDexB_4s0g,7670
|
|
15
|
+
kantree_cli/services/search.py,sha256=fLdvqvGwpzJoL2SwTP5IzN9zKptPX7NnwM18KfBwAjg,2460
|
|
16
|
+
kantree_cli/services/views.py,sha256=A1PUgfQicxBghzTpdi2qLEw4ttA5L52cay9V-qmFpvM,3940
|
|
17
|
+
kantree_cli/services/webhooks.py,sha256=Jw0N9oy1jUGfrUuvxFu_qcK-OMCT0wVghSzROmo8N5I,3567
|
|
18
|
+
kantree_cli/services/workspaces.py,sha256=jWAl9DU1ORepVI2KQrRzIil57ln0OmxdDMl8qH_9Wco,38441
|
|
19
|
+
ktr_cli-0.1.0.dist-info/WHEEL,sha256=fWriCkzqm-pffF5af4gJC9iI5FMFaJTuN9UxxxzOmdY,81
|
|
20
|
+
ktr_cli-0.1.0.dist-info/entry_points.txt,sha256=ihcIRGaP7TvQ1FaSgXsnCDBurimSg_aemXR9kbYpycM,77
|
|
21
|
+
ktr_cli-0.1.0.dist-info/METADATA,sha256=BAfw7iO0DthDp3lM0wcy0FUdowp3h3TFyQ9EJmGiNaA,4136
|
|
22
|
+
ktr_cli-0.1.0.dist-info/RECORD,,
|