Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Setup AI Provider

OverviewMotivationFeaturesSetupInputsLicense

🎺 Overview

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.

❓ Motivation

I wanted AI coding agents in CI across many repositories without duplicating setup everywhere. This action keeps provider setup centralized and easy to switch.

⭐ Features

  • 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.

🚀 Setup

After this action runs, use the provider CLI in the next workflow steps however you want.

Claude

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-permissions

Codex

Show 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-sandbox

Gemini

Show 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" --yolo

The action also marks the CI workspace as trusted for Gemini CLI runs.

📥 Inputs


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.

📜 License

MIT


LinkedIn Gmail X Github

About

🤖 setup ai coding agents clis for github actions workflows

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages