Skip to main content

Documentation Index

Fetch the complete documentation index at: https://onecli.sh/docs/llms.txt

Use this file to discover all available pages before exploring further.

Overview

OneCLI connects AI agents to GitHub so they can read and write code, open pull requests, manage issues, and trigger workflows. The gateway injects GitHub credentials into API requests automatically. OneCLI supports two ways to connect GitHub:
MethodAccess scopeBest for
OAuthAll repos the user can accessPersonal use, quick setup
GitHub AppOnly selected reposTeams, organizations

Quick example

An agent calling the GitHub API through the gateway, with no token management needed:
# List your repositories
curl -s "https://api.github.com/user/repos?per_page=5&sort=updated" | jq '.[].full_name'

# Create an issue
curl -s -X POST "https://api.github.com/repos/myorg/myrepo/issues" \
  -H "Content-Type: application/json" \
  -d '{"title": "Bug: login page timeout", "body": "The login page times out after 30s on slow connections."}'

# Open a pull request
curl -s -X POST "https://api.github.com/repos/myorg/myrepo/pulls" \
  -H "Content-Type: application/json" \
  -d '{"title": "Fix login timeout", "head": "fix/login-timeout", "base": "main"}'

# Trigger a workflow
curl -s -X POST "https://api.github.com/repos/myorg/myrepo/actions/workflows/deploy.yml/dispatches" \
  -H "Content-Type: application/json" \
  -d '{"ref": "main"}'
The agent makes standard GitHub API calls. The gateway injects the right authentication header automatically: Bearer token for API calls, Basic auth for git-over-HTTPS.

OAuth

Connect your personal GitHub account. The agent gets access to all repositories you can see.

Setup

1

Go to Connections

Open the OneCLI dashboard and navigate to Connections > GitHub.
2

Authorize

Click Connect GitHub. You’ll be redirected to GitHub to authorize OneCLI. Review the permissions and click Authorize.
OneCLI dashboard showing the GitHub connection page with OAuth and permissions

Permissions

The OAuth connection requests these scopes:
ScopeNameAccess
repoRepositoriesRead & write (code, issues, PRs)
userProfileRead (email, name, avatar)
gistGistsRead & write
notificationsNotificationsRead
projectProjectsRead & write
codespaceCodespacesRead & write
workflowActionsRead & write (workflow files)

How it works

  1. You authorize OneCLI via GitHub’s OAuth flow
  2. OneCLI receives a long-lived access token and encrypts it
  3. When an agent sends a request to api.github.com, the gateway injects the token as a Bearer header
  4. For git operations over HTTPS (github.com), the gateway injects Basic auth credentials

Use cases

  • Coding agents creating branches, committing code, and opening pull requests
  • Agents reviewing PRs and leaving comments
  • Triggering GitHub Actions workflows from an agent
  • Reading repository contents during code generation

Limitations

  • The token has access to all repositories you can see, not just selected ones
  • No organizational visibility or approval flow
  • Token is long-lived until you revoke the connection

GitHub App

For teams and organizations. A GitHub App gives you repo-level access control and organizational visibility. Org admins can see which repos are connected and approve or revoke access at any time.

Setup

1

Go to Connections

Open the OneCLI dashboard and navigate to Connections > GitHub App.
2

Configure credentials (self-hosted only)

If you’re using OneCLI Cloud, skip this step. Platform credentials are pre-configured.For self-hosted deployments, create a GitHub App and enter your App ID, App Slug, and Private Key.
3

Install the app

Click Connect GitHub App. You’ll be redirected to GitHub where you can:
  1. Select the organization or personal account
  2. Choose All repositories or Only select repositories
  3. Review the permissions
Click Install to complete the connection.

Permissions

The GitHub App requests only the permissions your agents need:
PermissionAccessDescription
ContentsRead & writeCode, commits, and branches
Pull requestsRead & writeCreate, review, and merge PRs
IssuesRead & writeCreate and manage issues
ActionsRead & writeView runs and trigger workflows
ChecksRead & writeRead CI results, create check runs
Commit statusesRead & writeRead and set status checks
DiscussionsRead & writeRead and participate in discussions
ProjectsRead & writeManage project boards
MetadataRead-onlyRepository metadata (always granted)

How it works

  1. You install the GitHub App on your organization or account and select which repositories it can access
  2. OneCLI receives the app’s private key and installation ID
  3. The gateway signs a short-lived JWT and exchanges it for an installation access token (1hr TTL)
  4. The token is injected into API requests and automatically refreshed when it expires

Use cases

  • Organizations giving agents access to specific repos without exposing the full account
  • Teams where admins need visibility into which repos agents can access
  • Production deployments where token rotation should be automatic
  • Compliance environments where long-lived tokens are not acceptable

Managing access

After connecting, you can change which repositories the app can access:
  1. Go to Connections > GitHub App in the OneCLI dashboard
  2. Click Manage on the connection
  3. You’ll be taken to GitHub’s installation settings where you can add or remove repositories

Comparison

OAuthGitHub App
Repo accessAll repos the user can seeOnly selected repos
Token lifetimeLong-lived1 hour (auto-refreshed)
Org visibilityNot visible to adminsVisible to org admins
Org approvalNot requiredRequired
SetupOne-click OAuthInstall app + select repos
Best forPersonal, quick startTeams, production

Per-action permissions

Once connected, the dashboard shows a permissions panel where you control what agents can do with GitHub. Each action has three modes: Allow (green), Ask (yellow, requires human approval), and Block (red, request is rejected). Read-only actions:
ActionDescription
List repositoriesBrowse repos the account can access
Read repositoryRead code, commits, branches
List issuesView issues on a repo
List pull requestsView open/closed PRs
Write / delete actions:
ActionDescription
Create issueOpen new issues
Create pull requestOpen PRs against a repo
Create commentComment on issues and PRs
Delete / closeClose issues, delete branches
Use the Read-only preset to allow all read actions and block writes, or switch to Custom to configure each action individually.

Controlling access with rules

Both connection methods also work with OneCLI’s rules engine. You can create rules to:
  • Block write operations to api.github.com for read-only agents
  • Rate limit API calls to stay within GitHub’s rate limits
  • Require manual approval for destructive operations (e.g., deleting branches)
Rules are evaluated before credential injection, so a blocked request never touches your GitHub token.