Skip to content

Add JSON output mode#65

Open
sato820 wants to merge 1 commit into
promptpolish-ai:mainfrom
sato820:codex/add-json-output-2
Open

Add JSON output mode#65
sato820 wants to merge 1 commit into
promptpolish-ai:mainfrom
sato820:codex/add-json-output-2

Conversation

@sato820

@sato820 sato820 commented Jun 25, 2026

Copy link
Copy Markdown

Fixes #2.

Adds a machine-readable --json output mode for git-context while preserving the existing Markdown output.

What changed:

  • Adds --json to both the standalone git-context script and the installed package entry point.
  • Emits structured repo data: repo/path, git info, working tree state, commits, branches, project structure, and optional file contents.
  • Keeps --output working in JSON mode and writes files as UTF-8.
  • Configures CLI stdout as UTF-8 so JSON/Markdown output with tree characters works reliably on Windows terminals too.
  • Documents the new --json usage in the README.

Verified locally:

  • python git-context --dir . --json parses as valid JSON.
  • package entry point via git_context.main() parses as valid JSON.
  • python git-context --dir . --depth 1 still produces Markdown output.
  • python git-context --dir . --json -o <file> writes valid JSON.

Bounty payout: BTC on-chain bc1q4zlvgnskuxmrnywk2y8klcdjf4zmkjau0e5srm. I can also provide a fresh Lightning invoice on acceptance if that is easier for the $2 payout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add --json output mode (Bounty: $2 crypto)

1 participant