A powerful Alfred workflow that lets you quickly search and access GitHub repositories, pull requests, and more. Built with TypeScript for improved reliability and maintainability.
This is a typescript adaptation of https://github.com/edgarjs/alfred-github-repos improved with caching and other small things to make something amazing even better.
- 🔍 Global Repository Search: Search any GitHub repository
- 📚 Personal Repository Search: Quick access to your repositories
- 🔄 Pull Request Management: Search and access your open PRs
- 🏢 Organization Support: Search within your organizations
- 🚀 Fast & Efficient: Local caching for quick results
- 🔐 Secure: Uses GitHub personal access tokens
- 🖼️ Rich UI: Shows repository owner avatars in results
- Download the latest release from the releases page
- Double-click the
.alfredworkflow
file to install - Generate a GitHub personal access token:
- Visit GitHub Token Settings
- Select the
repo
scope - Click "Generate token"
- Set up your token in Alfred:
- Type
gh-login
in Alfred - Paste your token and press Enter
- Type
gh <query>
Example: gh vite
or gh react stars:>1000
repo <query>
Example: repo api
or repo frontend
pr <query>
Example: pr fix
or pr feature
gh-clear
Clears the local cache of repository data and icons.
When using the global search (gh
), you can use GitHub's search modifiers:
stars:>1000
- Repositories with more than 1000 starslanguage:typescript
- TypeScript repositoriesorg:microsoft
- Repositories from Microsoftfork:true
- Include forked repositories
Example: gh react stars:>1000 language:typescript
The repo
command automatically includes repositories from your organizations. To see all repositories from a specific organization:
repo org-name/
You can customize the behavior by setting these variables in Alfred's workflow configuration:
GITHUB_API_HOST
: API host for GitHub Enterprise (default: api.github.com)GITHUB_HOST
: Web host for GitHub Enterprise (default: github.com)PR_ALL_INVOLVE_ME
: Show all PRs you're involved in (default: false)CACHE_TTL_SEC_REPO
: Repository cache TTL in seconds (default: 86400)CACHE_TTL_SEC_PR
: PR cache TTL in seconds (default: 300)CACHE_TTL_SEC_ORG
: Organization cache TTL in seconds (default: 86400)
If you're using GitHub Enterprise, update the host settings:
- Open Alfred Preferences
- Go to Workflows
- Select GitHub Workflow
- Set the following variables:
GITHUB_API_HOST
: Your enterprise API hostGITHUB_HOST
: Your enterprise web host
- Node.js 18 or higher
- npm 9 or higher
-
Clone the repository:
git clone https://github.com/your-username/github-workflow.git cd github-workflow
-
Install dependencies:
npm install
-
Create environment file:
cp .env.dist .env
-
Update
.env
with your GitHub token
npm run dev
: Watch mode developmentnpm run build
: Build for productionnpm test
: Run testsnpm run test:watch
: Run tests in watch mode
src/
├── cli.ts # CLI entry point
├── client/
│ └── github.ts # GitHub API client
├── commands/ # Command implementations
│ ├── search.ts
│ ├── user-repos.ts
│ └── user-pulls.ts
├── types/ # TypeScript types
└── utils/ # Utility functions
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
- Write tests for new features
- Follow the existing code style
- Update documentation as needed
- Add comments for complex logic
This project is licensed under the MIT License - see the LICENSE.md file for details.
- Alfred App for the amazing automation platform
- GitHub API for the comprehensive API
- Inspired by various Alfred workflows in the community