codigest 0.4.0__tar.gz → 0.4.2__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 (46) hide show
  1. codigest-0.4.2/.github/workflows/tests.yml +15 -0
  2. {codigest-0.4.0 → codigest-0.4.2}/CITATION.cff +1 -1
  3. {codigest-0.4.0 → codigest-0.4.2}/PKG-INFO +9 -2
  4. {codigest-0.4.0 → codigest-0.4.2}/README.md +8 -1
  5. {codigest-0.4.0 → codigest-0.4.2}/pyproject.toml +1 -1
  6. codigest-0.4.2/server.json +28 -0
  7. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/commands/mcp.py +0 -1
  8. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/commands/term.py +30 -7
  9. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/main.py +8 -8
  10. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/shell/hook.ps1 +5 -1
  11. {codigest-0.4.0 → codigest-0.4.2}/uv.lock +1 -1
  12. {codigest-0.4.0 → codigest-0.4.2}/.github/workflows/publish.yml +0 -0
  13. {codigest-0.4.0 → codigest-0.4.2}/.gitignore +0 -0
  14. {codigest-0.4.0 → codigest-0.4.2}/.python-version +0 -0
  15. {codigest-0.4.0 → codigest-0.4.2}/LICENSE +0 -0
  16. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/__init__.py +0 -0
  17. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/__main__.py +0 -0
  18. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/commands/cap.py +0 -0
  19. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/commands/clean.py +0 -0
  20. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/commands/diff.py +0 -0
  21. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/commands/digest.py +0 -0
  22. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/commands/init.py +0 -0
  23. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/commands/scan.py +0 -0
  24. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/commands/semdiff.py +0 -0
  25. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/commands/status.py +0 -0
  26. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/commands/tree.py +0 -0
  27. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/config.py +0 -0
  28. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/core/cache.py +0 -0
  29. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/core/common.py +0 -0
  30. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/core/git_ops.py +0 -0
  31. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/core/output.py +0 -0
  32. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/core/processor.py +0 -0
  33. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/core/prompts.py +0 -0
  34. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/core/redact.py +0 -0
  35. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/core/resolver.py +0 -0
  36. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/core/runner.py +0 -0
  37. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/core/scanner.py +0 -0
  38. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/core/semdiff.py +0 -0
  39. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/core/shadow.py +0 -0
  40. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/core/shellhist.py +0 -0
  41. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/core/structure.py +0 -0
  42. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/core/tags.py +0 -0
  43. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/core/termstore.py +0 -0
  44. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/core/tokenizer.py +0 -0
  45. {codigest-0.4.0 → codigest-0.4.2}/src/codigest/options.py +0 -0
  46. {codigest-0.4.0 → codigest-0.4.2}/tests/test_termstore.py +0 -0
@@ -0,0 +1,15 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: astral-sh/setup-uv@v5
14
+ - run: uv python install 3.15
15
+ - run: uv run --with pytest pytest -q
@@ -14,7 +14,7 @@ authors:
14
14
  repository-code: "https://github.com/NaNIsaac/codigest"
15
15
  url: "https://pypi.org/project/codigest/"
16
16
  license: MIT
17
- version: 0.4.0
17
+ version: 0.4.2
18
18
  date-released: "2026-10-15"
19
19
  keywords:
20
20
  - LLM
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: codigest
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: Human-Centered Codebase Context Manager for LLMs
5
5
  Project-URL: Homepage, https://github.com/NaNIsaac/codigest
6
6
  Project-URL: Repository, https://github.com/NaNIsaac/codigest
@@ -26,6 +26,12 @@ Description-Content-Type: text/markdown
26
26
 
27
27
  # Codigest
28
28
 
29
+ [![PyPI](https://img.shields.io/pypi/v/codigest)](https://pypi.org/project/codigest/)
30
+ [![Downloads](https://static.pepy.tech/badge/codigest)](https://pepy.tech/project/codigest)
31
+ [![Tests](https://github.com/NaNIsaac/codigest/actions/workflows/tests.yml/badge.svg)](https://github.com/NaNIsaac/codigest/actions/workflows/tests.yml)
32
+
33
+ <!-- mcp-name: io.github.NaNIsaac/codigest -->
34
+
29
35
  **Codigest** is a standalone CLI tool designed to extract, structure, and track the context of your codebase for Large Language Models (LLMs).
30
36
 
31
37
  Unlike simple copy-paste tools, Codigest employs a **Context Anchor** system (Shadow Git) to track changes locally without polluting your main version control history. It also features **Semantic Analysis** to detect structural changes in your code.
@@ -35,7 +41,8 @@ Unlike simple copy-paste tools, Codigest employs a **Context Anchor** system (Sh
35
41
  ## Quickstart
36
42
 
37
43
  ```bash
38
- uv tool install codigest
44
+ uvx codigest scan # try it without installing
45
+ uv tool install codigest # or install the `cdg` command
39
46
 
40
47
  cdg scan # whole project as LLM-ready XML (copied to clipboard)
41
48
  cdg init && cdg diff # set an anchor, later get only what changed
@@ -1,5 +1,11 @@
1
1
  # Codigest
2
2
 
3
+ [![PyPI](https://img.shields.io/pypi/v/codigest)](https://pypi.org/project/codigest/)
4
+ [![Downloads](https://static.pepy.tech/badge/codigest)](https://pepy.tech/project/codigest)
5
+ [![Tests](https://github.com/NaNIsaac/codigest/actions/workflows/tests.yml/badge.svg)](https://github.com/NaNIsaac/codigest/actions/workflows/tests.yml)
6
+
7
+ <!-- mcp-name: io.github.NaNIsaac/codigest -->
8
+
3
9
  **Codigest** is a standalone CLI tool designed to extract, structure, and track the context of your codebase for Large Language Models (LLMs).
4
10
 
5
11
  Unlike simple copy-paste tools, Codigest employs a **Context Anchor** system (Shadow Git) to track changes locally without polluting your main version control history. It also features **Semantic Analysis** to detect structural changes in your code.
@@ -9,7 +15,8 @@ Unlike simple copy-paste tools, Codigest employs a **Context Anchor** system (Sh
9
15
  ## Quickstart
10
16
 
11
17
  ```bash
12
- uv tool install codigest
18
+ uvx codigest scan # try it without installing
19
+ uv tool install codigest # or install the `cdg` command
13
20
 
14
21
  cdg scan # whole project as LLM-ready XML (copied to clipboard)
15
22
  cdg init && cdg diff # set an anchor, later get only what changed
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "codigest"
3
- version = "0.4.0"
3
+ version = "0.4.2"
4
4
  description = "Human-Centered Codebase Context Manager for LLMs"
5
5
  authors = [{ name = "Isaac Yong", email = "isaacyong@naver.com" }]
6
6
  readme = "README.md"
@@ -0,0 +1,28 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "io.github.NaNIsaac/codigest",
4
+ "title": "Codigest",
5
+ "description": "Terminal output, project snapshots and semantic diffs as LLM-ready context",
6
+ "repository": {
7
+ "url": "https://github.com/NaNIsaac/codigest",
8
+ "source": "github"
9
+ },
10
+ "version": "0.4.2",
11
+ "packages": [
12
+ {
13
+ "registryType": "pypi",
14
+ "identifier": "codigest",
15
+ "version": "0.4.2",
16
+ "runtimeHint": "uvx",
17
+ "transport": {
18
+ "type": "stdio"
19
+ },
20
+ "packageArguments": [
21
+ {
22
+ "type": "positional",
23
+ "value": "mcp"
24
+ }
25
+ ]
26
+ }
27
+ ]
28
+ }
@@ -97,7 +97,6 @@ def _cli(command: str, args: JSON) -> str:
97
97
  argv.append("-r")
98
98
  if message := args.get("message"):
99
99
  argv += ["-m", message]
100
- # Options before positionals: Typer group callbacks require that order.
101
100
  match command:
102
101
  case "scan":
103
102
  argv += [str(t) for t in args.get("targets") or []] or ([args["path"]] if "path" in args else [])
@@ -1,7 +1,9 @@
1
1
  """
2
2
  `cdg term` -- recall recent terminal commands (and their output) as LLM context.
3
3
  """
4
+ import os
4
5
  import sys
6
+ import traceback
5
7
  from pathlib import Path
6
8
  from typing import Annotated
7
9
 
@@ -99,13 +101,10 @@ def handle(
99
101
  f"[yellow][Warning][/yellow] No Codigest captures found; "
100
102
  f"falling back to {shell} history [dim](commands only, no output)[/dim]"
101
103
  )
102
- log.print(
103
- "[dim]Capture output with `cdg term install` (PowerShell) "
104
- "or `cdg cap -- <command>`.[/dim]"
105
- )
104
+ _diagnose(log)
106
105
  else:
107
106
  log.print("[yellow]No terminal history available.[/yellow]")
108
- log.print("[dim]Try: cdg term install, or cdg cap -- <command>[/dim]")
107
+ _diagnose(log)
109
108
  raise typer.Exit(code=1)
110
109
 
111
110
  if failed:
@@ -138,6 +137,7 @@ def clear() -> None:
138
137
  """Delete all stored terminal captures."""
139
138
  console = Console()
140
139
  removed = termstore.clear()
140
+ (termstore.get_term_dir() / "ingest-errors.log").unlink(missing_ok=True)
141
141
  console.print(f"[green]Cleared[/green] {removed} captured entries.")
142
142
 
143
143
 
@@ -151,8 +151,31 @@ def path() -> None:
151
151
  @app.command("ingest", hidden=True)
152
152
  def ingest() -> None:
153
153
  """Store one JSON entry from stdin (called by the shell hook)."""
154
- data = json.loads(sys.stdin.buffer.read().decode("utf-8-sig"))
155
- termstore.append_entry(termstore.Entry.from_dict(data))
154
+ try:
155
+ data = json.loads(sys.stdin.buffer.read().decode("utf-8-sig"))
156
+ termstore.append_entry(termstore.Entry.from_dict(data))
157
+ except Exception:
158
+ # The hook discards our stderr; leave a trail `cdg term` can surface.
159
+ with _ingest_log().open("a", encoding="utf-8") as f:
160
+ f.write(f"--- {termstore.now_iso()}\n{traceback.format_exc()}")
161
+ raise typer.Exit(code=1)
162
+
163
+
164
+ def _ingest_log() -> Path:
165
+ termstore.get_term_dir().mkdir(parents=True, exist_ok=True)
166
+ return termstore.get_term_dir() / "ingest-errors.log"
167
+
168
+
169
+ def _diagnose(log) -> None:
170
+ """Explains why nothing was captured instead of failing silently."""
171
+ if not os.environ.get("CODIGEST_HOOK"):
172
+ log.print(
173
+ "[dim]Capture hook is not active in this shell. Run `cdg term install` "
174
+ "and open a new window, or enable it now with:[/dim]"
175
+ )
176
+ log.print(f"[dim] . '{HOOK_PATH}'[/dim]", highlight=False)
177
+ if (errors := termstore.get_term_dir() / "ingest-errors.log").exists():
178
+ log.print(f"[red]Capture errors were logged:[/red] {errors}", highlight=False)
156
179
 
157
180
 
158
181
  # --------------------------------------------------------------------------
@@ -19,14 +19,14 @@ app = typer.Typer(
19
19
  no_args_is_help=True
20
20
  )
21
21
 
22
- app.add_typer(init.app, name="init")
23
- app.add_typer(status.app, name="status")
24
- app.add_typer(clean.app, name="clean")
25
- app.add_typer(scan.app, name="scan")
26
- app.add_typer(tree.app, name="tree")
27
- app.add_typer(digest.app, name="digest")
28
- app.add_typer(diff.app, name="diff")
29
- app.add_typer(semdiff.app, name="semdiff")
22
+ app.command(name="init")(init.handle)
23
+ app.command(name="status")(status.handle)
24
+ app.command(name="clean")(clean.handle)
25
+ app.command(name="scan")(scan.handle)
26
+ app.command(name="tree")(tree.handle)
27
+ app.command(name="digest")(digest.handle)
28
+ app.command(name="diff")(diff.handle)
29
+ app.command(name="semdiff")(semdiff.handle)
30
30
  app.add_typer(term.app, name="term")
31
31
 
32
32
  # `cap` is a plain command, not a group: its first argument is the wrapped
@@ -76,7 +76,8 @@ if (-not (Get-Module PSReadLine)) { return }
76
76
 
77
77
  # ponytail: denylist heuristic for programs that need a real TTY (editors, pagers,
78
78
  # REPLs, ssh). Extend with $env:CODIGEST_CAP_SKIP (a regex) when one slips through.
79
- $global:__cdgSkip = '^\s*(vim?|nvim|nano|emacs|less|more|ssh|htop|btop|top|fzf|lazygit|claude|codex|wsl|cdg|codigest|exit)(\.exe)?\b' +
79
+ $global:__cdgSkip = '^\s*(vim?|nvim|nano|emacs|less|more|ssh|htop|btop|top|fzf|lazygit|claude|codex|wsl|exit)(\.exe)?\b' +
80
+ '|^\s*(cdg|codigest)(\.exe)?\s+(term|mcp)\b' +
80
81
  '|^\s*(python3?|py|ipython|node|pwsh|powershell|bash|cmd)(\.exe)?\s*$' +
81
82
  '|^\s*git\s+(commit(?!.*\s-\w*[mF])|rebase\s+-i|add\s+-[pi]|mergetool)'
82
83
 
@@ -114,3 +115,6 @@ Set-PSReadLineOption -AddToHistoryHandler {
114
115
  if ($global:__cdgPrevHistHandler) { return $global:__cdgPrevHistHandler.Invoke($l) }
115
116
  return $true
116
117
  }
118
+
119
+ # Lets `cdg term` tell whether this shell is hooked.
120
+ $env:CODIGEST_HOOK = '1'
@@ -16,7 +16,7 @@ wheels = [
16
16
 
17
17
  [[package]]
18
18
  name = "codigest"
19
- version = "0.4.0"
19
+ version = "0.4.2"
20
20
  source = { editable = "." }
21
21
  dependencies = [
22
22
  { name = "loguru" },
File without changes
File without changes
File without changes