A GitHub Copilot CLI extension that bulk-registers local git repositories as Copilot projects.
Instead of adding repositories one by one through the UI, point the create_project tool at a single repo or a parent directory and it adds them all, auto-detecting the default branch and GitHub remote.
The extension contributes one tool, create_project, to the Copilot agent. It writes new rows directly to the Copilot data store (~/.copilot/data.db), the same store the app uses for its project list.
For each repository it:
- Uses the folder name as the project name (overridable).
- Detects the default branch from
origin/HEAD, falling back tomain/master/develop/development, then the current branch. - Detects the GitHub
owner/repofrom theoriginremote when it points togithub.com, and links the default GitHub account. Non-GitHub remotes (e.g. Azure DevOps) are added as local-only projects. - Skips repositories that are already registered.
Once a repository is registered as a project, your earlier Copilot sessions for
that repo are re-attached for free. On the next app start, Copilot matches
existing sessions to the project by their working directory (source_path) and
lists them under that project as session history. Repos you never ran a session
against simply show no history, and standalone chats stay unattached.
- GitHub Copilot CLI / desktop app installed (provides
~/.copilot/data.db). - Node.js 22+ runtime (the extension uses the built-in
node:sqlitemodule). gitavailable onPATH.
In a Copilot CLI session, ask the agent to install the extension from the repo folder, or use the install tool with this URL:
https://github.com/marijnbos/copilot-cli-project-manager/tree/main/project-manager
This installs it as a user-scoped extension, available across all your projects.
Copy the project-manager/ folder into your Copilot extensions directory:
- User scope (all projects):
~/.copilot/extensions/project-manager/extension.mjs - Project scope (one repo):
<repo>/.github/extensions/project-manager/extension.mjs
Then reload extensions (restart the CLI or run the reload command).
Ask the agent to run the create_project tool. Parameters:
| Parameter | Type | Description |
|---|---|---|
path |
string | Absolute path to a single git repository to add. |
name |
string | Optional project name (defaults to the folder name). Only with path. |
defaultBranch |
string | Optional default-branch override. Only with path. |
scanDirectory |
string | Absolute path to a directory; every immediate git-repo subdirectory is added. |
dryRun |
boolean | If true, report what would be added without writing anything. |
Provide either path or scanDirectory.
Add every git repository under a directory (preview first):
Add a single repository with a custom name:
{ "path": "/home/me/code/my-app", "name": "My App" }Restart the Copilot app after adding projects so they appear in the sidebar. The data store is updated immediately, but the UI reads the project list on startup.
The extension opens ~/.copilot/data.db with node:sqlite and inserts rows into the projects table, mirroring the columns the app sets when you add a project manually. It uses a busy_timeout so concurrent access with the running app is handled gracefully.
- The tool writes to your Copilot data store. Consider backing up
~/.copilot/data.db(and its-wal/-shmfiles) before a large import. - It only ever inserts new project rows and skips existing ones; it does not modify or delete existing projects.
- It runs read-only
gitcommands against the repositories you point it at.