feat: add GitHub CLI + token auth to agents#9
Merged
Conversation
- Install gh via official apt repo in cloud-init (system-level) - Add githubToken prop to CloudInitConfig and OpenClawAgentArgs - Add GITHUB_TOKEN env var interpolation in cloud-init - Authenticate gh as ubuntu user when token provided - Add optional GitHub token prompt in CLI init (validates ghp_/github_pat_) - Store token as secret via setConfig - Add gh version and auth status checks in validate command - Add gh version and auth columns in status command - Add per-agent GitHub token entries to ESC secrets example Linear-Issue: AGE-19
Contributor
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThe pull request adds GitHub CLI integration across the CLI, configuration management, and agent deployment systems. Users can now optionally configure per-agent GitHub tokens during setup, which are validated, stored in configuration, and provisioned into agents via cloud-init with automated GitHub CLI installation and authentication. Changes
Sequence DiagramsequenceDiagram
participant User
participant CLI as CLI Init
participant Config as Config Store
participant Deployment as Pulumi Deployment
participant CloudInit as Cloud-Init
participant Agent as Agent VM
User->>CLI: Run init command
CLI->>User: Prompt for GitHub token (optional)
User-->>CLI: Provide token
CLI->>Config: Store githubToken in config
Config-->>CLI: Token persisted
Deployment->>Config: Retrieve githubToken by role
Config-->>Deployment: Return role-specific token
Deployment->>CloudInit: Pass githubToken to cloud-init config
CloudInit->>CloudInit: Generate GitHub CLI install script
CloudInit->>CloudInit: Generate GitHub CLI auth script (if token provided)
CloudInit->>Agent: Execute cloud-init user data
Agent->>Agent: Install GitHub CLI
Agent->>Agent: Authenticate with token (gh auth login)
Agent->>Agent: Export GITHUB_TOKEN environment variable
Agent-->>User: Agent ready with GitHub access
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
This was referenced Feb 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add GitHub CLI installation and optional token-based authentication to agent provisioning.
Changes
src/components/cloud-init.tsghvia official apt repo (system-level)githubToken?: stringtoCloudInitConfiginterfaceGITHUB_TOKENinterpolation to env varsecho "$GITHUB_TOKEN" | gh auth login --with-token && gh auth setup-gitsrc/components/openclaw-agent.tsgithubToken?: pulumi.Input<string>toOpenClawAgentArgsCloudInitConfigcli/commands/init.tsghp_orgithub_pat_(or empty to skip)setConfig()cli/commands/validate.tsgh --versiongh auth status(if gh installed)cli/commands/status.tsesc/agent-army-secrets.yaml.exampleDefinition of Done
gh --versionsucceeds on provisioned instancegh auth statusshows authenticated when token providedtsc --noEmitpasses (typecheck)Linear-Issue: AGE-19
Summary by CodeRabbit