Learn from Any CLI: Two‑Keystroke Feedback (Ctrl+g)

Learn from Any CLI: Two‑Keystroke Feedback (Ctrl+g)

With two keystrokes you turn everyday corrections into continuous learning for GPTCode.

How it works

  • Press Ctrl+g to mark the suggestion on the terminal line
  • Edit and press Enter
  • The hook automatically records:
    • Sentiment: good (same) or bad (different)
    • wrong_response e correct_response
    • files changed (git diff –name-only)
    • diff_path with the full patch (optional)

Installation

# zsh (with diff)
gptcode feedback hook install --with-diff --and-source
# bash
gptcode feedback hook install --shell=bash --with-diff --and-source
# fish
gptcode feedback hook install --shell=fish --with-diff

See it in action

Keyboard flow (Ctrl+g → run)

Two‑keystroke feedback (hook path)

Programmatic flow (CLI submit)

Two‑keystroke feedback demo

How it’s used for training

# Convert feedback JSON to training examples
python3 ml/intent/scripts/process_feedback.py

# Retrain the intent model (feedback weighted)
gptcode ml train intent

For UIs/CLIs

No API integration required. Let users press Ctrl+g before running.

Advanced

  • Manual/programmatic submissions: gptcode feedback submit --json -
  • Attach files: --files path --files another
  • Capture patch: --capture-diff (saved under ~/.gptcode/diffs/*.patch)

References