Adds a precedence chain for where .contextzip/ is created:
env var (CONTEXTZIP_WORKSPACE_LOCATION) > project config
(.contextzip.json, git-committed, team-shared) > personal config
(per-machine, contextzip config --set-workspace) > default
(git-root, unchanged behavior).
Also fixes a latent bug this surfaced: .gitignore registration
derived git_root as workspace.parent, which only held true when
the workspace was always directly under git root. Now derives it
independently via _find_git_root and only registers .gitignore
when the workspace is actually inside the repo.
New: project_config.py (loads .contextzip.json), config.py
get/save/delete_workspace_location, cli.py --set-workspace/
--reset-workspace on `contextzip config`.
Detection previously only checked project_dir itself, so a monorepo
like root/frontend/package.json + root/backend/requirements.txt
detected nothing and fell through to only the universal base
exclusion rules — leaving node_modules/, .venv/, etc. unexcluded
except by whatever .gitignore happened to catch.
Now scans project_dir plus a shallow, bounded subdirectory tree
(depth 2), skipping dependency/build dirs (node_modules, .venv,
.git, etc.) so it never walks into a large dependency tree. Runs
unconditionally, not just when root comes up empty, since a
root-level marker doesn't imply there's nothing else to find in
sibling directories.
DetectionResult now tracks which subdirectory each ecosystem was
found in (`sources`), surfaced in the CLI panel, e.g.
"Next.js (frontend/) + FastAPI (backend/)".
fix: revert version to 0.3.0 and update __all__ exports in __init__.py
feat: implement create_zip_silent for silent ZIP creation without console output
Adds Terminal error watcher section covering the full flow, ZIP contents
table, Ctrl+C fallback, supported frameworks, and PTY/Windows note.
Updates features list and subcommands reference.
Adds `contextzip watch -- COMMAND [ARGS]` to the CLI group.
Runs ecosystem detection, prints the Windows PTY warning where relevant,
and delegates to watcher.run_watch().
cli.py was 1,100+ lines. Extracted with no behaviour changes:
- cli_display.py — all Rich rendering helpers
- cli_ai.py — AI selection orchestration + normalize_pattern
- cli_onboard.py — Gemini API key onboarding flow
cli.py retains only Click routing and _run().
Spawns child process via subprocess.Popen, buffers output across two
daemon reader threads, detects errors via polling, and renders the D/S
prompt using termios raw mode (Unix) / msvcrt (Windows).
Writes debug-context.zip flat: prompt.txt, terminal-error.txt, source-files.zip.
Handles the full pipeline: ANSI stripping, error block detection,
stack trace path extraction, noise removal, and prompt.txt generation.
Searches backward through the buffer to always find the most recent error.
Add contextzip/rules/errors/ with python.py and node.py.
Each file exports ERROR_START_PATTERNS, PATH_PATTERNS, and NOISE_PATTERNS
covering Python/Django/FastAPI and Node.js/Next.js/React respectively.
- Documents --prompt flag, AI file selection, first-run onboarding
- Adds config subcommand to usage table and examples
- Adds httpx to dependencies in pyproject.toml
- Updates project structure to include ai/ package
- New --prompt/-p flag available on all commands and subcommands
- First-run onboarding flow guides user to Google AI Studio for a free key
- New config subcommand: contextzip config --reset-key / --show-key-path
- Shows AI-selected files in a panel before packaging
- Heuristic fallback warns user clearly when Gemini was rate limited
Saves the Gemini API key to ~/.config/contextzip/config.json on Linux/macOS
and %APPDATA%\contextzip\config.json on Windows. Validates keys must start
with AIza before use. Includes diagnose_api_key() for surfacing bad keys early.
Introduces the ai/ package with three modules:
- gemini.py: thin httpx client for Gemini 2.5 Flash Lite API
- heuristic.py: keyword-based file scorer (fallback on rate limit)
- selector.py: orchestrator that builds the project map and coordinates selection