diff --git a/README.md b/README.md index 736766f..3fc593d 100644 --- a/README.md +++ b/README.md @@ -45,32 +45,92 @@ The basic workflow looks like this: ### Config Sample ```yaml -gitlabs: - - Host: https://gitlab.sweetwater.com - Token: - Name: Sweetwater GitLab +remotes: + - host: https://github.com/rdmcguire # add user for multiple keys + token: + name: github-rdmcguire + type: "github" # github, gitlab, gitea supported + cloneProto: ssh logLevel: info cache: ttl: 168h load: - ownerOnly: false + ownerOnly: false # if true, only owned projects will be indexed ``` +## Usage + +### Global Flags + +- The `--remote` flag limits all subcommands to one or more specified remotes +- The `--logLevel [debug|error|info|warn]` flag sets logging, but is permanent in the config file + +### Basic Usage + +Basic usage to prepare your cache, add a project alias (or aliases), and use a project: + +1. `gpm cache load` +1. `gpm project add` + 1. select with fuzzy search, add extra aliases if preferred +1. `gpm project [go|open] ` + 1. Open will launch your editor, go will change directories, cloning if necessary + +### Cache Management + +```shell +% gitlab-project-manager cache -h +Contains sub-commands for managing project cache. +The project cache keeps this speedy, without smashing against the GitLab +API every time a new project is added / searched for + +Usage: + gitlab-project-manager cache [command] + +Aliases: + cache, a, ln + +Available Commands: + clear Clear GitLab Project Cache + dump Dump GitLab project cache + load Load GitLab Project Cache + unlock unlock GitLab project cache + +Flags: + -h, --help help for cache + --ttl duration Duration before cache is re-built in go time.Duration format (default 48h0m0s) + +Global Flags: + --config string config file (default is ~/.config/gitlab-project-manager.yaml) + --logLevel string Default log level -- info, warn, error, debug (default "info") + --projectPath string Sets a path for local clones of projects + --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited. + +Use "gitlab-project-manager cache [command] --help" for more information about a command. +``` + +- To update your cache, run `gpm cache load`. You can also specify one or more remotes + with `--remote [host]` either multiple times or comma delimited. Command completion works. +- To view basic cache stats, run `gpm cache dump` +- To dump cache projects and any aliases that are set, run `gpm cache dump -f` optionally filtering with `--remote` flags + ## TODO -- [ ] Make generic, this is any git remote, not just GitLab - - [x] Add Gitea support - - [ ] Add GitHub support - - [x] Remove separate gitlab/gitea logic and keys, stop supporting legacy keys - - [x] Rename --gitlab flag to --remote -- [ ] Option to prune missing after the load is complete +- [ ] Rename to git-project-manager +- [ ] Move module from gitlab.sweetwater.com to github.com/rdmcguire - [ ] Add flag for clone timeout for large repos +- [ ] Add `gpm cache prune` command - [ ] Fix NPE when cache is reset or project for whatever reason leaves an orphaned alias - [ ] Add TTL check to cache load, and add -f / --force flag to re-build regardless - [ ] Update README for shell completion, aliases, usage - [ ] Make a Makefile - [ ] Add git repo status to project go (up-to-date, pending commits, etc..) - [ ] Build pipeline, and link to gitlab registry for a release binary -- [ ] Brew package and GitHub +- [ ] Add GitHub remote +- [ ] Package for homebrew +- [x] Make generic, this is any git remote, not just GitLab + - [x] Add Gitea support + - [x] Add GitHub support + - [x] Remove separate gitlab/gitea logic and keys, stop supporting legacy keys + - [x] Rename --gitlab flag to --remote - [x] Add option to select individual remote for `gpm cache load` - [x] Use multi-gitlab by default in config init - [x] Update docs for multi-gitlab