huly-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.
Files changed (42) hide show
  1. huly_cli-0.1.0/.env.example +8 -0
  2. huly_cli-0.1.0/.github/workflows/ci.yml +42 -0
  3. huly_cli-0.1.0/.github/workflows/publish-pypi.yml +61 -0
  4. huly_cli-0.1.0/.gitignore +15 -0
  5. huly_cli-0.1.0/.pre-commit-config.yaml +7 -0
  6. huly_cli-0.1.0/LICENSE +21 -0
  7. huly_cli-0.1.0/PKG-INFO +345 -0
  8. huly_cli-0.1.0/README.md +289 -0
  9. huly_cli-0.1.0/RELEASE.md +96 -0
  10. huly_cli-0.1.0/pyproject.toml +79 -0
  11. huly_cli-0.1.0/scripts/live_smoke.py +305 -0
  12. huly_cli-0.1.0/src/huly_cli/__init__.py +1 -0
  13. huly_cli-0.1.0/src/huly_cli/auth.py +174 -0
  14. huly_cli-0.1.0/src/huly_cli/client.py +319 -0
  15. huly_cli-0.1.0/src/huly_cli/commands/__init__.py +0 -0
  16. huly_cli-0.1.0/src/huly_cli/commands/auth_cmd.py +94 -0
  17. huly_cli-0.1.0/src/huly_cli/commands/components.py +369 -0
  18. huly_cli-0.1.0/src/huly_cli/commands/documents.py +486 -0
  19. huly_cli-0.1.0/src/huly_cli/commands/issues.py +740 -0
  20. huly_cli-0.1.0/src/huly_cli/commands/labels.py +65 -0
  21. huly_cli-0.1.0/src/huly_cli/commands/members.py +68 -0
  22. huly_cli-0.1.0/src/huly_cli/commands/milestones.py +379 -0
  23. huly_cli-0.1.0/src/huly_cli/commands/projects.py +115 -0
  24. huly_cli-0.1.0/src/huly_cli/commands/templates.py +342 -0
  25. huly_cli-0.1.0/src/huly_cli/config.py +124 -0
  26. huly_cli-0.1.0/src/huly_cli/errors.py +70 -0
  27. huly_cli-0.1.0/src/huly_cli/issue_utils.py +215 -0
  28. huly_cli-0.1.0/src/huly_cli/main.py +75 -0
  29. huly_cli-0.1.0/src/huly_cli/markup.py +407 -0
  30. huly_cli-0.1.0/src/huly_cli/models.py +244 -0
  31. huly_cli-0.1.0/src/huly_cli/output.py +85 -0
  32. huly_cli-0.1.0/tests/__init__.py +0 -0
  33. huly_cli-0.1.0/tests/conftest.py +27 -0
  34. huly_cli-0.1.0/tests/test_client.py +212 -0
  35. huly_cli-0.1.0/tests/test_commands.py +432 -0
  36. huly_cli-0.1.0/tests/test_commands_new.py +271 -0
  37. huly_cli-0.1.0/tests/test_issue_write_path.py +463 -0
  38. huly_cli-0.1.0/tests/test_markup.py +387 -0
  39. huly_cli-0.1.0/tests/test_models.py +213 -0
  40. huly_cli-0.1.0/tests/test_output.py +155 -0
  41. huly_cli-0.1.0/tests/test_read_path_compat.py +226 -0
  42. huly_cli-0.1.0/uv.lock +1087 -0
@@ -0,0 +1,8 @@
1
+ # Minimal required config
2
+ HULY_URL=https://huly.ingenuity.ph
3
+ HULY_WORKSPACE=efs
4
+
5
+ # Optional for interactive local use.
6
+ # Recommended for non-interactive runs or automatic re-auth when the cached token expires.
7
+ HULY_EMAIL=you@example.com
8
+ HULY_PASSWORD=your-password
@@ -0,0 +1,42 @@
1
+ name: huly-cli CI
2
+
3
+ on:
4
+ push:
5
+ branches: ["master"]
6
+ pull_request:
7
+ branches: ["master"]
8
+
9
+ jobs:
10
+ lint-and-test:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - name: Install uv
17
+ uses: astral-sh/setup-uv@v5
18
+ with:
19
+ enable-cache: true
20
+
21
+ - name: Set up Python
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.12"
25
+
26
+ - name: Install dependencies
27
+ run: uv sync --extra dev
28
+
29
+ - name: Lint (ruff check)
30
+ run: uv run ruff check .
31
+
32
+ - name: Format check (ruff format)
33
+ run: uv run ruff format --check .
34
+
35
+ - name: Run tests
36
+ run: uv run pytest tests/ -v
37
+
38
+ - name: Build distributions
39
+ run: uv run python -m build
40
+
41
+ - name: Validate distribution metadata
42
+ run: uv run twine check dist/*
@@ -0,0 +1,61 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ permissions:
13
+ contents: read
14
+
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - name: Install uv
19
+ uses: astral-sh/setup-uv@v5
20
+ with:
21
+ enable-cache: true
22
+
23
+ - name: Set up Python
24
+ uses: actions/setup-python@v5
25
+ with:
26
+ python-version: "3.12"
27
+
28
+ - name: Install dependencies
29
+ run: uv sync --extra dev
30
+
31
+ - name: Build distributions
32
+ run: uv run python -m build
33
+
34
+ - name: Validate distribution metadata
35
+ run: uv run twine check dist/*
36
+
37
+ - name: Upload distributions
38
+ uses: actions/upload-artifact@v4
39
+ with:
40
+ name: python-package-distributions
41
+ path: dist/
42
+
43
+ publish:
44
+ needs: build
45
+ runs-on: ubuntu-latest
46
+ permissions:
47
+ id-token: write
48
+ contents: read
49
+ environment:
50
+ name: pypi
51
+ url: https://pypi.org/p/huly-cli
52
+
53
+ steps:
54
+ - name: Download distributions
55
+ uses: actions/download-artifact@v4
56
+ with:
57
+ name: python-package-distributions
58
+ path: dist/
59
+
60
+ - name: Publish to PyPI
61
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,15 @@
1
+ node_modules/
2
+ dist/
3
+ build/
4
+ .env
5
+ .pypirc
6
+ *.log
7
+ .DS_Store
8
+ __pycache__/
9
+ *.py[cod]
10
+ .pytest_cache/
11
+ .ruff_cache/
12
+ .venv/
13
+ *.egg-info/
14
+ .specstory/
15
+ .vscode/
@@ -0,0 +1,7 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.8.0
4
+ hooks:
5
+ - id: ruff
6
+ args: [--fix]
7
+ - id: ruff-format
huly_cli-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,345 @@
1
+ Metadata-Version: 2.4
2
+ Name: huly-cli
3
+ Version: 0.1.0
4
+ Summary: CLI for Huly project management
5
+ Project-URL: Homepage, https://github.com/teslakoile/huly-cli
6
+ Project-URL: Repository, https://github.com/teslakoile/huly-cli
7
+ Project-URL: Issues, https://github.com/teslakoile/huly-cli/issues
8
+ License: MIT License
9
+
10
+ Copyright (c) 2026
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ License-File: LICENSE
30
+ Keywords: cli,huly,project-management
31
+ Classifier: Development Status :: 4 - Beta
32
+ Classifier: Environment :: Console
33
+ Classifier: Intended Audience :: Developers
34
+ Classifier: License :: OSI Approved :: MIT License
35
+ Classifier: Programming Language :: Python :: 3
36
+ Classifier: Programming Language :: Python :: 3.11
37
+ Classifier: Programming Language :: Python :: 3.12
38
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
39
+ Classifier: Topic :: Utilities
40
+ Requires-Python: >=3.11
41
+ Requires-Dist: httpx<1.0,>=0.28.0
42
+ Requires-Dist: pydantic<3.0,>=2.10.0
43
+ Requires-Dist: python-dotenv<2.0,>=1.0.0
44
+ Requires-Dist: rich<14.0,>=13.9.0
45
+ Requires-Dist: tomli-w<2.0,>=1.1.0
46
+ Requires-Dist: typer<1.0,>=0.15.0
47
+ Provides-Extra: dev
48
+ Requires-Dist: build>=1.2.2; extra == 'dev'
49
+ Requires-Dist: pre-commit>=3.5.0; extra == 'dev'
50
+ Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
51
+ Requires-Dist: pytest>=8.0; extra == 'dev'
52
+ Requires-Dist: respx>=0.22.0; extra == 'dev'
53
+ Requires-Dist: ruff>=0.8.0; extra == 'dev'
54
+ Requires-Dist: twine>=6.1.0; extra == 'dev'
55
+ Description-Content-Type: text/markdown
56
+
57
+ # huly-cli
58
+
59
+ Python CLI for interacting with a Huly workspace from the terminal.
60
+
61
+ ## Status
62
+
63
+ This repo is currently a Python `typer` CLI, not a Node or `pnpm` project.
64
+
65
+ It has been checked against `hcengineering/platform@v0.6.504` and smoke-tested against
66
+ `https://huly.ingenuity.ph` workspace `efs`.
67
+
68
+ What is verified today:
69
+
70
+ - Authentication flow via `/_accounts`
71
+ - Read access for projects, issues, components, documents, templates, members, labels, and issue descriptions
72
+ - Live CRUD for issues, documents, components, and milestones on `https://huly.ingenuity.ph` workspace `efs`
73
+ - Live template description update and restore flow
74
+ - Workspace-specific issue status display and status filtering
75
+ - Local unit/CLI test suite
76
+ - CI-equivalent local checks:
77
+ `uv sync --extra dev`, `uv run ruff check .`, `uv run ruff format --check .`,
78
+ `uv run pytest tests/ -v`, `uv run python -m build`, and `uv run twine check dist/*`
79
+
80
+ What is not fully verified yet:
81
+
82
+ - Automated live-workspace CI has not been added
83
+ - You should still prefer a disposable project or disposable teamspace for release-time live smoke tests
84
+
85
+ Known live compatibility gaps at the time of writing:
86
+
87
+ - No known read-path breakage remains from the `v0.6.504` comparison and smoke tests
88
+ - No known CLI CRUD gap remains on the currently implemented issue, document, component, and milestone surfaces
89
+ - The test suite now patches auth correctly; it no longer depends on a developer's local cached login state
90
+
91
+ ## Compatibility Target
92
+
93
+ - Huly platform tag: `v0.6.504`
94
+ - Example workspace URL used during verification:
95
+ `https://huly.ingenuity.ph/workbench/efs/tracker/69cb986a2df46a01935af670/issues`
96
+
97
+ Important distinction:
98
+
99
+ - `efs` is the workspace slug
100
+ - `ROA` is the project identifier in that workspace
101
+
102
+ If you run `huly issues list --project EFS`, it will fail because `EFS` is not a project ID.
103
+
104
+ ## Prerequisites
105
+
106
+ - Python `3.11+`
107
+ - [`uv`](https://docs.astral.sh/uv/)
108
+ - A Huly account with access to the target workspace
109
+
110
+ ## Setup
111
+
112
+ 1. Install dependencies, including dev tools:
113
+
114
+ ```bash
115
+ uv sync --extra dev
116
+ ```
117
+
118
+ 2. Copy the example environment file:
119
+
120
+ ```bash
121
+ cp .env.example .env
122
+ ```
123
+
124
+ 3. Edit `.env` with at least:
125
+
126
+ - `HULY_URL`
127
+ - `HULY_WORKSPACE`
128
+
129
+ 4. Choose one auth approach:
130
+
131
+ - Interactive login: preferred for local use
132
+ - Environment-based login: useful for non-interactive runs and token refresh
133
+
134
+ ## Environment Variables
135
+
136
+ The CLI loads config in this order:
137
+
138
+ 1. CLI flags
139
+ 2. Environment variables
140
+ 3. `.env` in the current directory
141
+ 4. `~/.config/huly/config.toml`
142
+
143
+ Supported variables:
144
+
145
+ - `HULY_URL`
146
+ - `HULY_WORKSPACE`
147
+ - `HULY_EMAIL`
148
+ - `HULY_PASSWORD`
149
+
150
+ Auth cache location:
151
+
152
+ - Config: `~/.config/huly/config.toml`
153
+ - Tokens: `~/.config/huly/auth.json`
154
+
155
+ The token cache is reused automatically. If the cached token expires, the CLI needs
156
+ `HULY_EMAIL` and `HULY_PASSWORD` available in order to re-authenticate automatically.
157
+
158
+ ## Login Walkthrough
159
+
160
+ ### Option 1: Interactive login
161
+
162
+ This is the simplest flow if you are testing locally and do not want to keep your password
163
+ in `.env`.
164
+
165
+ ```bash
166
+ uv run huly --url https://huly.ingenuity.ph --workspace efs auth login
167
+ ```
168
+
169
+ You will be prompted for:
170
+
171
+ - Email
172
+ - Password
173
+ - Workspace slug, if it was not passed on the command line or set in `.env`
174
+
175
+ Then confirm auth is valid:
176
+
177
+ ```bash
178
+ uv run huly auth status
179
+ ```
180
+
181
+ ### Option 2: Login using `.env`
182
+
183
+ Put all four values in `.env`:
184
+
185
+ ```bash
186
+ HULY_URL=https://huly.ingenuity.ph
187
+ HULY_WORKSPACE=efs
188
+ HULY_EMAIL=you@example.com
189
+ HULY_PASSWORD=your-password
190
+ ```
191
+
192
+ Then run:
193
+
194
+ ```bash
195
+ uv run huly auth login
196
+ uv run huly auth status
197
+ ```
198
+
199
+ ## Hands-On Smoke Test
200
+
201
+ These commands are the safest live checks to run today.
202
+
203
+ If you want the repo to drive the same smoke pass for you:
204
+
205
+ ```bash
206
+ uv run python scripts/live_smoke.py
207
+ ```
208
+
209
+ To include live CRUD checks with automatic cleanup:
210
+
211
+ ```bash
212
+ uv run python scripts/live_smoke.py --allow-writes
213
+ ```
214
+
215
+ 1. Confirm auth:
216
+
217
+ ```bash
218
+ uv run huly auth status
219
+ ```
220
+
221
+ 2. List projects:
222
+
223
+ ```bash
224
+ uv run huly projects list
225
+ ```
226
+
227
+ 3. Inspect the verified sample project:
228
+
229
+ ```bash
230
+ uv run huly projects get ROA
231
+ ```
232
+
233
+ 4. List a few issues from that project:
234
+
235
+ ```bash
236
+ uv run huly issues list --project ROA --limit 5
237
+ ```
238
+
239
+ 5. Inspect one issue:
240
+
241
+ ```bash
242
+ uv run huly issues get ROA-1
243
+ ```
244
+
245
+ 6. Read the issue description:
246
+
247
+ ```bash
248
+ uv run huly issues describe ROA-1
249
+ ```
250
+
251
+ 7. List project components:
252
+
253
+ ```bash
254
+ uv run huly components list --project ROA --limit 5
255
+ ```
256
+
257
+ 8. Inspect a component by internal ID:
258
+
259
+ ```bash
260
+ uv run huly components get 16e202fa79377835295c79eb
261
+ ```
262
+
263
+ 9. List a few documents:
264
+
265
+ ```bash
266
+ uv run huly documents list --limit 5
267
+ ```
268
+
269
+ 10. List issue templates:
270
+
271
+ ```bash
272
+ uv run huly templates list --limit 5
273
+ ```
274
+
275
+ 11. Verify status filtering:
276
+
277
+ ```bash
278
+ uv run huly issues list --status backlog --limit 5
279
+ ```
280
+
281
+ 12. List workspace members:
282
+
283
+ ```bash
284
+ uv run huly members list
285
+ ```
286
+
287
+ 13. List labels:
288
+
289
+ ```bash
290
+ uv run huly labels list
291
+ ```
292
+
293
+ ### JSON mode
294
+
295
+ If you want machine-readable output for quick inspection:
296
+
297
+ ```bash
298
+ uv run huly --json projects list
299
+ uv run huly --json issues list --project ROA --limit 5
300
+ uv run huly --json auth status
301
+ ```
302
+
303
+ ## Commands That Currently Need Caution
304
+
305
+ The CLI write paths were exercised live during verification, but you should still
306
+ prefer a disposable project or disposable teamspace when doing release-time smoke
307
+ tests against a real workspace.
308
+
309
+ ## Local Test Suite
310
+
311
+ Run the unit and CLI regression tests with:
312
+
313
+ ```bash
314
+ uv run --extra dev pytest -q
315
+ ```
316
+
317
+ Expected result at the time of verification:
318
+
319
+ - `155 passed`
320
+
321
+ ## Packaging And PyPI
322
+
323
+ The repo now builds a wheel and sdist cleanly and CI validates the distribution
324
+ metadata.
325
+
326
+ For the full release checklist, including the manual PyPI setup you still need
327
+ to do, see [RELEASE.md](RELEASE.md).
328
+
329
+ ## CLI Help
330
+
331
+ Top-level help:
332
+
333
+ ```bash
334
+ uv run huly --help
335
+ ```
336
+
337
+ Auth help:
338
+
339
+ ```bash
340
+ uv run huly auth login --help
341
+ ```
342
+
343
+ ## License
344
+
345
+ MIT