github / github/copilot-cli

Organization-level custom agents not visible in Copilot CLI when no GitHub-hosted repository is in the working directory

Open
#3,572 2 comments 3 reactions 0 assignees View on GitHub
area:agents area:enterprise
Dominant language
Shell
Stars
11.2k
Forks
1.9k
Avg merge
14h 16m
Merged PRs (30d)
6

Description

### Describe the bug

Organization-level custom agents defined in the agents/ directory of the org's .github-private repository do not appear in gh copilot CLI (via /agent) unless the CLI is launched from a directory that contains a git repository with a GitHub remote belonging to that organization. This works perfectly fine in VS Code.

### Affected version

_No response_

### Steps to reproduce the behavior

1. Define org-level custom agents in /.github-private/agents/.
2. On a machine with no local clones of any GitHub repository in that org, run copilot from any directory.
3. Run /agent — org-level agents are not listed.

### Expected behavior

Org-level agents should be resolved from the authenticated user's organization membership, not from the git remote of the current working directory.

### Additional context

Our organization uses Azure DevOps for source control and only has the .github-private repository on GitHub. As a result, org-level agents are inaccessible in the CLI without maintaining an otherwise unused GitHub repo clone on every developer machine.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue from a directory without a GitHub repository or remote, then run the /agent command in gh copilot CLI and compare it with a GitHub-hosted repository directory. Trace how the CLI resolves organization-level agents from the authenticated user's organization membership and verify that agents in the organization's .github-private/agents/ directory appear without relying on the current git remote.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, shell
Domain
authentication, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.