Overview
The/install-gh-app command provides a guided workflow for installing the Factory GitHub App and configuring GitHub Actions workflows. This enables Droid to respond to @droid mentions in issues and PR comments, and optionally provide automated code reviews on new pull requests.
When you run /install-gh-app, droid guides you through verifying prerequisites, selecting a repository, installing the GitHub App, and creating workflow files via a pull request.
Quick start
1
Start the installation flow
In an interactive droid session, type:
2
Pass preflight checks
Droid verifies that you have:
- GitHub CLI (
gh) installed - Authenticated with GitHub (
gh auth login) - Required OAuth scopes (
repo,read:org)
3
Select a repository
Choose from two options:
- Use current repository - Auto-detected from your git remote
- Enter a different repository - Type
owner/repoor a GitHub URL
4
Install the GitHub App
Your browser opens to install the Factory Droid GitHub App. Grant access to the selected repository.
5
Select workflows
Choose which workflows to enable:
- @Droid - Respond to @droid mentions in issues and PR comments
- Droid Review - Automated code review on new PRs
6
Create the PR
Droid creates a branch with workflow files and opens a pull request for you to review and merge.
Prerequisites
Before running/install-gh-app, ensure you have the GitHub CLI installed and authenticated.
Install GitHub CLI
- macOS (Homebrew)
- macOS (MacPorts)
- Linux/WSL
- Windows
Authenticate with GitHub
Verify required scopes
The CLI needsrepo and read:org scopes. If missing, refresh your authentication:
Available workflows
@Droid workflow
Enables Droid to respond when you tag@droid in:
- Issue comments
- Pull request comments
- Pull request reviews
- Issue descriptions and titles
issue_comment- When a comment contains @droidpull_request_review_comment- When a PR review comment contains @droidpull_request_review- When a PR review body contains @droidissues- When an issue body or title contains @droid
- Ask Droid to implement features described in issues
- Request code changes in PR comments
- Get help understanding code in reviews
Droid Review workflow
Provides automated code review on new pull requests. Triggers:pull_request- When a PR is opened, reopened, or marked ready for review
- Automatic first-pass review on all PRs
- Catch common issues before human review
- Consistent review coverage across the team
Setup steps after installation
After the/install-gh-app workflow completes, you need to:
1
Review the pull request
A PR has been created in your repository with the workflow files. Review the changes.
2
Generate a Factory API key
Go to https://app.factory.ai/settings/api-keys and create a new API key.
3
Add the secret to GitHub
In your repository settings, go to Settings > Secrets and variables > Actions and add a new repository secret:
- Name:
FACTORY_API_KEY - Value: Your generated API key
4
Merge the PR
Once the secret is configured, merge the workflow PR to enable Droid.
Permissions
Repository admin permissions
For the smoothest setup, you should have admin access to the repository. If you don’t have admin permissions, you’ll see a warning but can still proceed. You may need a repository admin to:- Approve the GitHub App installation
- Add the
FACTORY_API_KEYsecret - Merge the workflow PR
GitHub App permissions
The Factory Droid GitHub App requires these permissions:- Contents: Read and write (to push workflow files and make code changes)
- Pull requests: Read and write (to create PRs and post reviews)
- Issues: Read and write (to respond to issue comments)
- Actions: Read (to monitor workflow runs)
Tips and best practices
Which workflows should I enable?
Which workflows should I enable?
- Start with @Droid only if you want manual control over when Droid participates
- Enable both for full automation with code review on every PR
- Droid Review alone if you only want automated reviews without @droid mentions
Troubleshooting preflight failures
Troubleshooting preflight failures
| Error | Solution |
|---|---|
| GitHub CLI not installed | Install gh using the commands above |
| Not logged in | Run gh auth login |
| Missing permissions | Run gh auth refresh -s repo,read:org |
| API access error | Check your internet connection and run gh auth status |
Navigating the setup UI
Navigating the setup UI
Multiple repositories
Multiple repositories
Run
/install-gh-app separately for each repository you want to configure. The flow automatically detects the current repository from your git remote.Example workflow
See also
- GitHub Actions setup guide - Manual setup instructions
- Factory GitHub App - Direct link to install the app
- API keys - Generate your Factory API key
- Code Review - Local code review with
/reviewcommand - Droid Exec GitHub Actions - More GitHub Actions automation examples
