kd-cli 2.0.4__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.
- kd/__init__.py +45 -0
- kd/api/__init__.py +15 -0
- kd/api/articles.py +232 -0
- kd/api/http.py +234 -0
- kd/api/hub.py +69 -0
- kd/api/saved_queries.py +76 -0
- kd/api/tags.py +107 -0
- kd/api/youtrack.py +414 -0
- kd/article_marker.py +348 -0
- kd/auth.py +96 -0
- kd/cli/__init__.py +5 -0
- kd/cli/core/__init__.py +25 -0
- kd/cli/core/command_base.py +133 -0
- kd/cli/core/command_parser.py +246 -0
- kd/cli/core/namespaces.py +175 -0
- kd/cli/core/option_registry.py +265 -0
- kd/cli/input.py +42 -0
- kd/cli/main.py +612 -0
- kd/cli/namespaces/__init__.py +38 -0
- kd/cli/namespaces/alias/__init__.py +87 -0
- kd/cli/namespaces/article/__init__.py +843 -0
- kd/cli/namespaces/init.py +42 -0
- kd/cli/namespaces/issue/__init__.py +959 -0
- kd/cli/namespaces/primer/__init__.py +337 -0
- kd/cli/namespaces/project/__init__.py +243 -0
- kd/cli/namespaces/query/__init__.py +465 -0
- kd/cli/namespaces/search/__init__.py +82 -0
- kd/cli/namespaces/system/__init__.py +528 -0
- kd/cli/namespaces/tag/__init__.py +337 -0
- kd/cli/namespaces/time/__init__.py +307 -0
- kd/cli/namespaces/user/__init__.py +99 -0
- kd/cli/output.py +287 -0
- kd/cli/tree.py +65 -0
- kd/client.py +1953 -0
- kd/config.py +853 -0
- kd/connection.py +156 -0
- kd/debug.py +107 -0
- kd/exceptions.py +189 -0
- kd/history.py +169 -0
- kd/models/__init__.py +75 -0
- kd/models/article.py +64 -0
- kd/models/assist.py +47 -0
- kd/models/attachment.py +20 -0
- kd/models/comment.py +25 -0
- kd/models/common.py +39 -0
- kd/models/issue.py +67 -0
- kd/models/project.py +60 -0
- kd/models/saved_query.py +54 -0
- kd/models/search.py +20 -0
- kd/models/tag.py +30 -0
- kd/models/user.py +42 -0
- kd/models/work_item.py +59 -0
- kd/primer.py +231 -0
- kd/query_parser.py +181 -0
- kd/resources/__init__.py +1 -0
- kd/resources/command-synonyms.yaml +19 -0
- kd/resources/config-template.yaml +71 -0
- kd/resources/error-messages.yaml +101 -0
- kd_cli-2.0.4.dist-info/METADATA +149 -0
- kd_cli-2.0.4.dist-info/RECORD +64 -0
- kd_cli-2.0.4.dist-info/WHEEL +5 -0
- kd_cli-2.0.4.dist-info/entry_points.txt +2 -0
- kd_cli-2.0.4.dist-info/licenses/LICENSE +21 -0
- kd_cli-2.0.4.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"""Init command: kd init
|
|
2
|
+
|
|
3
|
+
Scaffolds a local .kd/config.yaml in the current directory
|
|
4
|
+
and manages .gitignore integration.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from typing import Any
|
|
10
|
+
|
|
11
|
+
from kd.cli.core.command_base import Command, CommandResult
|
|
12
|
+
from kd.cli.core.option_registry import ResolvedOptions
|
|
13
|
+
from kd.config import init_project_config
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class InitCommand(Command):
|
|
17
|
+
"""Initialize project-local config."""
|
|
18
|
+
|
|
19
|
+
def __init__(self) -> None:
|
|
20
|
+
super().__init__(
|
|
21
|
+
"init",
|
|
22
|
+
"Initialize project config (.kd/config.yaml)",
|
|
23
|
+
usage="kd init [URL]",
|
|
24
|
+
long_description="Creates .kd/config.yaml in the current directory. "
|
|
25
|
+
"Optionally pre-fills the YouTrack URL. Adds .kd/ to .gitignore "
|
|
26
|
+
"if in a git repository.",
|
|
27
|
+
examples=[
|
|
28
|
+
"kd init",
|
|
29
|
+
"kd init https://example.youtrack.cloud",
|
|
30
|
+
],
|
|
31
|
+
see_also=["/system/config list", "/system/config which"],
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
def execute(
|
|
35
|
+
self, args: list[str], options: ResolvedOptions, client: Any = None
|
|
36
|
+
) -> CommandResult:
|
|
37
|
+
url = args[0] if args else None
|
|
38
|
+
result = init_project_config(url=url)
|
|
39
|
+
return {
|
|
40
|
+
"created": str(result.created),
|
|
41
|
+
"gitignore": result.gitignore_action,
|
|
42
|
+
}
|