Setup AI Provider prepares AI coding agent CLIs for GitHub Actions by installing the selected provider, configuring authentication, and optionally uploading raw session files after your workflow steps run.
I wanted AI coding agents in CI across many repositories without duplicating setup everywhere. This action keeps provider setup centralized and easy to switch.
- One CI setup flow for Claude Code, Codex, and Gemini.
- Provider switching through one workflow input.
- Optional additional consumers, like configuring Pi from Codex auth.
- Optional post-step session upload for debugging or formatting with tools like Pretty Session.
After this action runs, use the provider CLI in the next workflow steps however you want.
claude setup-token
gh secret set CLAUDE_CODE_OAUTH_TOKEN -b '<token>'- uses: lucasvtiradentes/setup-ai-provider@v0.2.0
with:
provider: claude
claude-code-oauth-token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
upload-session-files: 'true' # optional
- run: claude -p "review this pull request" --print --dangerously-skip-permissionsShow setup
gh secret set CODEX_AUTH_JSON < ~/.codex/auth.json- uses: lucasvtiradentes/setup-ai-provider@v0.2.0
with:
provider: codex
codex-auth-json: ${{ secrets.CODEX_AUTH_JSON }}
additional-consumers: pi # optional: also configure ~/.pi/agent/auth.json
upload-session-files: 'true' # optional
- run: codex exec "review this pull request" --json --dangerously-bypass-approvals-and-sandboxShow setup
npm install -g @google/gemini-cli
gh secret set GEMINI_CREDENTIALS < ~/.gemini/oauth_creds.json- uses: lucasvtiradentes/setup-ai-provider@v0.2.0
with:
provider: gemini
gemini-auth-json: ${{ secrets.GEMINI_CREDENTIALS }}
upload-session-files: 'true' # optional
- run: gemini -p "review this pull request" --yoloThe action also marks the CI workspace as trusted for Gemini CLI runs.
| Group | Input | Description |
|---|---|---|
| Auth | provider |
Provider to setup: claude, codex, or gemini. |
additional-consumers |
Comma-separated extra tools to configure from the selected provider auth. Currently supports pi with provider: codex. |
|
claude-code-oauth-token |
Claude Code OAuth token. | |
codex-auth-json |
Content for ~/.codex/auth.json. |
|
gemini-auth-json |
Content for ~/.gemini/oauth_creds.json. |
|
| Session | session-files-path |
Temporary path used during post-step session upload. Default: provider-session-files. |
upload-session-files |
Upload collected session files as an artifact. Default: false. |
|
artifact-name |
Artifact name. Default: <provider>-session-files. |
|
retention-days |
Artifact retention days. Default: 7. |
