GitHub Integration

Cortex provides deep GitHub integration for managing pull requests, issues, and repositories directly from the CLI, with agent-powered automation for code review and project management.

Architecture

┌──────────────────────────────────────────────────────────┐
│                  GitHub Integration                        │
│                                                           │
│  CLI (cortex github) ──► github-cmd.ts ──► GitHub API     │
│                              │                            │
│                              ▼                            │
│                     Subsystem Integration                  │
│           (Vault for tokens, Agent for reviews,            │
│            Git workspace for branch/repo context)         │
└──────────────────────────────────────────────────────────┘

Subcommand Tree

Pull Requests

CommandDescription
pr listList pull requests (filterable by state, limit)
pr getGet pull request details
pr createCreate a pull request (with draft and body options)
pr mergeMerge a pull request (merge, squash, rebase)
pr closeClose a pull request

Issues

CommandDescription
issue listList issues (filterable by state, labels, limit)
issue createCreate an issue (with body, labels, assignees)
issue closeClose an issue

Repositories

CommandDescription
repo listList repositories (filterable by type, limit)
repo getGet repository details
repo branchesList branches in a repository

Authentication

GitHub tokens are stored encrypted in the Cortex vault (AES-256-GCM). Required scopes:

  • repo — Repository access
  • read:org — Organization membership
  • issues:read/write — Issue management

Agent Integration

GitHub commands can trigger agent workflows:

  • PR Creation: Agent generates PR title and description from branch diff
  • Code Review: Agent reviews PRs and submits inline comments
  • Issue Triage: Agent categorizes and labels incoming issues
  • Release Notes: Agent generates release notes from merged PRs

See also: Git Workspace, Workflow Engine