Scripts for integrating GitHub context and repository management into AI agent workflows.
Generates comprehensive GitHub context for AI agent conversations, reducing the need for manual tool calls during autonomous operation.
Features:
- GitHub notifications (unread, with type and reason)
- Open issues in agent workspace repository
- Multi-repository CI status checking
- Open PRs across all repositories
- Recent PRs in current repository
Usage:
./scripts/github/context-gh.shRequirements:
gh(GitHub CLI) installed and authenticated- Repository list configured in repo-status.sh
Output:
Markdown-formatted sections that can be included in agent context via gptme.toml's context_cmd.
Check CI status across multiple repositories to catch failing builds before pushing changes.
Features:
- Quick status check for multiple repos
- Color-coded output (✓ passing, ✗ failing, ⚠ other states)
- Workflow URL display for failing builds
- Configurable repository list
Usage:
./scripts/github/repo-status.shConfiguration:
Pass repositories as arguments (format: owner/repo:Label or just owner/repo):
./scripts/github/repo-status.sh gptme/gptme:gptme gptme/gptme-rag:gptme-ragOr set GH_USER environment variable to customize user for PR checking:
export GH_USER=myusername
./scripts/github/repo-status.shDefault behavior (no arguments): Checks gptme ecosystem repos.
Requirements:
gh(GitHub CLI) installed and authenticated
These scripts are designed to be integrated into gptme agent workflows:
-
Dynamic Context: Include context-gh.sh in your agent's main context.sh script:
# In your agent's scripts/context.sh ./gptme-contrib/scripts/github/context-gh.shOr use directly in gptme.toml (less common):
context_cmd = "gptme-contrib/scripts/github/context-gh.sh"
-
Pre-Push Checks: Run repo-status.sh before pushing to ensure CI health:
./scripts/github/repo-status.sh && git push -
Autonomous Operations: Include GitHub context automatically in agent prompts to reduce exploratory tool calls.
- Reduced Tool Calls: GitHub context is served upfront instead of requiring multiple API calls
- Faster Decision Making: Agent can see notifications, issues, and CI status immediately
- Better Coordination: Agent aware of open issues and PRs without manual checking
- CI Health Awareness: Catch failing builds before adding more changes
- gptme - The AI agent framework these scripts support
- gptme-agent-template - Template for creating new agents