DEV Community

Ragib Hasan
Ragib Hasan Subscriber

Posted on

How to Add GitHub Copilot and Kiro to CLIProxyAPIPlus

How to Add GitHub Copilot and Kiro to CLIProxyAPIPlus

A step-by-step guide to connecting GitHub Copilot and Kiro AI to your CLIProxyAPIPlus instance using OAuth authentication.


Prerequisites

Before you begin, make sure you have:

  • CLIProxyAPIPlus installed and running (eceasy/cli-proxy-api-plus:latest)
  • An active GitHub Copilot subscription (Individual, Business, or Enterprise)
  • An AWS Builder ID or Kiro IDE installed (for Kiro login)
  • Docker installed on your system

Verify your container is running:

docker ps | grep cli-proxy-api-plus
Enter fullscreen mode Exit fullscreen mode

You should see cli-proxy-api-plus with status Up.


Part 1 — GitHub Copilot

Step 1: Run the Login Command

docker exec -it cli-proxy-api-plus ./CLIProxyAPIPlus -github-copilot-login
Enter fullscreen mode Exit fullscreen mode

Step 2: Complete Device Flow Authentication

The terminal will display something like:

Visit: https://github.com/login/device
Enter code: ABCD-1234
Enter fullscreen mode Exit fullscreen mode
  1. Open https://github.com/login/device in your browser
  2. Enter the device code shown in the terminal
  3. Click Authorize and confirm with your GitHub account
  4. Wait for the terminal to confirm success

Step 3: Verify the Token Was Saved

ls ~/CLIProxyAPI/auths/
Enter fullscreen mode Exit fullscreen mode

You should see a new auth file for Copilot (e.g., copilot.json or similar).

Step 4: Check Available Copilot Models

curl http://localhost:8317/v1/models \
  -H "Authorization: Bearer your-api-key-1"
Enter fullscreen mode Exit fullscreen mode

You should now see Copilot models such as:

  • gpt-4o
  • gpt-4o-mini
  • claude-sonnet-4-5
  • o3
  • o4-mini

Part 2 — Kiro AI

Kiro uses AWS Cognito under the hood, which means Google OAuth is blocked for third-party apps. You must use one of the two supported methods below.

Method A — AWS Builder ID (Recommended)

This is the easiest method and does not require installing Kiro IDE.

Step 1: Run the Login Command

docker exec -it cli-proxy-api-plus ./CLIProxyAPIPlus -kiro-aws-login
Enter fullscreen mode Exit fullscreen mode

Step 2: Complete Device Flow

The terminal will show a verification URL and code. Open the URL in your browser, enter the code, and sign in with your AWS Builder ID.

Don't have an AWS Builder ID?

Create one for free at https://profile.aws.amazon.com — no credit card required.

Step 3: Verify Authentication

curl http://localhost:8317/v1/models \
  -H "Authorization: Bearer your-api-key-1"
Enter fullscreen mode Exit fullscreen mode

Kiro models should now appear in the list.


Method B — Import from Kiro IDE

Use this method if you already have Kiro IDE installed and logged in with Google.

Step 1: Locate the Token File

ls ~/.kiro/kiro-auth-token.json
Enter fullscreen mode Exit fullscreen mode

Step 2: Copy the Token into the Container

docker cp ~/.kiro/kiro-auth-token.json cli-proxy-api-plus:/root/.kiro/kiro-auth-token.json
Enter fullscreen mode Exit fullscreen mode

Step 3: Import the Token

docker exec -it cli-proxy-api-plus ./CLIProxyAPIPlus -kiro-import
Enter fullscreen mode Exit fullscreen mode

Part 3 — Verify Everything is Working

Run a quick test to confirm both providers are active:

curl http://localhost:8317/v1/models \
  -H "Authorization: Bearer your-api-key-1" | jq '.data[].id'
Enter fullscreen mode Exit fullscreen mode

You should see models from both GitHub Copilot and Kiro in the output.

Test a Completion Request

curl http://localhost:8317/v1/chat/completions \
  -H "Authorization: Bearer your-api-key-1" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
Enter fullscreen mode Exit fullscreen mode

Troubleshooting

Issue Solution
No such container Run docker compose up -d first
address already in use The container is already running — this is normal, the auth still completes
Google login blocked (Kiro) Use -kiro-aws-login instead
Token expired Re-run the login command — CLIProxyAPIPlus auto-refreshes tokens every 15 minutes
Models not showing up Restart the container: docker compose restart

Token Auto-Refresh

CLIProxyAPIPlus automatically refreshes OAuth tokens in the background every 15 minutes. You do not need to manually re-authenticate unless your session is fully revoked.

core auth auto-refresh started (interval=15m0s)
Enter fullscreen mode Exit fullscreen mode

Summary

Provider Login Command Auth Method
GitHub Copilot -github-copilot-login Device flow
Kiro (AWS) -kiro-aws-login AWS Builder ID device flow
Kiro (IDE import) -kiro-import Token file import

Guide based on CLIProxyAPIPlus v6.9.1-0-plus. Commands may vary in future versions.

Top comments (0)