Skip to content

feat(cli): add /install-github-app for gh CLI setup#181

Merged
emal-avala merged 1 commit intomainfrom
feat/cmd-install-github-app
Apr 23, 2026
Merged

feat(cli): add /install-github-app for gh CLI setup#181
emal-avala merged 1 commit intomainfrom
feat/cmd-install-github-app

Conversation

@emal-avala
Copy link
Copy Markdown
Member

Summary

Adds /install-github-app (alias /gh-setup) — walks the user through gh CLI installation, auth, scopes, and remote verification for the PR-related commands (/pr-comments, /autofix-pr, /issue).

Checks performed:

  1. gh --version — is it installed?
  2. gh auth status — logged in?
  3. Scope check — has repo, read:org, workflow?
  4. gh repo view — does cwd have a GitHub remote?
  5. One-line summary with the exact next action

Guardrails in the prompt:

  • never install gh silently (point to docs, user runs it)
  • never run gh auth login for the user (needs a TTY the agent doesn't own)
  • never store / display / exfiltrate tokens
  • refuse requests to write tokens to a file

Why

Running /pr-comments or /autofix-pr without gh set up correctly is the most common first-run failure — and the error messages from gh aren't great at saying which scope is missing. This does the diagnosis in one invocation.

Test plan

  • cargo fmt --all clean
  • cargo check passes
  • cargo clippy --no-deps clean
  • Manual on a fresh machine: /install-github-app → reports 'gh not installed', points to install docs
  • Manual with partial scopes: reports 'needs scope refresh', prints gh auth refresh command

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@emal-avala emal-avala force-pushed the feat/cmd-install-github-app branch 4 times, most recently from 0c59034 to 5c8ed26 Compare April 23, 2026 04:11
Interactive walkthrough that checks gh install status, auth state,
required scopes (repo / read:org / workflow), and whether the current
directory has a GitHub remote. Surfaces a one-line summary with the
next action the user must take.

Rules baked in:
- never install gh silently — point to instructions, user runs it
- interactive login needs a TTY the agent doesn't own — instruct the
  user to run `gh auth login` themselves
- never store tokens in this process
- never exfiltrate `gh auth token` output
- refuse if asked to write the token to a file

Alias /gh-setup for people who don't remember the full command.
@emal-avala emal-avala force-pushed the feat/cmd-install-github-app branch from 5c8ed26 to 7302820 Compare April 23, 2026 04:20
@emal-avala emal-avala merged commit d7ab16e into main Apr 23, 2026
14 checks passed
@emal-avala emal-avala deleted the feat/cmd-install-github-app branch April 23, 2026 04:24
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.

1 participant