Skip to content

feat(new): v2 rewrite — gh CLI commands, live repo suggestions, GHE support, no auth#75

Draft
Copilot wants to merge 4 commits intogh-pagesfrom
copilot/create-new-version-api
Draft

feat(new): v2 rewrite — gh CLI commands, live repo suggestions, GHE support, no auth#75
Copilot wants to merge 4 commits intogh-pagesfrom
copilot/create-new-version-api

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 16, 2026

Adds a self-contained new/ folder containing a ground-up rewrite of the extension. The old version relied on OAuth, in-memory API caches, and a bespoke pattern DSL. The new version eliminates all of that.

Key changes

  • gh CLI–aligned command API — omnibox input mirrors gh CLI syntax: repo view, issue list, pr create, release view, gist list, workflow list, run list, search repos/issues/prs/code
  • No auth, no cache — repo suggestions come from chrome.history.search (ranked by visit count) and the public api.github.com/search/repositories endpoint; no token ever required
  • Live suggestions on every keystroke — history and online-search repos are surfaced immediately at Stage 0 (before any command is completed). Typing face instantly shows facebook/react etc from history/search without needing to type repo view first. A owner/repo shorthand navigates directly. Non-command partials with no history match fall back to a GitHub search suggestion so pressing Enter is always useful.
  • GitHub Enterprise support — right-click the extension icon and choose "Set as GitHub Enterprise domain" while on your GHE instance; the base URL is saved to chrome.storage.sync and applied to all URL generation, history searches, and fallback searches automatically. "Reset to github.com" reverts it. Gists on GHE route to ${gheBase}/gist.
  • Manifest V3 — service worker replaces MV2 background page; adds contextMenus, storage, and action manifest entries
  • Pure-function corecommands.js, parser.js, suggest.js, navigate.js are side-effect-free; history.js and search.js accept their I/O dependencies as injectable params; makeCommands(base) factory enables per-base URL generation without global mutation
gh face               → facebook/react, facebook/flux … (live from history/search)
gh repo view facebook/react     → github.com/facebook/react
gh issue list facebook/react    → github.com/facebook/react/issues
gh pr view facebook/react 7     → github.com/facebook/react/pull/7
gh search repos react hooks     → github.com/search?q=react+hooks&type=repositories
facebook/react                  → github.com/facebook/react  (shorthand)

# With GHE domain set to https://github.myco.com:
gh repo view myorg/myrepo       → github.myco.com/myorg/myrepo
myorg/myrepo                    → github.myco.com/myorg/myrepo  (shorthand)
  • 123 Jest tests across 6 modules (commands, parser, suggest, navigate, history, search) — all pure or mock-injected, no browser needed
  • npm test runs out of the box from new/ with Node ≥ 18
Original prompt

let's create a completely new version (inside a "new" folder) and I want the API to match the GH command line tool. use the browser history and search online instead of saving a cache. make the implementation more simple and elegant than before and make it easy to test and maintain moving forward


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: ProLoser <67395+ProLoser@users.noreply.github.com>
Copilot AI changed the title [WIP] Add new version of API matching GH command line tool feat(new): v2 rewrite — gh CLI commands, browser history, no auth Mar 16, 2026
Copilot AI requested a review from ProLoser March 16, 2026 02:13
@ProLoser
Copy link
Copy Markdown
Owner

@copilot does this show results in the autocomplete before you finish typing or do I have to complete and submit the gh command before I start seeing relevant results? One of the side effects was as you typed results were constantly being updated since the chrome omnibox only shows 10 suggestions max and this needs to be easier and more concise to use than simply searching through my history

Copy link
Copy Markdown
Author

Copilot AI commented Apr 26, 2026

@copilot does this show results in the autocomplete before you finish typing or do I have to complete and submit the gh command before I start seeing relevant results? One of the side effects was as y...

Yes — onInputChanged fires on every keystroke, so suggestions update continuously as you type. The original version had a bug though: Stage 0 only showed command completions, so typing gh face returned zero suggestions (since "face" isn't a command prefix). You had to type the full gh repo view face before seeing any repo matches.

Fixed in a811375. Stage 0 now blends history + online-search repos with command completions on every keystroke:

  • gh (empty) → top history repos first, then commands
  • gh face → immediately shows facebook/react, facebook/flux etc from history/search (no command prefix needed)
  • gh facebook/ → filters to matching repos in real time
  • gh refacebook/react etc + repo , release , run commands together
  • gh zzz (no history match, no command) → falls back to a "Search GitHub repositories for zzz" suggestion

The shorthand owner/repo navigates directly without any command prefix, so it's faster than anything history-search alone would give you.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/search/repositories
    • Triggering command: /usr/local/bin/node /usr/local/bin/node --experimental-vm-modules /home/REDACTED/work/Github-Omnibox/Github-Omnibox/new/node_modules/jest-worker/build/workers/processChild.js owner --uid-owner 0 -j ACCEPT (http block)
    • Triggering command: /usr/local/bin/node node --experimental-vm-modules node_modules/.bin/jest --no-coverage (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title feat(new): v2 rewrite — gh CLI commands, browser history, no auth feat(new): v2 rewrite — gh CLI commands, live repo suggestions, no auth Apr 26, 2026
@ProLoser
Copy link
Copy Markdown
Owner

@copilot i should be able to right-click on the extension and enable for this domain when i'm on a custom github enterprise domain but the word for any url or for when github is detected in the domain

Copy link
Copy Markdown
Author

Copilot AI commented Apr 26, 2026

@copilot i should be able to right-click on the extension and enable for this domain when i'm on a custom github enterprise domain but the word for any url or for when github is detected in the domain

Done in 712418f. Right-click the extension icon → "Set as GitHub Enterprise domain" while you're on your GHE instance — the base URL (e.g. https://github.myco.com) is saved to chrome.storage.sync. "Reset to github.com" reverts it.

Once set, everything uses your custom host automatically:

  • History searches look for https://github.myco.com/… URLs
  • All command URLs (repo view, issue list, pr create, etc.) point to your GHE instance
  • owner/repo shorthand and fallback searches also use the custom base
  • Gists route to https://github.myco.com/gist (GHE convention)

The setting persists across browser restarts via chrome.storage.sync.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/search/repositories
    • Triggering command: /usr/local/bin/node /usr/local/bin/node --experimental-vm-modules /home/REDACTED/work/Github-Omnibox/Github-Omnibox/new/node_modules/jest-worker/build/workers/processChild.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title feat(new): v2 rewrite — gh CLI commands, live repo suggestions, no auth feat(new): v2 rewrite — gh CLI commands, live repo suggestions, GHE support, no auth Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants