gitwise-cli 0.34.2__py3-none-any.whl → 0.35.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.
- gitwise/__init__.py +1 -1
- gitwise/__main__.py +3 -3
- gitwise/_cli_dispatch.py +1 -1
- gitwise/_cli_introspection.py +6 -1
- gitwise/_cli_parser.py +6 -0
- gitwise/_i18n_data.json +4 -0
- gitwise/context.py +20 -5
- gitwise/share/schemas/v1/input/context.json +6 -0
- gitwise/share/schemas/v1/output/context.json +15 -1
- {gitwise_cli-0.34.2.dist-info → gitwise_cli-0.35.0.dist-info}/METADATA +1 -1
- {gitwise_cli-0.34.2.dist-info → gitwise_cli-0.35.0.dist-info}/RECORD +14 -14
- {gitwise_cli-0.34.2.dist-info → gitwise_cli-0.35.0.dist-info}/WHEEL +0 -0
- {gitwise_cli-0.34.2.dist-info → gitwise_cli-0.35.0.dist-info}/entry_points.txt +0 -0
- {gitwise_cli-0.34.2.dist-info → gitwise_cli-0.35.0.dist-info}/licenses/LICENSE +0 -0
gitwise/__init__.py
CHANGED
gitwise/__main__.py
CHANGED
|
@@ -113,7 +113,8 @@ def main() -> int:
|
|
|
113
113
|
reset_runtime_config()
|
|
114
114
|
|
|
115
115
|
set_json_pretty(args.json_pretty)
|
|
116
|
-
|
|
116
|
+
machine_output = args.json or getattr(args, "json_lines", False)
|
|
117
|
+
set_json_mode(machine_output)
|
|
117
118
|
|
|
118
119
|
if args.lang:
|
|
119
120
|
set_locale(args.lang)
|
|
@@ -147,8 +148,7 @@ def main() -> int:
|
|
|
147
148
|
ret = 1
|
|
148
149
|
|
|
149
150
|
elapsed = time.monotonic() - start
|
|
150
|
-
|
|
151
|
-
if not as_json and elapsed > 0.2 and args.command not in ("doctor",):
|
|
151
|
+
if not machine_output and elapsed > 0.2 and args.command not in ("doctor",):
|
|
152
152
|
print_dim(t("completed_in", elapsed=f"{elapsed:.1f}"))
|
|
153
153
|
|
|
154
154
|
return ret
|
gitwise/_cli_dispatch.py
CHANGED
|
@@ -328,7 +328,7 @@ def _run_context(args: argparse.Namespace) -> int:
|
|
|
328
328
|
"""Dispatch to ``context`` subcommand."""
|
|
329
329
|
from gitwise.context import run_context
|
|
330
330
|
|
|
331
|
-
return run_context(as_json=args.json)
|
|
331
|
+
return run_context(max_entries=args.max_entries, as_json=args.json)
|
|
332
332
|
|
|
333
333
|
|
|
334
334
|
def _run_health(args: argparse.Namespace) -> int:
|
gitwise/_cli_introspection.py
CHANGED
|
@@ -233,7 +233,12 @@ def _action_property_schema(action: argparse.Action) -> dict[str, object]:
|
|
|
233
233
|
|
|
234
234
|
# A "limit"/"max-count" argument is a positive-integer bound; surface that
|
|
235
235
|
# in the input schema so consumers know 0/negative are invalid.
|
|
236
|
-
if value_schema["type"] == "integer" and action.dest in {
|
|
236
|
+
if value_schema["type"] == "integer" and action.dest in {
|
|
237
|
+
"limit",
|
|
238
|
+
"max_count",
|
|
239
|
+
"max_entries",
|
|
240
|
+
"maxcount",
|
|
241
|
+
}:
|
|
237
242
|
value_schema["minimum"] = 1
|
|
238
243
|
|
|
239
244
|
description = "" if action.help is argparse.SUPPRESS else (action.help or "")
|
gitwise/_cli_parser.py
CHANGED
|
@@ -353,6 +353,12 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
353
353
|
p.add_argument("--yes", "-y", action="store_true", help="skip confirmation for --hard")
|
|
354
354
|
|
|
355
355
|
p = sub.add_parser("context", help="enriched repo snapshot for LLMs", parents=[parent])
|
|
356
|
+
p.add_argument(
|
|
357
|
+
"--max-entries",
|
|
358
|
+
type=int,
|
|
359
|
+
default=100,
|
|
360
|
+
help="maximum directory tree entries (default: 100)",
|
|
361
|
+
)
|
|
356
362
|
|
|
357
363
|
p = sub.add_parser("health", help="repo health score (0-100)", parents=[parent])
|
|
358
364
|
|
gitwise/_i18n_data.json
CHANGED
|
@@ -395,6 +395,10 @@
|
|
|
395
395
|
"es": "## Tipos de archivo",
|
|
396
396
|
"en": "## File Types"
|
|
397
397
|
},
|
|
398
|
+
"ctx_invalid_max_entries": {
|
|
399
|
+
"es": "--max-entries debe ser mayor que cero",
|
|
400
|
+
"en": "--max-entries must be greater than zero"
|
|
401
|
+
},
|
|
398
402
|
"ctx_more_entries": {
|
|
399
403
|
"es": " ... ({count} entradas más)",
|
|
400
404
|
"en": " ... ({count} more entries)"
|
gitwise/context.py
CHANGED
|
@@ -12,10 +12,13 @@ from gitwise.output import (
|
|
|
12
12
|
print_dim,
|
|
13
13
|
print_header,
|
|
14
14
|
print_json,
|
|
15
|
+
report_error,
|
|
15
16
|
status,
|
|
16
17
|
)
|
|
17
18
|
from gitwise.utils.json_envelope import ok_envelope
|
|
18
19
|
|
|
20
|
+
DEFAULT_MAX_ENTRIES = 100
|
|
21
|
+
|
|
19
22
|
|
|
20
23
|
def _directory_tree(root: Path, max_depth: int = 3) -> list[str]:
|
|
21
24
|
"""Return Unicode box-drawing lines for the directory tree, skipping common noise dirs."""
|
|
@@ -118,14 +121,24 @@ def _branch_topology(root: Path) -> dict[str, list[str]]:
|
|
|
118
121
|
return {"local": local, "remote": remote}
|
|
119
122
|
|
|
120
123
|
|
|
121
|
-
def run_context(*, as_json: bool = False) -> int:
|
|
124
|
+
def run_context(*, max_entries: int = DEFAULT_MAX_ENTRIES, as_json: bool = False) -> int:
|
|
122
125
|
"""Entry point for the ``gitwise context`` command."""
|
|
123
126
|
root = require_root(as_json=as_json, command="context")
|
|
124
127
|
if root is None:
|
|
125
128
|
return 1
|
|
129
|
+
if max_entries <= 0:
|
|
130
|
+
return report_error(
|
|
131
|
+
"context",
|
|
132
|
+
as_json=as_json,
|
|
133
|
+
msg=t("ctx_invalid_max_entries"),
|
|
134
|
+
code="invalid_max_entries",
|
|
135
|
+
)
|
|
126
136
|
|
|
127
137
|
with status(t("status_context_scan")):
|
|
128
|
-
|
|
138
|
+
full_tree = _directory_tree(root)
|
|
139
|
+
tree = full_tree[:max_entries]
|
|
140
|
+
tree_total = len(full_tree)
|
|
141
|
+
tree_truncated = tree_total > len(tree)
|
|
129
142
|
contributors = _top_contributors(root)
|
|
130
143
|
file_types = _file_type_breakdown(root)
|
|
131
144
|
todo_fixme = _todo_fixme_counts(root)
|
|
@@ -140,6 +153,8 @@ def run_context(*, as_json: bool = False) -> int:
|
|
|
140
153
|
"context",
|
|
141
154
|
data={
|
|
142
155
|
"tree": tree,
|
|
156
|
+
"tree_total": tree_total,
|
|
157
|
+
"tree_truncated": tree_truncated,
|
|
143
158
|
"contributors": contributors,
|
|
144
159
|
"file_types": file_types,
|
|
145
160
|
"todo_fixme": todo_fixme,
|
|
@@ -150,10 +165,10 @@ def run_context(*, as_json: bool = False) -> int:
|
|
|
150
165
|
)
|
|
151
166
|
else:
|
|
152
167
|
print_header(t("ctx_directory_tree"))
|
|
153
|
-
for ln in tree
|
|
168
|
+
for ln in tree:
|
|
154
169
|
info(f" {ln}")
|
|
155
|
-
if
|
|
156
|
-
print_dim(t("ctx_more_entries", count=str(len(tree)
|
|
170
|
+
if tree_truncated:
|
|
171
|
+
print_dim(t("ctx_more_entries", count=str(tree_total - len(tree))))
|
|
157
172
|
print_blank()
|
|
158
173
|
if contributors:
|
|
159
174
|
print_bracket(t("ctx_top_contributors"))
|
|
@@ -31,6 +31,12 @@
|
|
|
31
31
|
"type": "boolean",
|
|
32
32
|
"description": "pretty-print JSON output",
|
|
33
33
|
"default": false
|
|
34
|
+
},
|
|
35
|
+
"max_entries": {
|
|
36
|
+
"type": "integer",
|
|
37
|
+
"minimum": 1,
|
|
38
|
+
"description": "maximum directory tree entries (default: 100)",
|
|
39
|
+
"default": 100
|
|
34
40
|
}
|
|
35
41
|
}
|
|
36
42
|
}
|
|
@@ -52,7 +52,21 @@
|
|
|
52
52
|
},
|
|
53
53
|
"data": {
|
|
54
54
|
"type": "object",
|
|
55
|
-
"properties": {
|
|
55
|
+
"properties": {
|
|
56
|
+
"tree": {
|
|
57
|
+
"type": "array",
|
|
58
|
+
"items": {
|
|
59
|
+
"type": "string"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"tree_total": {
|
|
63
|
+
"type": "integer",
|
|
64
|
+
"minimum": 0
|
|
65
|
+
},
|
|
66
|
+
"tree_truncated": {
|
|
67
|
+
"type": "boolean"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
56
70
|
}
|
|
57
71
|
}
|
|
58
72
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gitwise-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.35.0
|
|
4
4
|
Summary: Python CLI for optimizing git workflows and Claude Code integration
|
|
5
5
|
Project-URL: Homepage, https://github.com/drzioner/gitwise
|
|
6
6
|
Project-URL: Repository, https://github.com/drzioner/gitwise
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
gitwise/__init__.py,sha256=
|
|
2
|
-
gitwise/__main__.py,sha256=
|
|
1
|
+
gitwise/__init__.py,sha256=9xYkA1cZ8bChVEs5tRwf78IGBkbiu2P_BjWD5XTqPN8,432
|
|
2
|
+
gitwise/__main__.py,sha256=un7xnbcNDlKp3yBXw8tPKY6eFttldppCumYIEHFknE0,5224
|
|
3
3
|
gitwise/_cli_completions.py,sha256=TlVH42FLU6_1vpTpbxKp-i7r6B8yPtk_LZ3D2l8HMWI,6570
|
|
4
|
-
gitwise/_cli_dispatch.py,sha256=
|
|
5
|
-
gitwise/_cli_introspection.py,sha256=
|
|
6
|
-
gitwise/_cli_parser.py,sha256=
|
|
4
|
+
gitwise/_cli_dispatch.py,sha256=xtDiinReOH_peyYRRWWrk7HJLmgP205OWXqdzlZWRRQ,19191
|
|
5
|
+
gitwise/_cli_introspection.py,sha256=gLraIn1AoWHv6QvOdsEPixbhXW2NVE0UyL_jqofetmk,11174
|
|
6
|
+
gitwise/_cli_parser.py,sha256=vdgoVMghPYaFjy6vzmth8uE0_noWv4qDIhRRXWRD4C4,19437
|
|
7
7
|
gitwise/_cli_setup_agents.py,sha256=ErDGdTVCx-b416LnkH5yZzHqYEiO2rkBvYtHDi59mW4,15328
|
|
8
|
-
gitwise/_i18n_data.json,sha256=
|
|
8
|
+
gitwise/_i18n_data.json,sha256=kNphQcPbaQjVvp7Sb6kb0hfKRmTDUleZ_4LVkniCoSE,70941
|
|
9
9
|
gitwise/_paths.py,sha256=VRkql9HQ5_OjwbpcX-18fwe_lMpuQffP4AiBV6suSFg,658
|
|
10
10
|
gitwise/_runtime_config.py,sha256=EF0NOlNNvEf9awRsfHr0Ma7MNgy4Fl3aPbLY9HEVEpQ,8350
|
|
11
11
|
gitwise/audit.py,sha256=644-WhyxelBS6lkSKvidQgOXGSs-UWwyWKfxphQ8PSE,11322
|
|
@@ -13,7 +13,7 @@ gitwise/branches.py,sha256=rCl0oV8Us1qTDlaHVHihlmTkQz-qmQL6tL4lg-ttj2w,7748
|
|
|
13
13
|
gitwise/clean.py,sha256=pU6TA40T1dr7z3RomRY8VU5B3_laDdbsXpWDrdpRVZM,7024
|
|
14
14
|
gitwise/commit.py,sha256=VmoDrf-yqFKqMi0gcl74RYS525gbnrdQhQSoy-Q3UKk,9714
|
|
15
15
|
gitwise/conflicts.py,sha256=eyTmqA4HEavn-rW7xCA3TSSaZq3VE5gmVH2BONM_Ah8,8502
|
|
16
|
-
gitwise/context.py,sha256=
|
|
16
|
+
gitwise/context.py,sha256=l3p-SSxxQNqYl1KUjl2yfX0q_bw2WhiorCf7_uh8fKM,6758
|
|
17
17
|
gitwise/design.py,sha256=9P_XJc6P_glRc9DPOwb_VbnxaB-ekFRcd71rcs4JWc8,12936
|
|
18
18
|
gitwise/diff.py,sha256=6FBLC2NOitaOpAdLveMNN1BG3G8DmYsUGmvWFu2RQFY,21163
|
|
19
19
|
gitwise/doctor.py,sha256=SyefSCTQ2oLFeB6r5saRcl1UCfCyoYmh6YSoKBy6BdE,4291
|
|
@@ -98,7 +98,7 @@ gitwise/share/schemas/v1/input/commands.json,sha256=cY-gQK_k-KpYd1xSeo-9QaD-H5-M
|
|
|
98
98
|
gitwise/share/schemas/v1/input/commit.json,sha256=cqWj9QBqREEkKCuHCH4GpN28Qtu14A9hmf_51gPgeEk,1616
|
|
99
99
|
gitwise/share/schemas/v1/input/completions.json,sha256=VoDfxoo97dM6LImank7-rz1e89ndc_LS_E69EAsLNO0,1229
|
|
100
100
|
gitwise/share/schemas/v1/input/conflicts.json,sha256=pak6p3fzlKANWudbOuIUN5i86_HSgGGhPbcwRYTr5wQ,1587
|
|
101
|
-
gitwise/share/schemas/v1/input/context.json,sha256=
|
|
101
|
+
gitwise/share/schemas/v1/input/context.json,sha256=1GdiULR6_VpHxTIB5s6uEfbLCUBiQ6kPkwy8els00W4,1005
|
|
102
102
|
gitwise/share/schemas/v1/input/diff.json,sha256=uPzyjZthVSoooBynuCQLKAB2wf04pBfH46lM49cccCk,2365
|
|
103
103
|
gitwise/share/schemas/v1/input/doctor.json,sha256=qkR-oY8jlNyur8USc62o8g8EmUFA0q3t5sVCSfHO8vE,839
|
|
104
104
|
gitwise/share/schemas/v1/input/health.json,sha256=ujZmveZ8un8DhgKGan79A_MOTxu0rjXXUmDlSAeU7oM,839
|
|
@@ -127,7 +127,7 @@ gitwise/share/schemas/v1/output/clean.json,sha256=U8rH3G9ytiIq7gzu9FwBqRt5nq6QsB
|
|
|
127
127
|
gitwise/share/schemas/v1/output/commands.json,sha256=51Hf5v-4_9odGUJ-iKVyNCoXbqNvRxpYYq9ci5SvfjA,1585
|
|
128
128
|
gitwise/share/schemas/v1/output/commit.json,sha256=mmE4c9I2FkAxxfm9PB8kPe51p2i8D21Bk0gCz0YYd9A,1478
|
|
129
129
|
gitwise/share/schemas/v1/output/conflicts.json,sha256=F8ub7lYAi51DgM3Qx8fkA5g3trlmIp6QnurRjlD_4J0,1784
|
|
130
|
-
gitwise/share/schemas/v1/output/context.json,sha256=
|
|
130
|
+
gitwise/share/schemas/v1/output/context.json,sha256=p5et0F59qXTx9Jw9PZ4-izn6GIjtkCDOlqgE1tiP93Q,1455
|
|
131
131
|
gitwise/share/schemas/v1/output/diff.json,sha256=8f5Ah8s43H1W-YoCvtrQMIFmD4PPB1W1DrnWhAZUfc4,2910
|
|
132
132
|
gitwise/share/schemas/v1/output/doctor.json,sha256=AEhvl6XKJ1WkDo1s1SHPSHlQVUEBY1wSTGblE9RRztg,1173
|
|
133
133
|
gitwise/share/schemas/v1/output/health.json,sha256=6rgBIM4mUyBkHjupdCVtQ1a_1I3nAxwUTcDJog1Z9hQ,2623
|
|
@@ -148,8 +148,8 @@ gitwise/share/schemas/v1/output/tag.json,sha256=EPDFtSjrPXqUJfhf0j8ciCrEhjACq1VW
|
|
|
148
148
|
gitwise/share/schemas/v1/output/undo.json,sha256=eVCVYhGNnUF025ExbxHygaRzWybGCWFhp540U5JMk60,1467
|
|
149
149
|
gitwise/share/schemas/v1/output/update.json,sha256=Gm0ACHlpgRhOr1-qrV6fAXxi_Pcbv9zsfZ17_2btJVs,1411
|
|
150
150
|
gitwise/share/schemas/v1/output/worktree.json,sha256=55Z6wgv0BOV4YhAZAqLI0vgKXIBcw0Xspbn0N0tW0I4,1929
|
|
151
|
-
gitwise_cli-0.
|
|
152
|
-
gitwise_cli-0.
|
|
153
|
-
gitwise_cli-0.
|
|
154
|
-
gitwise_cli-0.
|
|
155
|
-
gitwise_cli-0.
|
|
151
|
+
gitwise_cli-0.35.0.dist-info/METADATA,sha256=KoWvqiBQzqh_j_7QBgJMfA9eggCbq1y0yh8DQnoU9q8,7563
|
|
152
|
+
gitwise_cli-0.35.0.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
|
|
153
|
+
gitwise_cli-0.35.0.dist-info/entry_points.txt,sha256=m3_cGIC4VTGp7Wn5_s7NBPACs9Yiwdn4ZBWUBX4PMfQ,77
|
|
154
|
+
gitwise_cli-0.35.0.dist-info/licenses/LICENSE,sha256=vfJO-ThMtWhZOD9MsArN2yul1EJmxAXxfeGHKnEk9QQ,1063
|
|
155
|
+
gitwise_cli-0.35.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|