brew install --cask zhaochunqi/tap/git-openA Go-based tool that allows you to open the current repository in a web browser with a single command. It's a simple yet efficient solution for quickly accessing your project's online resources.
- Easy Access: Open your repository in a web browser with a single command.
- Cross-Platform: Built using Go, the tool is compatible with various operating systems.
- Lightweight: Minimal dependencies and efficient code ensure the tool runs smoothly.
There are multiple ways to install the tool:
The easiest method for macOS users with automatic updates:
brew install --cask zhaochunqi/tap/git-openDownload the pre-compiled binary for your platform:
# macOS (Intel)
curl -L https://github.com/zhaochunqi/git-open/releases/latest/download/git-open_Darwin_x86_64.tar.gz -o git-open.tar.gz
tar -xzf git-open.tar.gz
chmod +x git-open
sudo mv git-open /usr/local/bin/
# macOS (Apple Silicon)
curl -L https://github.com/zhaochunqi/git-open/releases/latest/download/git-open_Darwin_arm64.tar.gz -o git-open.tar.gz
tar -xzf git-open.tar.gz
chmod +x git-open
sudo mv git-open /usr/local/bin/
# Linux (x64)
curl -L https://github.com/zhaochunqi/git-open/releases/latest/download/git-open_Linux_x86_64.tar.gz -o git-open.tar.gz
tar -xzf git-open.tar.gz
chmod +x git-open
sudo mv git-open /usr/local/bin/Using flakes (recommended):
# one-shot run without installing
nix run github:zhaochunqi/git-open
# install into your profile
nix profile install github:zhaochunqi/git-open
# or pin a release tag
nix profile install github:zhaochunqi/git-open/v2.4.2From a local checkout:
nix build
./result/bin/git-open version
# development shell with Go toolchain
nix developFor users who prefer mise for version management:
mise use -g ubi:zhaochunqi/git-openNavigate to your project's directory and run the following command:
git-open or git open
This will open your repository in the default web browser.
To print the repository name (e.g. github.com/zhaochunqi/git-open):
git-open repo
To run as if started in a different directory (e.g. from a script that isn't inside the repo):
git-open -C /path/to/repo repo
The -C flag mirrors git -C: it may be given multiple times, and a non-absolute path is relative to the previous one.
This project follows Go testing best practices. Here's how to run the tests:
# Run all tests
go test ./...
# Run tests with coverage
go test -cover ./...
# Run benchmark tests
go test -bench=. ./...The tests are organized as follows:
- Unit tests for core functionality
- Integration tests for git repository operations
- Benchmark tests for performance-critical functions
The test suite uses a custom test utility package (internal/testutil) that provides common testing functions and fixtures.
We aim to maintain high test coverage with:
- Multiple test cases for each function
- Edge case testing
- Error condition testing
- Performance benchmarking for critical paths
When adding new features, please ensure:
- Add corresponding test cases
- Include both positive and negative test scenarios
- Add benchmark tests for performance-sensitive functions
- Use the provided test utilities from
internal/testutil
Contributions are welcome! If you have any suggestions, improvements, or bug fixes, please submit a pull request. For major changes, please open an issue first to discuss what you would like to change.