Skip to content

marijnbos/copilot-cli-project-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

copilot-cli-project-manager

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.

What it does

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 to main / master / develop / development, then the current branch.
  • Detects the GitHub owner/repo from the origin remote when it points to github.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.

Previous sessions are picked up automatically

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.

Requirements

  • GitHub Copilot CLI / desktop app installed (provides ~/.copilot/data.db).
  • Node.js 22+ runtime (the extension uses the built-in node:sqlite module).
  • git available on PATH.

Installation

Option A — install from this repo (recommended)

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.

Option B — manual install

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

Usage

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.

Examples

Add every git repository under a directory (preview first):

// dry run
{ "scanDirectory": "C:\\dev", "dryRun": true }

// for real
{ "scanDirectory": "C:\\dev" }

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.

How it works

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.

Safety notes

  • The tool writes to your Copilot data store. Consider backing up ~/.copilot/data.db (and its -wal / -shm files) 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 git commands against the repositories you point it at.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors