feat!: GUI-only approval, repo slug display, version 0.2.0#6
Conversation
Display the full owner/repo (e.g. lklimek/ghsudo) instead of just the organization name in GUI and terminal approval prompts when the repo can be detected from -R/--repo args or the git origin remote. Refactors org detection to build on new repo-slug helpers, adds 27 tests for slug/org detection and approval message formatting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
BREAKING: Remove --no-gui / terminal fallback — a terminal prompt is trivially auto-approvable by an AI agent, defeating ghsudo's purpose. A graphical display (DISPLAY/WAYLAND_DISPLAY) is now required. Also display the full owner/repo slug (e.g. lklimek/ghsudo) instead of just the organization name when the repo can be detected from -R/--repo args or the git origin remote. Bump version to 0.2.0. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use importlib.metadata.version() in __init__.py so the version is defined only in pyproject.toml. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates ghsudo to require GUI-based approvals (removing terminal fallback), improves context shown in approval dialogs by detecting and displaying the full owner/repo slug, and consolidates versioning to a single source in pyproject.toml.
Changes:
- Add repo slug detection (from
-R/--repoargs orgit origin) and display it in approval prompts. - Remove terminal approval fallback and require a graphical display (exit code 3 if unavailable).
- Move version to
pyproject.tomlonly and read it at runtime viaimportlib.metadata; add tests and docs updates.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_detection.py | Adds tests for repo/org detection and approval message formatting. |
| src/ghsudo/main.py | Implements repo slug detection, updates GUI approval messaging, and removes terminal fallback. |
| src/ghsudo/init.py | Switches __version__ to be read from package metadata. |
| pyproject.toml | Bumps project version to 0.2.0. |
| README.md | Updates docs for GUI-only behavior, exit codes, and platform support notes. |
| CLAUDE.md | Adds developer/release guide and documents versioning + GUI-only rationale. |
Comments suppressed due to low confidence (1)
tests/test_detection.py:9
pytestis imported but never used in this test module. Removing the unused import will avoid lint noise (and keeps the tests module minimal).
import pytest
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Agent instruction files tell agents to remind the user (not run it themselves) since gh auth setup-git modifies global git config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Escape repo/org values in PowerShell dialog string to prevent injection via malformed repo names - Differentiate error messages: "no display" vs "no GUI toolkit found" with actionable remediation (install xmessage/zenity/kdialog) - Handle PackageNotFoundError gracefully in __init__.py for uninstalled source checkouts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Drop TestDetectOrg (5 tests) — thin wrappers retesting slug functions through a trivial split. Drop test_http_url — same regex path as test_https_url. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Timeout now auto-denies (exit 2) instead of returning "no GUI" (exit 3). _run_gui returns 1 on timeout, distinguishing it from tool-not-found (None). - Clarify HTTPS requirement: needed for git push/pull via gh credential helper, not for ghsudo gh commands themselves. - Update exit code 3 descriptions to cover both no-display and no-toolkit. - Remove stale "terminal prompt" mention from README. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/ghsudo/main.py:434
- The comment on this branch says
rc is Nonemeans "not installed or timed out", but_run_guinow returns1on timeout (andNoneonly when the tool is missing). Update the comment to avoid misleading future changes/debugging.
if rc is None:
return None # not installed or timed out
return rc == 0
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Reject malformed slugs like "org/", "/repo", "a/b/c" in _detect_repo_slug_from_args via new _parse_repo_slug helper. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
owner/repo(e.g.lklimek/ghsudo) instead of just the org name, when detectable from-R/--repoargs or git origin remote--no-gui/ terminal fallback — terminal prompts are trivially auto-approvable by AI agents, defeating ghsudo's purpose. A graphical display is now required (exit code 3 if unavailable)pyproject.toml, read at runtime viaimportlib.metadatassh -Xtip, updated exit code docsBreaking changes
--no-guiflag removedTest plan
pytest tests/ -v)importlib.metadata.version()reads 0.2.0 correctly🤖 Generated with Claude Code
🤖 Co-authored by Claudius the Magnificent AI Agent