Skip to content

Commit b11dcce

Browse files
authored
Merge branch 'main' into linter
2 parents 4bf4127 + 89a30fd commit b11dcce

19 files changed

Lines changed: 900 additions & 140 deletions
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Bug Report
2+
description: Found a bug? Please let us know!
3+
title: "[Bug]"
4+
labels: ["Bug"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Please provide as much information as possible. This will help us resolve the Bug quickly and accurately.
10+
- type: markdown
11+
attributes:
12+
value: ---
13+
- type: textarea
14+
id: what-happened
15+
attributes:
16+
label: What is the problem?
17+
description: |
18+
Description of what needs to be fixed.
19+
placeholder: Tell us what you see!
20+
validations:
21+
required: true
22+
- type: input
23+
id: os
24+
attributes:
25+
label: Operating System
26+
description: What is the affected operating system?
27+
validations:
28+
required: true
29+
- type: input
30+
id: arch
31+
attributes:
32+
label: Architecture Version (x86, x64, arm, etc)
33+
description: (x86, x64, arm, etc)
34+
validations:
35+
required: true
36+
- type: textarea
37+
id: reproduce
38+
attributes:
39+
label: Steps to reproduce
40+
description: |
41+
This includes the steps for reproducing the problem, the expected result, and the actual result.
42+
placeholder: |
43+
1. ...
44+
2. ...
45+
3. ...
46+
validations:
47+
required: true
48+
- type: textarea
49+
id: logs
50+
attributes:
51+
label: Relevant log output
52+
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
53+
render: shell

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Melkeydev Discord
4+
url: https://discord.gg/HHZMSCu
5+
about: Chat with the community.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Feature Request
2+
description: Suggest a new idea for GoVM.
3+
title: "[Feature Request] "
4+
labels: ["enhancement"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Please provide as much information as possible by filling out form below.
10+
- type: markdown
11+
attributes:
12+
value: ---
13+
- type: textarea
14+
id: idea
15+
attributes:
16+
label: Tell us about your feature request
17+
description: |
18+
Describe what you would like govm to be able to do.
19+
validations:
20+
required: true
21+
- type: checkboxes
22+
id: disclaimer
23+
attributes:
24+
label: Disclaimer
25+
description: I have verified that this has not been suggested before.
26+
options:
27+
- label: I agree
28+
required: true

.github/pull_request_template.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.
2+
3+
## Problem/Feature
4+
5+
Please include a description of the problem or feature this PR is addressing.
6+
7+
## Description of Changes:
8+
9+
- Item 1
10+
- Item 2
11+
12+
## Checklist
13+
14+
- [ ] I have self-reviewed the changes being requested

.github/semantic.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
titleOnly: true

.github/workflows/goreleaser.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: goreleaser
2+
on:
3+
push:
4+
tags:
5+
- "v*.*.*"
6+
permissions:
7+
contents: write
8+
jobs:
9+
goreleaser:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
- name: Set up Go
16+
uses: actions/setup-go@v5
17+
with:
18+
go-version: '1.23.x'
19+
- name: Run GoReleaser
20+
uses: goreleaser/goreleaser-action@v6
21+
with:
22+
distribution: goreleaser
23+
version: '~> v2'
24+
args: release --clean
25+
workdir: ./
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
version: 2
2+
before:
3+
hooks:
4+
- go mod tidy
5+
builds:
6+
- binary: "{{ .ProjectName }}"
7+
main: ./
8+
goos:
9+
- darwin
10+
- linux
11+
- windows
12+
goarch:
13+
- amd64
14+
- arm64
15+
env:
16+
- CGO_ENABLED=0
17+
ldflags:
18+
- -s -w -X github.com/melkeydev/govm/internal/utils.Version={{.Version}}
19+
release:
20+
prerelease: auto
21+
universal_binaries:
22+
- replace: true
23+
archives:
24+
- name_template: >
25+
{{- .ProjectName }}_{{- .Version }}_{{- title .Os }}_{{- if eq .Arch "amd64" }}x86_64{{- else if eq .Arch "386" }}i386{{- else }}{{ .Arch }}{{ end }}{{- if .Arm }}v{{ .Arm }}{{ end -}}
26+
format_overrides:
27+
- goos: windows
28+
format: zip
29+
builds_info:
30+
group: root
31+
owner: root
32+
files:
33+
- README.md
34+
- LICENSE
35+
checksum:
36+
name_template: 'checksums.txt'
37+
38+
brews:
39+
- name: "{{ .ProjectName }}"
40+
homepage: "https://github.com/melkeydev/govm"
41+
description: "GoVM - Go Version Manager"
42+
license: "MIT"
43+
repository:
44+
owner: "melkeydev"
45+
name: "homebrew-tap"
46+
token: "{{ .Env.TAP_GITHUB_TOKEN }}"
47+
commit_author:
48+
name: goreleaserbot
49+
email: goreleaser@goreleaser.com
50+
directory: Formula
51+
install: |
52+
bin.install "{{ .ProjectName }}"

CONTRIBUTING.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Contributing
2+
3+
Thanks for helping make GoVM better!
4+
- [Contributing](#contributing)
5+
- [Design Principles](#design-principles)
6+
- [Report an Issue](#report-an-issue)
7+
- [Contributing Code with Pull Requests](#contributing-code-with-pull-requests)
8+
- [Requirements](#requirements)
9+
- [Licensing](#licensing)
10+
11+
## Design Principles
12+
13+
Contributions to GoVM should align with the project’s design principles:
14+
15+
* Maintain backwards compatibility whenever possible.
16+
17+
## Report an Issue
18+
19+
If you have run into a bug or want to discuss a new feature, please [file an issue](https://github.com/Melkeydev/govm/issues).
20+
21+
## Contributing Code with Pull Requests
22+
23+
GoVM uses [Github pull requests](https://github.com/Melkeydev/govm/pulls). Feel free to fork, hack away at your changes and submit.
24+
25+
### Requirements
26+
27+
* All commands and functionality should be documented appropriately
28+
* All new functionality/features should have appropriate unit testing
29+
30+
GoVM strives to have a consistent set of documentation that matches the command structure and any new functionality must have accompanying documentation in the PR.
31+
32+
## Licensing
33+
34+
See the [LICENSE](https://github.com/melkeydev/govm/blob/main/LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2025 Melkeydev
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
![logo](./assets/govm_readme.png)
2+
3+
# GoVM - Go Version Manager
4+
5+
GoVM is a modern tool for managing multiple Go versions on your system. It features both a clean Terminal UI (TUI) and a command-line interface for easy installation and switching between Go versions.
6+
7+
## Features
8+
9+
- Beautiful TUI built with [Charm Bubbletea](https://github.com/charmbracelet/bubbletea)
10+
- Command-line interface for quick operations
11+
- Install any available Go version directly from go.dev
12+
- Switch between installed versions with a single command
13+
- Supports partial version numbers (e.g., `1.21` for latest 1.21.x)
14+
- Works on macOS and Linux. Looking for testing for Windows
15+
16+
## Installation
17+
18+
### Prerequisites
19+
20+
- Go 1.18 or higher
21+
22+
### Install
23+
24+
```bash
25+
go install github.com/melkeydev/govm@latest
26+
```
27+
28+
Then in a new terminal run:
29+
30+
```bash
31+
govm
32+
```
33+
34+
To launch the TUI
35+
36+
## First-Time Setup
37+
38+
When you first run GoVM, it will guide you through adding the required directory to your PATH. This is a one-time setup that enables GoVM to manage your Go versions.
39+
40+
### On Linux/macOS
41+
42+
Add this to your shell configuration file (~/.bashrc, ~/.zshrc, etc.):
43+
44+
```bash
45+
export PATH="$HOME/.govm/shim:$PATH"
46+
```
47+
48+
Or run this command to add it automatically:
49+
50+
```bash
51+
echo 'export PATH="$HOME/.govm/shim:$PATH"' >> ~/.bashrc # or ~/.zshrc
52+
```
53+
54+
Then reload your shell configuration:
55+
56+
```bash
57+
source ~/.bashrc # or whichever file you modified
58+
```
59+
60+
### On Windows
61+
62+
Add the shim directory to your PATH:
63+
64+
```cmd
65+
setx PATH "%USERPROFILE%\.govm\shim;%PATH%"
66+
```
67+
68+
Then restart your terminal.
69+
70+
## Usage
71+
72+
GoVM can be used in two ways: via the interactive TUI or through command-line commands.
73+
74+
### Terminal User Interface (TUI)
75+
76+
Launch the interactive TUI by running govm without arguments:
77+
78+
```bash
79+
govm
80+
```
81+
82+
#### Navigation
83+
84+
- Use the arrow keys to navigate through the list of versions
85+
- Press `i` to install the selected version
86+
- Press `u` to use/switch to the selected version
87+
- Press `r` to refresh the list of available versions
88+
- Press `Tab` to switch between "Available Versions" and "Installed Versions" views
89+
- Press `q` to quit
90+
91+
### Command Line Interface
92+
93+
```bash
94+
# Install a Go version (latest patch for the specified version)
95+
govm install 1.21 # Installs the latest Go 1.21.x
96+
97+
# Switch to a Go version
98+
govm use 1.20 # Switches to the latest installed Go 1.20.x
99+
100+
# List installed versions
101+
govm list
102+
103+
# Show help
104+
govm help
105+
106+
# Launch the TUI
107+
govm
108+
```
109+
110+
## How It Works
111+
112+
GoVM downloads Go versions from the official go.dev website and installs them in `~/.govm/versions`. It uses a "shim" approach:
113+
114+
- It creates wrapper scripts in `~/.govm/shim` that point to the selected Go version
115+
- When you run `go` or other Go commands, these wrappers execute the proper version
116+
- Switching versions simply updates these wrappers to point to a different installation
117+
118+
This ensures a seamless experience without needing to manually update environment variables or source scripts each time you switch versions.
119+
120+
### Install from source
121+
122+
```bash
123+
# Clone the repository
124+
git clone https://github.com/melkeydev/govm.git
125+
cd govm
126+
127+
# Build and install
128+
go build -o govm
129+
```
130+
131+
Then place the binary somewhere in your PATH.
132+
133+
### Homebrew
134+
135+
Add Homebrew repository to the system:
136+
137+
```bash
138+
brew tap melkeydev/tap
139+
```
140+
141+
You can then install your package with:
142+
143+
```bash
144+
brew install govm
145+
```
146+
147+
## Dependencies
148+
149+
- [Charm Bubbletea](https://github.com/charmbracelet/bubbletea) - Terminal UI framework
150+
- [Charm Bubbles](https://github.com/charmbracelet/bubbles) - UI components
151+
- [Lipgloss](https://github.com/charmbracelet/lipgloss) - UI styling

0 commit comments

Comments
 (0)