Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ jobs:
# the terminal tests drive bash, zsh and pwsh on a pseudo-terminal; the runner has no zsh
- run: sudo apt-get install -y -qq zsh
- run: uv run --with pytest pytest -q
- name: Fresh resolve CLI smoke check
run: |
tmp=$(mktemp -d)
mkdir -p "$tmp/term"
printf '{"command":"echo ok","output":"ok","exit_code":0,"cwd":".","started_at":"2026-01-01T00:00:00+00:00"}\n' > "$tmp/term/history.jsonl"
CODIGEST_HOME="$tmp" uv run --python 3.15 --no-project --with . cdg --version
CODIGEST_HOME="$tmp" uv run --python 3.15 --no-project --with . cdg term --list

powershell-help:
runs-on: windows-latest
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ authors:
repository-code: "https://github.com/NaNIsaac/codigest"
url: "https://pypi.org/project/codigest/"
license: MIT
version: 0.14.0
version: 0.14.1
date-released: "2026-10-22"
keywords:
- LLM
Expand Down
9 changes: 4 additions & 5 deletions docs/cli_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from dataclasses import dataclass
from pathlib import Path

import click
import typer

from codigest.main import app
Expand Down Expand Up @@ -132,19 +131,19 @@ def python_build() -> dict[str, dict]:
"""Command path -> {"hidden": bool, "options": [Option]}, hidden commands included."""
found: dict[str, dict] = {}

def walk(command: click.Command, path: list[str], hidden: bool) -> None:
def walk(command: object, path: list[str], hidden: bool) -> None:
options = []
for param in command.params:
if not isinstance(param, click.Option):
if getattr(param, "param_type_name", None) != "option":
continue
# A --flag/--no-flag pair is two options, as the Rust build defines it.
for names in (param.opts, param.secondary_opts):
names = [n for n in names if n not in IGNORED]
if names:
options.append(_option(names, param.hidden))
found[" ".join(path)] = {"hidden": hidden, "options": options}
if isinstance(command, click.Group):
for name, sub in command.commands.items():
if (subcommands := getattr(command, "commands", None)) is not None:
for name, sub in subcommands.items():
walk(sub, [*path, name], hidden or sub.hidden)

walk(typer.main.get_command(app), [], False)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "codigest"
version = "0.14.0"
version = "0.14.1"
description = "Human-Centered Codebase Context Manager for LLMs"
authors = [{ name = "Isaac Yong", email = "isaacyong@naver.com" }]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "codigest"
version = "0.14.0"
version = "0.14.1"
edition = "2024"
rust-version = "1.88"
description = "Share the code context you choose with an AI: the project, a few files, what changed, or a failing command."
Expand Down
6 changes: 3 additions & 3 deletions rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Binaries are attached to the GitHub releases tagged `rust-v*`: Windows x64, Linu
To install by hand, Windows (PowerShell):

```powershell
$v = "0.14.0"; $t = "x86_64-pc-windows-msvc"
$v = "0.14.1"; $t = "x86_64-pc-windows-msvc"
Invoke-WebRequest "https://github.com/NaNIsaac/codigest/releases/download/rust-v$v/codigest-$v-$t.zip" -OutFile codigest.zip
Expand-Archive codigest.zip "$env:LOCALAPPDATA\Programs" -Force
# then add $env:LOCALAPPDATA\Programs\codigest-$v-$t to PATH
Expand All @@ -39,12 +39,12 @@ Expand-Archive codigest.zip "$env:LOCALAPPDATA\Programs" -Force
Linux, macOS and Termux (`x86_64-unknown-linux-musl`, `aarch64-unknown-linux-musl`, `x86_64-apple-darwin`, `aarch64-apple-darwin` or `aarch64-linux-android`):

```bash
v=0.14.0; t=x86_64-unknown-linux-musl
v=0.14.1; t=x86_64-unknown-linux-musl
curl -L "https://github.com/NaNIsaac/codigest/releases/download/rust-v$v/codigest-$v-$t.tar.gz" | tar xz
install "codigest-$v-$t/cdg" ~/.local/bin/
```

With the GitHub CLI: `gh release download rust-v0.14.0 -R NaNIsaac/codigest -p '*windows*'`.
With the GitHub CLI: `gh release download rust-v0.14.1 -R NaNIsaac/codigest -p '*windows*'`.

## Build

Expand Down
4 changes: 2 additions & 2 deletions server.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"url": "https://github.com/NaNIsaac/codigest",
"source": "github"
},
"version": "0.14.0",
"version": "0.14.1",
"packages": [
{
"registryType": "pypi",
"identifier": "codigest",
"version": "0.14.0",
"version": "0.14.1",
"runtimeHint": "uvx",
"transport": {
"type": "stdio"
Expand Down
6 changes: 3 additions & 3 deletions site/ko/rust-port.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ curl -fsSL https://raw.githubusercontent.com/NaNIsaac/codigest/main/install.sh |
Windows (PowerShell):

```powershell
$v = "0.14.0"; $t = "x86_64-pc-windows-msvc"
$v = "0.14.1"; $t = "x86_64-pc-windows-msvc"
Invoke-WebRequest "https://github.com/NaNIsaac/codigest/releases/download/rust-v$v/codigest-$v-$t.zip" -OutFile codigest.zip
Expand-Archive codigest.zip "$env:LOCALAPPDATA\Programs" -Force
# 그다음 $env:LOCALAPPDATA\Programs\codigest-$v-$t 를 PATH에 추가
Expand All @@ -40,12 +40,12 @@ Expand-Archive codigest.zip "$env:LOCALAPPDATA\Programs" -Force
Linux, macOS, Termux (`x86_64-unknown-linux-musl`, `aarch64-unknown-linux-musl`, `x86_64-apple-darwin`, `aarch64-apple-darwin`, `aarch64-linux-android` 중 하나):

```bash
v=0.14.0; t=x86_64-unknown-linux-musl
v=0.14.1; t=x86_64-unknown-linux-musl
curl -L "https://github.com/NaNIsaac/codigest/releases/download/rust-v$v/codigest-$v-$t.tar.gz" | tar xz
install "codigest-$v-$t/cdg" ~/.local/bin/
```

GitHub CLI로는 `gh release download rust-v0.14.0 -R NaNIsaac/codigest -p '*windows*'`.
GitHub CLI로는 `gh release download rust-v0.14.1 -R NaNIsaac/codigest -p '*windows*'`.

## 빌드

Expand Down
6 changes: 3 additions & 3 deletions site/rust-port.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ To install by hand instead, download an archive.
Windows (PowerShell):

```powershell
$v = "0.14.0"; $t = "x86_64-pc-windows-msvc"
$v = "0.14.1"; $t = "x86_64-pc-windows-msvc"
Invoke-WebRequest "https://github.com/NaNIsaac/codigest/releases/download/rust-v$v/codigest-$v-$t.zip" -OutFile codigest.zip
Expand-Archive codigest.zip "$env:LOCALAPPDATA\Programs" -Force
# then add $env:LOCALAPPDATA\Programs\codigest-$v-$t to PATH
Expand All @@ -40,12 +40,12 @@ Expand-Archive codigest.zip "$env:LOCALAPPDATA\Programs" -Force
Linux, macOS and Termux (`x86_64-unknown-linux-musl`, `aarch64-unknown-linux-musl`, `x86_64-apple-darwin`, `aarch64-apple-darwin` or `aarch64-linux-android`):

```bash
v=0.14.0; t=x86_64-unknown-linux-musl
v=0.14.1; t=x86_64-unknown-linux-musl
curl -L "https://github.com/NaNIsaac/codigest/releases/download/rust-v$v/codigest-$v-$t.tar.gz" | tar xz
install "codigest-$v-$t/cdg" ~/.local/bin/
```

With the GitHub CLI: `gh release download rust-v0.14.0 -R NaNIsaac/codigest -p '*windows*'`.
With the GitHub CLI: `gh release download rust-v0.14.1 -R NaNIsaac/codigest -p '*windows*'`.

## Build

Expand Down
9 changes: 4 additions & 5 deletions site/scripts/check_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import sys
from pathlib import Path

import click
import typer

from codigest.main import app
Expand All @@ -38,15 +37,15 @@ def cli_options() -> dict[str, set[str]]:
"""Every command path (hidden ones included) mapped to its option names."""
found: dict[str, set[str]] = {}

def walk(command: click.Command, path: list[str]) -> None:
if isinstance(command, click.Group):
for name, sub in command.commands.items():
def walk(command: object, path: list[str]) -> None:
if (subcommands := getattr(command, "commands", None)) is not None:
for name, sub in subcommands.items():
walk(sub, [*path, name])
if path:
names = {
n
for p in command.params
if isinstance(p, click.Option)
if getattr(p, "param_type_name", None) == "option"
for n in (*p.opts, *p.secondary_opts)
}
found[" ".join(path)] = names - IGNORED
Expand Down
5 changes: 3 additions & 2 deletions src/codigest/commands/term.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from typing import Annotated

import typer
from click.core import ParameterSource
from rich.console import Console
from rich.markup import escape

Expand Down Expand Up @@ -162,7 +161,9 @@ def handle(

# --list without -n shows everything that matches; -n still narrows it.
list_all = (
list_mode and index is None and ctx.get_parameter_source("count") is ParameterSource.DEFAULT
list_mode
and index is None
and getattr(ctx.get_parameter_source("count"), "name", None) == "DEFAULT"
)

# -i N needs N entries loaded so the Nth-from-last exists; a range needs `hi`.
Expand Down
19 changes: 19 additions & 0 deletions tests/test_term_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,22 @@ def test_list_format_json_outputs_rows_and_supports_ranges(tmp_path, monkeypatch
{"index": 2, "time": "09:02", "exit_code": 0, "cwd": "/c", "command": "cmd3"},
]
assert copied == []


def test_list_without_n_shows_everything(tmp_path, monkeypatch):
_seed(
tmp_path,
monkeypatch,
[
("cmd1", 0, "/a"),
("cmd2", 1, "/b"),
("cmd3", 0, "/c"),
("cmd4", 2, "/d"),
],
)

res = CliRunner().invoke(term.app, ["--list"])

assert res.exit_code == 0, res.output
for cmd in ("cmd1", "cmd2", "cmd3", "cmd4"):
assert cmd in res.output
Loading
Loading