Live data from Hacker News

Using Alfred to open your GitHub repositories in the browser

mmazzarolo.com

21–30 of 32 posts

Re: Using Alfred to open your GitHub repositories in the browser

#21

For vscode users, I recently discovered you can right-click any line and select “copy remote uri.” The copied link takes you right to that line on github (useful for quickly pointing someone to a line of code over slack).

Same for Jetbrains IDEs - right clicking a line will show 'open on GitHub' provided your git remote is pointing to GitHub.com.

Re: Using Alfred to open your GitHub repositories in the browser

#22
I also use a very similar script. The one notable difference is that I utilize Alfred’s "match" field that I set to a tokenized version of the repository name:

https://github.com/temochka/macos-automation/blob/master/src...

This allows me to quickly look up similarly named repos while keeping typing to a minimum (e.g., "m c" finds "mysql_client").

I also incorporated the refresh script under a different keyword into the same workflow. This way I can quickly refresh if I don't see a repo that should be there.

Re: Using Alfred to open your GitHub repositories in the browser

#23

I use the gh client quite heavily and tend to have most of the repos I'm interested in already cloned. Having said that, I had a quick go at making a one-liner for this from the terminal. Note, this is using HTTPie instead of cURL. xdg-open $(http get https://api.github.com/orgs/your-org/repos | jq -r '.[].html_url' | fzf)

GitHub's own gh tool is really useful for things like this, as its builtin api subcommand¹ performs authenticated requests. Using that you can also see private repos and GitHub Enterprise usage is pretty seamless. Just replace HTTPie, with `gh api `.

¹ https://cli.github.com/manual/gh_api

Re: Using Alfred to open your GitHub repositories in the browser

#25
post #2

Neat. Another workflow that you can use is https://github.com/lox/alfred-github-jump Lets you search through all your GitHub stars (including own GitHub repos). I have over 16,300 stars and even with that amount of repos, the search is instant due to SQLite db used. ( https://github.com/nikitavoloboev/github-stars ) What's cool is that you can modify actions on a repo. So I made modification so that cmd+return would…

I just noticed this project is using a bit of code [1] I put up on GitHub over 4 years ago to create Alfred workflows in Go. I never realized people other than myself were actually using this, wonderful!

[1] https://github.com/pascalw/go-alfred

Re: Using Alfred to open your GitHub repositories in the browser

#26
post #23

I use the gh client quite heavily and tend to have most of the repos I'm interested in already cloned. Having said that, I had a quick go at making a one-liner for this from the terminal. Note, this is using HTTPie instead of cURL. xdg-open $(http get https://api.github.com/orgs/your-org/repos | jq -r '.[].html_url' | fzf)

GitHub's own gh tool is really useful for things like this, as its builtin api subcommand¹ performs authenticated requests. Using that you can also see private repos and GitHub Enterprise usage is pretty seamless. Just replace HTTPie, with `gh api `. ¹ https://cli.github.com/manual/gh_api

I've used gh daily for months and didn't even realise it had an api subcommand! Fantastic, thanks.

Re: Using Alfred to open your GitHub repositories in the browser

#30
post #4

I used to use Alfred for these kind of workflows, for years. For opening apps, URLs, for triggering Python or bash scripts, and for searching files of course. It’s a wonderful app. Until I started using Emacs seriously. Now I use Emacs for opening URLs, for triggering Google searches (and saving my searches via org-capture), for saving URLs via org-protocol and org-capture, for taking notes, for journaling, for task…

If you ever consider making a short demo video for this, I'd be eager to see this in action.
Post reply on HN