{"id":17925069,"url":"https://github.com/zerowidth/gh-shorthand.alfredworkflow","last_synced_at":"2025-03-24T03:31:00.149Z","repository":{"id":46719949,"uuid":"103854083","full_name":"zerowidth/gh-shorthand.alfredworkflow","owner":"zerowidth","description":"GitHub shorthand Alfred workflow","archived":false,"fork":false,"pushed_at":"2021-09-28T16:22:16.000Z","size":452,"stargazers_count":12,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-19T01:11:37.028Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zerowidth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-17T19:01:08.000Z","updated_at":"2023-12-21T17:56:05.000Z","dependencies_parsed_at":"2022-09-22T21:50:26.669Z","dependency_job_id":null,"html_url":"https://github.com/zerowidth/gh-shorthand.alfredworkflow","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerowidth%2Fgh-shorthand.alfredworkflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerowidth%2Fgh-shorthand.alfredworkflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerowidth%2Fgh-shorthand.alfredworkflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerowidth%2Fgh-shorthand.alfredworkflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zerowidth","download_url":"https://codeload.github.com/zerowidth/gh-shorthand.alfredworkflow/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245204465,"owners_count":20577354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-28T20:52:08.530Z","updated_at":"2025-03-24T03:30:59.708Z","avatar_url":"https://github.com/zerowidth.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub shorthand Alfred workflow\n\nThis Alfred 4 workflow provides easy access to GitHub repositories, issue search, local project directories, and more using a configurable shorthand.\n\n## Installation and configuration\n\nThis repository contains the Alfred workflow. In addition, you'll need the [`gh-shorthand` command-line tool and optional RPC server](https://github.com/zerowidth/gh-shorthand).\n\n* Install the `gh-shorthand` CLI tool. See its [README](https://github.com/zerowidth/gh-shorthand#installation) for instructions.\n* Clone this repository and run `./install.sh` to symlink it into your Alfred workflow directory.\n* Edit the config vars for this workflow by clicking the `[x]` in the Alfred toolbar:\n  * Change `GH_SHORTHAND` to the path to your `gh-shorthand` binary, either as downloaded from a release or as built from source. This defaults to `~/go/bin/gh-shorthand`.\n\nThe Alfred [terminal integration](https://www.alfredapp.com/help/features/terminal/) is required for the \"open in terminal\" action. The Alfred integration defaults to Terminal.app, and you can find iTerm configurations at [vitorgalvao/custom-iterm-scripts-for-alfred](https://github.com/vitorgalvao/custom-iterm-scripts-for-alfred).\n\nThe remainder of the configuration lives in `~/.gh-shorthand.yml`. The full configuration file documentation is in the `gh-shorthand` repository [here](https://github.com/zerowidth/gh-shorthand#configuration).\n\n## Usage\n\nSee the [`gh-shorthand` completion documentation](https://github.com/zerowidth/gh-shorthand#completion) for the full grammar of these queries.\n\n### Opening repositories, issues, and paths\n\nGiven the configuration in `~/.gh-shorthand.yml`:\n\n```yml\ndefault_repo: \"zerowidth/gh-shorthand\"\nrepos:\n  df: \"zerowidth/dotfiles\"\nusers:\n  z: \"zerowidth\"\n```\n\n* `g [user|user/repo] [issue number|/path]`: open a GitHub repository, a specific issue, and paths within repositories.\n    * `g foo/bar` opens the `foo/bar` repository\n    * `g z/foo` opens the `zerowidth/foo`  repository, expanding the `z` user shorthand to `zerowidth`\n    * `g df` opens the `zerowidth/dotfiles` repository, expanding the `df` repo shorthand.\n    * `g ` (trailing space!) opens the default repository, `zerowidth/gh-shorthand`\n    * `g foo/bar#123` or `g foo/bar 123` opens issue 123 in the `foo/bar` repository\n    * `g z/foo 123` opens issue 123 in the `zerowidth/foo` repository, expanding the `z` user shorthand\n    * `g df 123` opens issue 123 in the `zerowidth/dotfiles` repository, expanding the `df` repository shorthand\n    * `g 123` opens issue (or pull request) #123 in the default repository\n    * `g foo/bar /branches` opens the default repository with the `/branches` path appended\n    * `g z/foo /branches` opens the `zerowidth/foo/branches` path\n    * `g df /branches` opens `zerowidth/dotfiles/branches`\n    * `g /branches` opens the default repository `/branches`\n* `gi [user|user/repo] [query]`: list, search, and open issues/PRs in a repository.\n    * `gi foo/bar` lists the issues in the `foo/bar` repository.\n    * `gi foo/bar fixes` searches the issues in `foo/bar` for \"fixes\".\n    * `gi ` (trailing space!) lists the issues in the default repository\n    * `gi fixes` searches the default repository's issues for \"fixes\"\n    * The same shorthand expansion applies: `z/foo` becomes `zerowidth/foo`, `df` becomes `zerowidth/dotfiles`.\n    * Issue search allows the [full search syntax ](https://help.github.com/articles/searching-issues-and-pull-requests/), e.g. `gi is:open is:pr` for showing open pull requests in the default repository.\n* `gn [query] [title]` opens the \"new issue\" page with the provided title in the given repository.\n    * `gn ` (trailing space!) opens the new issue page in the default repository\n    * `gn fix a bug` opens the new issue page in the default repository with \"fix a bug\" as the issue title\n    * `gn foo/bar` opens the new issue page in the `foo/bar` repository\n    * User/repository shorthand expansion applies\n* `gp [user|repo] [project number]` lists or shows a specific project in the given or default repository. This does not currently support project title searches.\n\n### Opening terminals and editors locally\n\nGiven the configuration in `~/.gh-shorthand.yml`:\n\n```yaml\nproject_dirs:\n  ~/code\n  ~/work/projects\n```\n\nAnd the following directory tree:\n\n```\n~\n├── code\n│   ├── dotfiles\n│   └── demo\n└── work\n    └── projects\n        ├── client\n        └── server\n```\n\n* `ge df` opens the `dotfiles` project with the configured editor.\n* `gt df` opens the terminal in the `dotfiles` directory.\n* `ge wpc` opens the editor with `work/projects/client` .\n* `gt wpc` opens the terminal in `work/projects/client`.\n\nBoth the `gt` and `ge` commands have single character aliases: `t` and `e` respectively.\n\n### Links and issue references\n\n* `gir` retrieves a GitHub URL from the clipboard, converts it to an issue reference (as used in GitHub issues), and pastes it into an active editor: `https://github.com/github/linguist/issues/1` on the clipboard becomes `github/linguist#1`\n* The `gml` command retrieves a GitHub URL from the clipboard and converts it to a markdown link: `https://github.com/github/linguist/issues/1`  on the clipboard becomes `[github/linguist#1](https://github.com/github/linguist/issues/1)`\n* The `gmd` command uses the RPC server backend to retrieve the issue title for the linked issue and includes it in the generated markdown link: `https://github.com/github/linguist/issues/1` becomes `[github/linguist#1: Binary detection issues on extensionless files](https://github.com/github/linguist/issues/1)`\n\n`gml` and `gmd` understand fully qualified issue references in the clipboard: `github/linguist#1` can be converted to a markdown link without having to look up its URL first. Similarly, `gir` can parse the URL out of a markdown link if that's on the clipboard.\n\n### Snippet expansion\n\nAlongside the `gir`, `gml`, and `gmd` commands, this workflow supports inline snippet expansion for the same behavior with even more convenience:\n\n* `//gir` and `//ir` insert an issue reference\n* `//gml` and `//ml` insert a markdown link\n* `//md` and `//md` insert a markdown link with description when RPC is enabled\n\n### Meta\n\n* `gc` opens an editor for `~/.gh-shorthand.yml` to make it easy to adjust the configuration. See the [`gh-shorthand` configuration](https://github.com/zerowidth/gh-shorthand#configuration) docs for more information.\n\n### Actions\n\nMost repository/issue Alfred results include alternate actions:\n\n* `cmd-c` to copy the url to the result\n* hold `cmd` to insert a markdown link\n* hold `opt` to insert an issue reference\n* hold `ctrl` to insert a markdown link including an issue description (applies when RPC is enabled)\n\n## RPC annotation\n\nWhenever a repository, issue, or pull request is displayed in Alfred results, and when the RPC server is enabled, the workflow retrieves and displays the repository description, issue title, and issue/PR state (open, closed, merged). When listing or searching issues in a repository, the RPC server executes that query and display results inline in Alfred. If RPC is disabled, only links to repositories, issues and search pages are displayed.\n\nRPC queries are triggered after a slight delay to prevent unnecessary queries against the API.\n\n## Contributing\n\nOpen an issue. The Alfred bits aren't easily shareable or modifiable like most source code is, unfortunately, so PRs might not get merged. I'm happy to consider ideas and requests, though. For anything particularly customized, you might have a better time  modifying the workflow in place.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzerowidth%2Fgh-shorthand.alfredworkflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzerowidth%2Fgh-shorthand.alfredworkflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzerowidth%2Fgh-shorthand.alfredworkflow/lists"}