2023-12-04 21:53:01 +00:00
|
|
|
# GitLab Project Manager
|
|
|
|
|
2023-12-10 16:41:08 +00:00
|
|
|
## Purpose
|
|
|
|
|
|
|
|
The goal of this utility is to provide a fuzzy-find method of locating, cloning,
|
|
|
|
and using GitLab projects -- along with your preferred aliases, autocompletion,
|
|
|
|
and shortcuts.
|
|
|
|
|
|
|
|
## Functionality
|
|
|
|
|
|
|
|
Fuzzy as F_ck. This program will try like hell to help you find a project,
|
|
|
|
and once you've found it, will remember your preference along with whatever crazy
|
|
|
|
thing your lizard brain wants to call it.
|
|
|
|
|
|
|
|
Do you think of a project called terraform as infra-stuff? No problem, just let
|
|
|
|
gpm know that and it'll remember.
|
|
|
|
|
|
|
|
The basic workflow looks like this:
|
|
|
|
|
2024-01-14 15:33:15 +00:00
|
|
|
1. **Config** -- generate a config file
|
2023-12-10 16:41:08 +00:00
|
|
|
1. **Cache** -- load your cache to make things super quick
|
2023-12-10 16:43:31 +00:00
|
|
|
1. you only need to update it if there are new projects the cache is unaware of
|
|
|
|
1. **Add** -- find your project, give it any extra aliases you want
|
2023-12-10 16:45:21 +00:00
|
|
|
1. run `gpm project add` (or `padd` if using the provided shell defaults)
|
2023-12-10 16:43:31 +00:00
|
|
|
1. **Go** -- go to your project, fuzzy searching by alias
|
2023-12-10 16:45:21 +00:00
|
|
|
1. clones your project if that's never been done
|
2023-12-10 16:43:31 +00:00
|
|
|
1. the provided `pgo` func makes it easy
|
|
|
|
1. **Open** -- rather than simply changing directories to a project, open it in your IDE
|
|
|
|
1. **Manage** -- fine-tune your aliases, making it easy to nail them without fuzzy stuff
|
2023-12-10 16:45:21 +00:00
|
|
|
1. if you are lazy in your aliases, you'll be fuzzy finding a lot
|
2023-12-10 16:43:31 +00:00
|
|
|
1. match your alias exactly (or have only one result) and you go there right away
|
|
|
|
1. positive reinforcement given for solid alias behavior
|
|
|
|
1. manage aliases using `gpm alias add` or `gpm alias delete`
|
|
|
|
1. **List** -- get a list of your configured projects any time with `plist`
|
|
|
|
1. **Reward** -- buy the author a beer, because this thing is a time saver
|
2023-12-10 16:41:08 +00:00
|
|
|
|
2023-12-11 15:39:48 +00:00
|
|
|
## Installing
|
|
|
|
|
|
|
|
1. Install into your go path by running `go install .`
|
|
|
|
1. Copy `contrib/gpm_func_omz.zsh` into your `~/.oh-my-zsh/custom/` path, or just source from your bashrc/zshrc
|
|
|
|
1. Generate config file: `gpm config gen --write`
|
|
|
|
1. You can run this any time to update settings
|
2024-01-14 15:33:15 +00:00
|
|
|
1. It will only add one GitLab, so update the file for multiple
|
2023-12-11 15:39:48 +00:00
|
|
|
1. Run `gpm cache load` (if aliases is in-place, otherwise `gitlab-project-manager cache load`)
|
|
|
|
|
|
|
|
### Config Sample
|
|
|
|
```yaml
|
2024-01-14 15:33:15 +00:00
|
|
|
gitlabs:
|
|
|
|
- Host: https://gitlab.sweetwater.com
|
|
|
|
Token: <your token here>
|
|
|
|
Name: Sweetwater GitLab
|
2023-12-11 15:39:48 +00:00
|
|
|
logLevel: info
|
|
|
|
cache:
|
|
|
|
ttl: 168h
|
2023-12-11 15:41:24 +00:00
|
|
|
load:
|
2023-12-11 15:39:48 +00:00
|
|
|
ownerOnly: false
|
|
|
|
```
|
2023-12-10 05:05:39 +00:00
|
|
|
## TODO
|
|
|
|
|
2024-01-14 15:33:15 +00:00
|
|
|
- [x] Use multi-gitlab by default in config init
|
|
|
|
- [x] Update docs for multi-gitlab
|
|
|
|
- [x] Remove all references to old keys
|
|
|
|
- [x] Add auto-completion helper for --gitlab flag
|
|
|
|
- [x] Fix initial setup requiring project path, and set https:// as default for gitlab host
|
2023-12-10 16:17:04 +00:00
|
|
|
- [ ] Fix NPE when cache is reset or project for whatever reason leaves an orphaned alias
|
2024-01-14 15:33:15 +00:00
|
|
|
- [x] Add config setters and getters
|
2023-12-10 16:17:04 +00:00
|
|
|
- [ ] Add TTL check to cache load, and add -f / --force flag to re-build regardless
|
|
|
|
- [ ] For each project loaded, check if it is the same, and do nothing
|
2024-01-14 15:33:15 +00:00
|
|
|
- [x] prevents clobbering cache on a partial update
|
|
|
|
- [x] track already loaded projects to diff after load
|
2023-12-10 16:17:04 +00:00
|
|
|
- [ ] should prune missing after the load is complete
|
2024-01-14 15:33:15 +00:00
|
|
|
- [x] Add open command
|
|
|
|
- [x] config should exist for editor (vim, code, etc..)
|
2023-12-10 16:17:04 +00:00
|
|
|
- [ ] Update README for shell completion, aliases, usage
|
2024-01-14 15:33:15 +00:00
|
|
|
- [x] Add fzf to `plist` / `gpm projects list`
|
2023-12-10 16:17:04 +00:00
|
|
|
- [ ] Make a Makefile
|
|
|
|
- [ ] Add git repo status to project go (up-to-date, pending commits, etc..)
|
2023-12-11 20:42:50 +00:00
|
|
|
- [x] Update `gpm project show` with pterm box like `gpm project list`
|
2023-12-11 15:39:48 +00:00
|
|
|
- [ ] Build pipeline, and link to gitlab registry for a release binary
|
|
|
|
- [ ] Brew package and GitHub
|
2023-12-10 16:17:04 +00:00
|
|
|
- [x] Merge aliases together for same project when selecting
|
2023-12-10 16:50:47 +00:00
|
|
|
- [x] If after merging there is only one project, go there by default
|
2023-12-10 05:05:39 +00:00
|
|
|
|