Repository navigation
CLI/API access to known repositories list + launch to Changes view #22779
Description
The feature request
Third-party tools that integrate with GitHub Desktop currently have no supported way to ask it two very basic questions, or to hand off to it cleanly:
- What repositories does GitHub Desktop know about, and where are they on disk? The "Repository list" (Ctrl+T / Cmd+T) and each repository's local path exist only inside GitHub Desktop's own internal state.
- Which repository is currently selected? Same problem — this is only visible in the app's own UI.
- Please show repository X's Changes tab (starting the app first if it isn't running). The
github <path>command-line helper (documented at
https://docs.github.com/en/desktop/overview/launching-github-desktop-from-the-command-line)
gets us partway — it will launch GitHub Desktop and add/select a
repository by path — but there's no equivalent for choosing which
tab is shown once it's open, and it's only available on Windows and
macOS.
The only way to approximate any of this today is to read GitHub
Desktop's own local repository database directly. That database is
built on Dexie/IndexedDB
(app/src/lib/databases/repositories-database.ts), backed by
Chromium's IndexedDB storage under Electron's userData directory.
That's an internal, undocumented, versioned binary format with no
supported read API — parsing it means reverse-engineering Chromium's
structured-clone encoding, and any integration built on it is liable
to break on a future GitHub Desktop release. (We know this because a
maintainer commented on a past Dexie-related crash report that the
team has considered moving away from IndexedDB entirely — see
https://github.com/desktop/desktop/issues, "we've been looking at
migrating away from IndexedDB down the track" — which would break any
such integration outright.)
We ran into this building a small Gramps (genealogy software) addon
that helps addon developers package and publish releases: after
generating output files in a local clone, the addon wants to hand off
to GitHub Desktop so the developer can review and commit the changes.
Today the addon can only guess at repository names/paths by scanning
common developer folders for .git directories — a poor, easily wrong
substitute for asking GitHub Desktop directly.
Proposed solution
A small, explicitly read-only, local surface for querying the information above — it doesn't need to be a network-facing API. Any of the following mechanisms would work for us; we'd defer to whichever fits GitHub Desktop's architecture best:
• A CLI subcommand, e.g. github --list-repositories /
github --list-repositories --json, printing each known
repository's name and local path, with the currently-selected one
flagged (e.g. "active": true in JSON output).
• A local IPC/JSON-RPC socket or named pipe that a companion
process could query for the same data, for tools that want to avoid
spawning a CLI process per query.
• A documented, stable export file (e.g. a small JSON file written
to a known location under GitHub Desktop's userData directory,
refreshed whenever the repository list or selection changes) that
external tools can read without touching the Dexie/IndexedDB store
directly.
Whichever shape it takes, we'd like it to expose, per known repository:
• name — the display name shown in the Repository list.
• path — the local filesystem path GitHub Desktop has associated
with it.
• Which one (if any) is currently selected/active.
And separately, a supported way to say
"show repository X's Changes tab, starting GitHub Desktop first if it isn't already running"
— for example github --show-changes , or a path + view=changes
parameter added to the existing github launch mechanism. This
would also close the Windows/macOS-only gap in today's github
helper if it's extended in a way that Linux builds can adopt too
(acknowledging Linux isn't an officially supported platform for GitHub
Desktop itself, but the shiftkey/desktop community build follows the
same launch conventions).
To be clear about scope: we are not asking for anything related to diffing, git status, or deciding what counts as a "change" — that analysis should stay entirely inside GitHub Desktop. We only want to know what it already knows (names, paths, current selection) and to ask it to bring a specific repository's Changes view forward.
Alternatives we've considered:
• Parsing the Dexie/IndexedDB store directly. Rejected: undocumented,
versioned binary format; no supported read API; confirmed fragile by
the team's own stated interest in moving off IndexedDB.
• Scanning the filesystem for .git folders under common developer
directories (e.g. ~/Documents/GitHub, ~/repos, etc.) as a proxy
for the repository list. This is what our addon does today. It works
passably for "list of local git clones" but can't tell us which one
GitHub Desktop considers active, can find false positives (git
clones GitHub Desktop was never told about), and can miss
repositories cloned somewhere non-standard.
• OS-level UI automation (sending Ctrl+1/Cmd+1 via xdotool,
osascript, or PowerShell's SendKeys after activating the GitHub
Desktop window) to reach the Changes tab. We prototyped this and it
technically works when the automation tool is available, but it's
fragile (breaks under Wayland, depends on window titles/process
names that could change), and it's the kind of thing that shouldn't
be necessary for a first-party integration point.
Additional context
• Existing docs this request builds on:
• Launching from the command line:
https://docs.github.com/en/desktop/overview/launching-github-desktop-from-the-command-line
• Keyboard shortcuts (Ctrl+1/Cmd+1 for Changes, Ctrl+T/Cmd+T for the
Repository list):
https://docs.github.com/en/desktop/overview/github-desktop-keyboard-shortcuts
• Repository database implementation referenced above:
app/src/lib/databases/repositories-database.ts
• Our specific use case is a Gramps addon (desktop GTK app, Python), so a CLI or file-based mechanism is easier for us to consume than anything browser/JS-oriented, but we don't have a strong preference beyond "documented, stable, and read-only."
• Happy to test against a pre-release build if this is something the team would consider prototyping.
Activity
[-]API calls to[/-][+]CLI/API access to known repositories + launch to Changes view[/+][-]CLI/API access to known repositories + launch to Changes view[/-][+]CLI/API access to known repositories list + launch to Changes view[/+]desktop-triage commentedon Aug 28, 2026
Suggesting the
enhancementlabel — this requests new functionality (a read-only CLI/IPC/export mechanism to list known repositories with their paths and current selection, plus a way to launch directly to a repo's Changes view), which doesn't exist today and requires reverse-engineering the internal Dexie/IndexedDB store as a workaround. A search for related issues (repository list export, external tool integration) found no existing duplicates.emyoulation commentedon Aug 30, 2026
Prompted Claude to suggest an implementation:
Claude response:
Good — I pulled up the actual issue text, and it's a genuinely narrow, well-scoped ask: a read-only "what does Desktop know" surface, plus a documented "jump to Changes" launch parameter. No diffing/status logic requested, which keeps both patches small and low-risk. Two caveats before the patches: I'm reasoning from GitHub Desktop's known architecture (Electron main/renderer split,
AppStore/Dispatcherpattern, thex-github-client://protocol scheme behind thegithub <path>CLI helper), not from a fresh checkout of currentmaster, so file/method names below should be treated as "verify against current source" rather than guaranteed line-accurate — the shapes and hook points are the real contribution.Patch 1 — Write a known-repositories snapshot file on every relevant state change
Where it hooks in:
AppStore(app/src/lib/stores/app-store.ts) is the single place that already knows the full repository list (state.repositories), the selected repository (state.selectedState.repository), and each repo's current branch (viastate.branchesState.tip), and it already callsemitUpdate()every time any of that changes. Rather than sprinkling writes at every call site (add/remove repo, checkout, clone, rename, switch), subscribe once to that existing update stream.Wired up once, near where
AppStoreis instantiated in the main process bootstrap (app/src/main-process/main.tsor wherever the store is constructed):Design notes worth flagging to maintainers in the PR discussion:
userData(as the issue itself suggests) keeps it out of the repo working trees and consistent across platforms.onDidUpdateevents per second; without this the exporter would thrash disk.Patch 2 — Extend the existing URL-scheme launcher to accept a "jump to Changes" parameter
Desktop already has the exact mechanism this needs, just not the parameter: the
github <path>CLI helper works by invoking the registeredx-github-client://URL scheme, which the OS uses to launch Desktop if it isn't running and hand off a payload. That protocol is parsed inapp/src/lib/parse-app-url.tsinto a typed "app action," passed from the main process to the renderer (app/src/main-process/main.ts→sendToAllWindows), and handled inApp.tsx/AppStore. So "launch if not running" is already free — the only gap is a parameter for which tab to land on.Handling side, after the existing logic resolves/selects the repository:
And the CLI helper itself just needs to build the URL with the new param:
Why this shape:
x-github-client://openRepo/<path>links (e.g. from PR-checkout deep links) keep working unchanged sinceviewis optional.xdg-open 'x-github-client://openRepo/<path>?view=changes', without needing thegithubbinary at all — worth calling out explicitly in the PR since that's the actual blocker for non-Windows/macOS use today.One sequencing note for whoever picks this up:
openLocalRepositorytypically returns before the repository's initial refresh (branches/tip) has necessarily settled, sochangeRepositorySectionmay need to happen after that repository is confirmed to exist instate.repositoriesrather than immediately — that's the kind of detail that'll surface once tested against real app boot timing rather than reasoned about statically.AI-Generated Content Disclosure
Tool: Claude Sonnet 5, Anthropic (claude-sonnet-5), web interface, 2026-08-30
Generated-by: Claude Sonnet 5 (Anthropic)
Prompt summary:
best address issue: CLI/API access to known repositories list +
launch to Changes view CLI/API access to known repositories list + launch to Changes view #22779 (github.com/CLI/API access to known repositories list + launch to Changes view #22779).
name, branch name, path, and 'is current') whenever any of those items
change. 2) an externally accessible 'Changes' hook (accepts parameters
to switch to a particular repo/branch and to the Changes tab)."
Constraints/guideline documents referenced:
CLI/API access to known repositories list + launch to Changes view #22779
https://www.gramps-project.org/wiki/index.php/Howto:_Contribute_to_Gramps#AI_generated_code
Notes:
desktop/desktop (Electron) codebase, not a verified diff against a
current checkout; file/method names should be confirmed against
master before submission.
shown is original illustrative scaffolding.
any commit or PR submission.
sergiou87 commentedon Aug 31, 2026
Hey! Thank you for your feature request 💖 Could you be more specific about the use case you're trying to cover with this?
I mean, you mention "third-party tools that integrate with GitHub Desktop"... what tools are these and what problems do they solve?
github-actions commentedon Aug 31, 2026
Thank you for your issue! We have categorized it as an enhancement (feature or improvement) request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.
Unless you see the help wantedIssues marked as ideal for external contributors
label, we are not currently looking for external contributions for this feature.
If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.
emyoulation commentedon Aug 31, 2026
Hey there! Thanks for the follow-up.
My particular "third-party Tool":
I’m building Addon Pack & Ship (APS), a built-in packaging/publishing tool for the open-source Gramps genealogy software. It helps non-technical plugin authors package, version, and push their add-ons to GitHub without leaving their familiar environment.
Problem it solves:
Manually syncing localized files, documentation, and code changes to a local Git repository is error-prone for beginners. While GitHub Desktop simplifies the Git workflow, bridging external tools to GitHub Desktop requires manual setup (finding the correct local repository path and manually selecting it in the UI).
How GitHub Desktop integration would help:
Current Workaround:
Currently, the tool requires users to manually browse to discover the local file paths. It opens GitHub Desktop, which then opens to whatever repository was last active—requiring extra navigation steps for non-technical users.
The (beta) tool is functional today, so any GitHub Desktop enhancements could be tested and adopted immediately. (Note: The GitHub logo shown in the current GUI draft is temporary for development and will be updated to align with brand guidelines.)
Best regards,
Brian McCullough
(aka
emyoulation)List the repositories and open a tab from the command line