Skip to content

Add agent-aware help text and --list-labels flag#51

Merged
jehiah merged 1 commit into
masterfrom
agent_instructions_51
May 7, 2026
Merged

Add agent-aware help text and --list-labels flag#51
jehiah merged 1 commit into
masterfrom
agent_instructions_51

Conversation

@jehiah

@jehiah jehiah commented May 4, 2026

Copy link
Copy Markdown
Owner

Improves the CLI experience for AI agents and users by expanding --help output, better describe missing settings, and adding a --list-labels flag. auto-detection for main vs master is also included to simplify use.

An embedded skill file is also provided for more complete guidance.

Changes:

  • --help now always shows a summary of what git-open-pull does and which account/repo/branch code will be pushed to (loaded from settings before flag parsing)
  • When running as an AI agent (agentdetection.IsAgent()), --help also shows a hint to run --list-labels first before passing --labels
  • New --list-labels flag lists all repository labels and exits, reusing the existing Labels() helper
  • new --skill flag lists an agent SKILL file.
  • Default to --draft=true for non-interactive calls.

Adds github.com/jehiah/agentdetection as a direct dependency.

@jehiah jehiah self-assigned this May 4, 2026
@jehiah jehiah added the feature label May 4, 2026
@jehiah jehiah requested a review from Copilot May 7, 2026 18:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves git-open-pull’s CLI ergonomics by making --help more informative (including agent-aware hints), adding discovery/agent-support flags, and reducing configuration friction via better defaults and environment-variable support.

Changes:

  • Add agent-aware --help output plus an embedded --skill document (from SKILL.md).
  • Add --list-labels to enumerate repo labels, and default --draft to true (especially for non-interactive usage).
  • Improve settings loading: support GITHUB_TOKEN, infer default base repo from remotes, and auto-detect main vs master.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
SKILL.md Adds an embedded skill doc intended for agent guidance and consistent CLI usage.
settings.go Adds non-interactive settings loading, GITHUB_TOKEN support, base repo inference, and base branch auto-detection.
README.md Updates environment-variable documentation (but needs formatting correction).
git-open-pull.go Implements new flags/help output, integrates settings pre-load for --help, and changes draft defaults/flow.
go.mod Adds agentdetection dependency and bumps Go toolchain version.
go.sum Adds checksums for the new dependency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md
Comment thread settings.go
Comment thread git-open-pull.go Outdated
Comment thread git-open-pull.go Outdated
Comment thread git-open-pull.go
Comment thread git-open-pull.go
Comment thread go.mod Outdated
Comment thread settings.go
Comment thread git-open-pull.go
Comment on lines +159 to +167
if *listLabels {
labels, err := Labels(ctx, client, settings)
if err != nil {
log.Fatal(err)
}
for _, label := range labels {
fmt.Println(label)
}
return
@jehiah jehiah force-pushed the agent_instructions_51 branch from f7d2ce0 to 7a7e1da Compare May 7, 2026 19:05
@jehiah jehiah merged commit 89d3b5a into master May 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants