ktr-cli 0.1.0__tar.gz

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.
ktr_cli-0.1.0/PKG-INFO ADDED
@@ -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,162 @@
1
+ # ktr-cli
2
+
3
+ Unofficial command-line client for the Kantree API.
4
+
5
+ This project is not affiliated with, endorsed by, or maintained by Kantree.
6
+
7
+ `ktr-cli` exposes:
8
+
9
+ * `kantree`: canonical command
10
+ * `ktr`: short alias
11
+
12
+ Commands are organized around Kantree workflows: auth, discovery (`org`, `team`,
13
+ `workspace`, `view`), cards, search, import/export, webhooks, automations, and
14
+ raw endpoint testing.
15
+
16
+ ## Install and run
17
+
18
+ * Python `3.11+`
19
+ * `uv`
20
+ * A Kantree API key (`X-Api-Key`)
21
+
22
+ From PyPI:
23
+
24
+ ```bash
25
+ uv tool install ktr-cli
26
+ kantree --help
27
+ ktr --help
28
+ ```
29
+
30
+ From the repository root:
31
+
32
+ ```bash
33
+ uv venv
34
+ uv sync --group dev
35
+ uv run kantree --help
36
+ uv run ktr --help
37
+ ```
38
+
39
+ To run checks locally:
40
+
41
+ ```bash
42
+ uv run pytest
43
+ gate
44
+ ```
45
+
46
+ Real API smoke tests are opt-in only. See
47
+ `docs/guides/real-api-smoke-testing.md`.
48
+
49
+ ## First auth setup
50
+
51
+ ```bash
52
+ export KANTREE_API_KEY="..."
53
+ uv run kantree auth init
54
+ uv run kantree auth set \
55
+ --profile work \
56
+ --base-url https://kantree.io/api/1.0 \
57
+ --api-key-env KANTREE_API_KEY
58
+ uv run kantree auth use work
59
+ uv run kantree auth test
60
+ uv run kantree me
61
+ ```
62
+
63
+ `auth set` stores profile metadata only; the key value is never printed. Use
64
+ `uv run kantree auth` or `uv run kantree auth show` to inspect active profile
65
+ state and defaults.
66
+
67
+ Config path:
68
+
69
+ * `$XDG_CONFIG_HOME/kantree/config.toml` if `XDG_CONFIG_HOME` is set
70
+ * `~/.config/kantree/config.toml` otherwise
71
+
72
+ ## Workspace-aware usage
73
+
74
+ Most commands need a workspace. Use one of:
75
+
76
+ ```bash
77
+ uv run kantree card list --workspace Ops
78
+ uv run kantree card list --workspace-id 42
79
+ uv run kantree --workspace Ops card list
80
+ KANTREE_WORKSPACE=Ops uv run kantree card list
81
+ ```
82
+
83
+ Resolution order:
84
+
85
+ 1. Command-local `--workspace-id` / `--workspace`
86
+ 2. Root `kantree --workspace-id` / `--workspace`
87
+ 3. `KANTREE_WORKSPACE_ID` / `KANTREE_WORKSPACE`
88
+ 4. Active profile `default_workspace`
89
+
90
+ If a command depends on a workspace, command-local wins.
91
+
92
+ Set defaults per profile:
93
+
94
+ ```bash
95
+ uv run kantree workspace use Ops
96
+ uv run kantree workspace current
97
+ uv run kantree workspace current --resolve-remote
98
+ ```
99
+
100
+ Delete commands are stricter and require explicit selectors.
101
+
102
+ ```bash
103
+ uv run kantree workspace delete --workspace-id 42 --yes
104
+ ```
105
+
106
+ ## Output format
107
+
108
+ Default output is JSON. List-style commands support:
109
+
110
+ * `table`
111
+ * `tsv`
112
+ * `ids`
113
+ * `ndjson`
114
+
115
+ Use:
116
+
117
+ ```bash
118
+ uv run kantree --format table workspace list
119
+ uv run kantree --format tsv --fields id,title,state card list --workspace Ops
120
+ uv run kantree --format ids card list --workspace Ops
121
+ ```
122
+
123
+ `--verbose` enables extra columns when supported.
124
+
125
+ ## Common command groups
126
+
127
+ ```bash
128
+ uv run kantree org list
129
+ uv run kantree workspace list --org DSI
130
+ uv run kantree team list --org DSI
131
+ uv run kantree card list --workspace Ops --filter '@me'
132
+ uv run kantree card create --workspace Ops --title "Fix LDAP sync"
133
+ uv run kantree card edit 123 --state completed
134
+ uv run kantree search cards --query '@me'
135
+ uv run kantree search preset list
136
+ uv run kantree view list
137
+ uv run kantree webhook list --workspace Ops
138
+ uv run kantree automation list --workspace Ops
139
+ uv run kantree import ./cards.csv
140
+ uv run kantree kql validate '@me and state!=completed'
141
+ uv run kantree api request GET /me
142
+ ```
143
+
144
+ Use `uv run kantree --help` and command-level `--help` for current flags and
145
+ subcommand details.
146
+
147
+ ## Safety notes
148
+
149
+ * Keep API keys in env vars or a secret manager.
150
+ * `auth show` redacts key metadata only; avoid command-line secrets (`--body`)
151
+ in shared terminals and history.
152
+ * Destructive commands and some destructive batches require explicit `--yes`.
153
+ * `workspace delete` ignores default workspace fallbacks and requires explicit
154
+ selector.
155
+ * Prefer `card archive` when you need a reversible action.
156
+ * Use `--dry-run` where available before mutating commands.
157
+
158
+ ## Where to continue
159
+
160
+ * `docs/README.md`
161
+ * `docs/style.md`
162
+ * `docs/guides/real-api-smoke-testing.md`
@@ -0,0 +1,3 @@
1
+ """Unofficial Kantree CLI package."""
2
+
3
+ __version__ = "0.1.0"