Skip to content

feat(cli): send github issues/prs from snacks picker to the cli#336

Open
S1M0N38 wants to merge 1 commit into
folke:mainfrom
S1M0N38:feat/gh-send
Open

feat(cli): send github issues/prs from snacks picker to the cli#336
S1M0N38 wants to merge 1 commit into
folke:mainfrom
S1M0N38:feat/gh-send

Conversation

@S1M0N38

@S1M0N38 S1M0N38 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Description

Add support for sending a GitHub issue/PR selected in a picker to the CLI as context.

When a picker item is a GitHub issue/PR (detected by the presence of type, repo, and number fields, as exposed by snacks' gh_issues / gh_prs sources), the send callback now emits the reference in GitHub's standard cross-repo autolink format:

owner/repo#number

e.g. folke/sidekick.nvim#123.

This format is the documented GitHub autolink reference, so the output is compact for the agent and remains clickable when pasted back into GitHub. It intentionally does not distinguish PR from issue, since they share the same number space on GitHub.

Non-GitHub items keep falling back to the existing file/location behavior, so the change is backwards compatible and scoped to the picker send path (lua/sidekick/cli/picker/init.lua).

Related Issue(s)

Screenshots

Not applicable — this is a change to the text sent to the CLI, with no visual/UI changes. Resulting context for a selected GitHub issue looks like:

folke/sidekick.nvim#123

Copilot AI review requested due to automatic review settings July 5, 2026 10:57
@github-actions github-actions Bot added the size/m Medium PR (<50 lines changed) label Jul 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to let the CLI “send” action emit a compact GitHub autolink reference (owner/repo#number) when the picker selection represents a GitHub issue/PR, keeping the existing file/location fallback for other items.

Changes:

  • Added GitHub-item detection helpers (is_gh_item, gh_ref) in the picker send path.
  • Updated the picker send callback to emit a GitHub reference instead of a file/location when a GitHub item is detected.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +55 to +56
if is_gh_item(item) then
ret[#ret + 1] = { gh_ref(item) }
Comment on lines +55 to +58
if is_gh_item(item) then
ret[#ret + 1] = { gh_ref(item) }
ret[#ret + 1] = { "\n" }
else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m Medium PR (<50 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: send GitHub issue/PR reference from picker to CLI

2 participants