Rename project to git-project-manager
All checks were successful
Build and Publish / release (push) Successful in 1m10s

This commit is contained in:
Ryan McGuire 2024-12-27 17:42:44 -05:00
parent 9dd38317b8
commit c78c41f567
51 changed files with 353 additions and 309 deletions

10
.vscode/launch.json vendored
View File

@ -13,6 +13,16 @@
"--remote", "--remote",
"https://gitea.libretechconsulting.com" "https://gitea.libretechconsulting.com"
] ]
},
{
"name": "Generate Docs",
"type": "delve",
"request": "launch",
"program": "${workspaceFolder}",
"args": [
"docs",
"md"
]
} }
] ]
} }

View File

@ -1,14 +1,16 @@
# GitLab Project Manager # Git Project Manager
## Purpose ## Purpose
The goal of this utility is to provide a fuzzy-find method of locating, cloning, 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 using Git projects -- along with your preferred aliases, autocompletion,
and shortcuts. and shortcuts.
This supports GitHub, GitLab, and Gitea remotes.
## Documentation ## Documentation
[Full documentation is available in docs/](./docs/gitlab-project-manager.md) [Full documentation is available in docs/](./docs/git-project-manager.md)
## Functionality ## Functionality
@ -44,8 +46,8 @@ The basic workflow looks like this:
1. Copy `contrib/gpm_func_omz.zsh` into your `~/.oh-my-zsh/custom/` path, or just source from your bashrc/zshrc 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. Generate config file: `gpm config gen --write`
1. You can run this any time to update settings 1. You can run this any time to update settings
1. It will only add one GitLab, so update the file for multiple 1. It will only add one Git remote, so update the file for multiple
1. Run `gpm cache load` (if aliases is in-place, otherwise `gitlab-project-manager cache load`) 1. Run `gpm cache load` (if aliases is in-place, otherwise `git-project-manager cache load`)
### Config Sample ### Config Sample
```yaml ```yaml
@ -81,34 +83,34 @@ Basic usage to prepare your cache, add a project alias (or aliases), and use a p
### Cache Management ### Cache Management
```shell ```shell
% gitlab-project-manager cache -h % git-project-manager cache -h
Contains sub-commands for managing project cache. Contains sub-commands for managing project cache.
The project cache keeps this speedy, without smashing against the GitLab The project cache keeps this speedy, without smashing against the Git remote's
API every time a new project is added / searched for API every time a new project is added / searched for
Usage: Usage:
gitlab-project-manager cache [command] git-project-manager cache [command]
Aliases: Aliases:
cache, a, ln cache, a, ln
Available Commands: Available Commands:
clear Clear GitLab Project Cache clear Clear Git Project Cache
dump Dump GitLab project cache dump Dump Git project cache
load Load GitLab Project Cache load Load Git Project Cache
unlock unlock GitLab project cache unlock unlock Git project cache
Flags: Flags:
-h, --help help for cache -h, --help help for cache
--ttl duration Duration before cache is re-built in go time.Duration format (default 48h0m0s) --ttl duration Duration before cache is re-built in go time.Duration format (default 48h0m0s)
Global Flags: Global Flags:
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --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. Use "git-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 - To update your cache, run `gpm cache load`. You can also specify one or more remotes
@ -119,8 +121,8 @@ Use "gitlab-project-manager cache [command] --help" for more information about a
## TODO ## TODO
- [x] Don't check remote up unless necessary (project list shouldn't require it) - [x] Don't check remote up unless necessary (project list shouldn't require it)
- [ ] Rename to git-project-manager - [x] Rename to git-project-manager
- [ ] Move module from gitlab.sweetwater.com to github.com/rdmcguire - [x] Move module to github.com/rdmcguire
- [ ] Add flag for clone timeout for large repos - [ ] Add flag for clone timeout for large repos
- [ ] Add `gpm cache prune` command - [ ] Add `gpm cache prune` command
- [ ] Fix NPE when cache is reset or project for whatever reason leaves an orphaned alias - [ ] Fix NPE when cache is reset or project for whatever reason leaves an orphaned alias
@ -128,7 +130,7 @@ Use "gitlab-project-manager cache [command] --help" for more information about a
- [ ] Update README for shell completion, aliases, usage - [ ] Update README for shell completion, aliases, usage
- [ ] Make a Makefile - [ ] Make a Makefile
- [ ] Add git repo status to project go (up-to-date, pending commits, etc..) - [ ] Add git repo status to project go (up-to-date, pending commits, etc..)
- [ ] Build pipeline, and link to gitlab registry for a release binary - [ ] Build pipeline, and link to registry for a release binary
- [ ] Add GitHub remote - [ ] Add GitHub remote
- [ ] Package for homebrew - [ ] Package for homebrew
- [x] Make generic, this is any git remote, not just GitLab - [x] Make generic, this is any git remote, not just GitLab

View File

@ -5,6 +5,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/viper" "github.com/spf13/viper"
"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/cache" "gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/cache"
) )
@ -13,7 +14,7 @@ var projectCache *cache.Cache
var cacheCmd = &cobra.Command{ var cacheCmd = &cobra.Command{
Use: "cache", Use: "cache",
Aliases: []string{"a", "ln"}, Aliases: []string{"a", "ln"},
Short: "Manage GitLab project cache", Short: "Manage Git project cache",
Long: cacheCmdLong, Long: cacheCmdLong,
} }

View File

@ -12,7 +12,7 @@ If --clearAliases is provided, will also reset aliases. Use with caution.`
var clearCmd = &cobra.Command{ var clearCmd = &cobra.Command{
Use: "clear", Use: "clear",
Short: "Clear GitLab Project Cache", Short: "Clear Git Project Cache",
PreRun: runCacheCmd, PreRun: runCacheCmd,
PostRun: postCacheCmd, PostRun: postCacheCmd,
Long: longDesc, Long: longDesc,

View File

@ -9,7 +9,7 @@ import (
var dumpCmd = &cobra.Command{ var dumpCmd = &cobra.Command{
Use: "dump", Use: "dump",
Short: "Dump GitLab project cache", Short: "Dump Git project cache",
Long: `Dumps cache to display`, Long: `Dumps cache to display`,
PreRun: runCacheCmd, PreRun: runCacheCmd,
PostRun: postCacheCmd, PostRun: postCacheCmd,

View File

@ -7,8 +7,8 @@ import (
var loadCmd = &cobra.Command{ var loadCmd = &cobra.Command{
Use: "load", Use: "load",
Short: "Load GitLab Project Cache", Short: "Load Git Project Cache",
Long: `Used to initialize or update a new GitLab cache. With thousands Long: `Used to initialize or update a new Git cache. With thousands
of projects, it would be too much work to hit the API every time a user of projects, it would be too much work to hit the API every time a user
wants to find a new project.`, wants to find a new project.`,
PreRun: runCacheCmd, PreRun: runCacheCmd,

View File

@ -8,7 +8,7 @@ import (
var unlockCmd = &cobra.Command{ var unlockCmd = &cobra.Command{
Use: "unlock", Use: "unlock",
Short: "unlock GitLab project cache", Short: "unlock Git project cache",
Long: `unlocks cache to display`, Long: `unlocks cache to display`,
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
initProjectCache(cmd, args) initProjectCache(cmd, args)

View File

@ -6,7 +6,7 @@ import (
var configCmd = &cobra.Command{ var configCmd = &cobra.Command{
Use: "config", Use: "config",
Short: "GitLab Project Manager Configuration", Short: "Git Project Manager Configuration",
Aliases: []string{"conf"}, Aliases: []string{"conf"},
Long: configCmdLong, Long: configCmdLong,
} }

View File

@ -10,7 +10,7 @@ import (
var configShowCmd = &cobra.Command{ var configShowCmd = &cobra.Command{
Use: "show", Use: "show",
Short: "Show GitLab Project Manager Configuration", Short: "Show Git Project Manager Configuration",
Aliases: []string{"s", "dump", "cat", "ls"}, Aliases: []string{"s", "dump", "cat", "ls"},
Run: runConfigShowCmd, Run: runConfigShowCmd,
} }

View File

@ -39,10 +39,10 @@ func runDocsCmd(cmd *cobra.Command, args []string) {
} }
plog.Info("docs generation complete", plog.Args( plog.Info("docs generation complete", plog.Args(
"type", args[0], "docsDir", outDir)) "type", args[0], "docsDir", outDir, "err", err))
} }
func prepareDocsDir(cmd *cobra.Command, outDir string) { func prepareDocsDir(_ *cobra.Command, outDir string) {
_, err := os.Stat(outDir) _, err := os.Stat(outDir)
if err != nil { if err != nil {
err = os.Mkdir(outDir, 0o755) err = os.Mkdir(outDir, 0o755)

View File

@ -10,7 +10,7 @@ import (
var projectCmd = &cobra.Command{ var projectCmd = &cobra.Command{
Use: "project [fuzzy alias search]", Use: "project [fuzzy alias search]",
Short: "Use a GitLab project", Short: "Use a Git project",
Aliases: []string{"proj", "projects", "p"}, Aliases: []string{"proj", "projects", "p"},
Args: cobra.MaximumNArgs(1), Args: cobra.MaximumNArgs(1),
ArgAliases: []string{"alias"}, ArgAliases: []string{"alias"},
@ -60,7 +60,7 @@ func init() {
rootCmd.AddCommand(projectCmd) rootCmd.AddCommand(projectCmd)
} }
func mustHaveProjects(cmd *cobra.Command, args []string) { func mustHaveProjects(cmd *cobra.Command, _ []string) {
if len(projectCache.Projects) == 0 { if len(projectCache.Projects) == 0 {
plog.Fatal("No projects to " + cmd.Name() + ", try running cache load") plog.Fatal("No projects to " + cmd.Name() + ", try running cache load")
} }

View File

@ -6,7 +6,7 @@ import (
var projectAddCmd = &cobra.Command{ var projectAddCmd = &cobra.Command{
Use: "add", Use: "add",
Short: "Add a new GitLab project", Short: "Add a new Git project",
Aliases: []string{"a", "alias"}, Aliases: []string{"a", "alias"},
Long: projAddCmdLong, Long: projAddCmdLong,
Run: projectAddCmdRun, Run: projectAddCmdRun,

View File

@ -11,7 +11,7 @@ import (
var projectGoCmd = &cobra.Command{ var projectGoCmd = &cobra.Command{
Use: "go [fuzzy alias search]", Use: "go [fuzzy alias search]",
Short: "Go to a GitLab project", Short: "Go to a Git project",
Aliases: []string{"goto", "cd"}, Aliases: []string{"goto", "cd"},
Args: cobra.MaximumNArgs(1), Args: cobra.MaximumNArgs(1),
ArgAliases: []string{"project"}, ArgAliases: []string{"project"},
@ -45,7 +45,7 @@ func projectGoCmdRun(cmd *cobra.Command, args []string) {
fmt.Fprintln(os.Stderr, project.GetGitInfo()) fmt.Fprintln(os.Stderr, project.GetGitInfo())
// This should be read by any source command, for instance // This should be read by any source command, for instance
// `cd "$(gitlab-project-manager projects cd somealias)"` // `cd "$(git-project-manager projects cd somealias)"`
fmt.Println(projectCache.GetProjectPath(project)) fmt.Println(projectCache.GetProjectPath(project))
exec.Command("cd", projectCache.GetProjectPath(project)).Run() exec.Command("cd", projectCache.GetProjectPath(project)).Run()
} }

View File

@ -9,7 +9,7 @@ import (
var projectListCmd = &cobra.Command{ var projectListCmd = &cobra.Command{
Use: "list", Use: "list",
Short: "List GitLab Projects", Short: "List Git Projects",
Aliases: []string{"ls", "l"}, Aliases: []string{"ls", "l"},
Long: projListCmdLong, Long: projListCmdLong,
Run: projectListCmdRun, Run: projectListCmdRun,

View File

@ -152,7 +152,7 @@ func getEditor(editor string) (string, error) {
path, err := getEditorPath(editor) path, err := getEditorPath(editor)
if path != "" && err == nil { if path != "" && err == nil {
if !isEditorExecutable(path) { if !isEditorExecutable(path) {
err = errors.New("Editor is not executable") err = errors.New("editor is not executable")
} }
} }
return path, err return path, err

View File

@ -32,7 +32,7 @@ func projectRunCmdRun(cmd *cobra.Command, args []string) {
lang := project.GetLanguage() lang := project.GetLanguage()
if lang == nil { if lang == nil {
plog.Fatal("GitLab isn't sure what language this project is... can't run.") plog.Fatal("Git remote isn't sure what language this project is... can't run.")
} }
plog.Debug(fmt.Sprintf("Project is written in %s, %.2f%% coverage", lang.Name, lang.Percentage)) plog.Debug(fmt.Sprintf("Project is written in %s, %.2f%% coverage", lang.Name, lang.Percentage))

View File

@ -13,7 +13,7 @@ import (
var projectShowCmd = &cobra.Command{ var projectShowCmd = &cobra.Command{
Use: "show [fuzzy alias search]", Use: "show [fuzzy alias search]",
Short: "Show detail for a GitLab project", Short: "Show detail for a Git project",
Aliases: []string{"cat", "s"}, Aliases: []string{"cat", "s"},
Args: cobra.ArbitraryArgs, Args: cobra.ArbitraryArgs,
Long: projShowCmdLong, Long: projShowCmdLong,

View File

@ -4,6 +4,8 @@ import (
"context" "context"
"os" "os"
"os/signal" "os/signal"
"path/filepath"
"regexp"
"strings" "strings"
"github.com/pterm/pterm" "github.com/pterm/pterm"
@ -19,13 +21,15 @@ var (
) )
var rootCmd = &cobra.Command{ var rootCmd = &cobra.Command{
Use: "gitlab-project-manager", Use: "git-project-manager",
Aliases: []string{"gpm"}, Aliases: []string{"gpm"},
Short: "Find and use GitLab projects locally", Short: "Find and use Git projects locally",
Long: rootCmdLong, Long: rootCmdLong,
PersistentPreRun: initRootCmd, PersistentPreRun: initRootCmd,
} }
var configExemptCommands = regexp.MustCompile(`^(doc|conf)`)
// Hook traversal is enabled, so this will be run for all // Hook traversal is enabled, so this will be run for all
// sub-commands regardless of their registered pre-hooks // sub-commands regardless of their registered pre-hooks
func initRootCmd(cmd *cobra.Command, args []string) { func initRootCmd(cmd *cobra.Command, args []string) {
@ -40,7 +44,7 @@ func Execute() {
err := rootCmd.ExecuteContext(ctx) err := rootCmd.ExecuteContext(ctx)
if err != nil { if err != nil {
pterm.Error.Printfln(pterm.LightYellow("Command failed, " + err.Error())) pterm.Error.Printfln("%s", pterm.LightYellow("Command failed, "+err.Error()))
os.Exit(1) os.Exit(1)
} }
} }
@ -77,10 +81,11 @@ func initConfig() {
home, err := os.UserHomeDir() home, err := os.UserHomeDir()
cobra.CheckErr(err) cobra.CheckErr(err)
// Search config in home directory with name ".gitlab-project-manager" (without extension). // Search config in home directory with name ".git-project-manager" (without extension).
viper.AddConfigPath(home + "/.config") configPath := filepath.Join(home, ".config")
viper.AddConfigPath(configPath)
viper.SetConfigType("yaml") viper.SetConfigType("yaml")
viper.SetConfigName("gitlab-project-manager") viper.SetConfigName(getConfigName(configPath))
} }
viper.AutomaticEnv() viper.AutomaticEnv()
@ -100,13 +105,13 @@ func initConfig() {
plog.Error("Failed loading config", plog.Args("err", err)) plog.Error("Failed loading config", plog.Args("err", err))
} }
if len(os.Args) > 0 && strings.HasPrefix(os.Args[1], "conf") { if len(os.Args) > 0 && configExemptCommands.Match([]byte(os.Args[1])) {
plog.Debug("Permitting missing config for config sub-command") plog.Debug("Permitting missing config for config sub-command")
return return
} else if conf.ProjectPath == "" { } else if conf.ProjectPath == "" {
plog.Fatal("Minimal configuration missing, must have projectPath", plog.Args( plog.Fatal("Minimal configuration missing, must have projectPath", plog.Args(
"do", "do",
"Try running `gitlab-project-manager config default > "+defConfigPath, "Try running `git-project-manager config default > "+defConfigPath,
)) ))
} }

View File

@ -25,9 +25,11 @@ const (
) )
const ( const (
defGitlabHost = "https://gitlab.com" defGitlabHost = "https://gitlab.com"
defLogLevel = "info" defLogLevel = "info"
defConfigPath = "~/.config/gitlab-project-manager.yaml" defConfigPath = "~/.config/git-project-manager.yaml"
configName = "git-project-manager"
legacyConfigName = "gitlab-project-manager"
) )
const aliasCmdLong = `Manages project aliases, with options for const aliasCmdLong = `Manages project aliases, with options for
@ -42,14 +44,14 @@ const aliasDeleteCmdLong = `Deletes aliases from projects
project ID can be provided, or will otherwise use fuzzy find` project ID can be provided, or will otherwise use fuzzy find`
const cacheCmdLong = `Contains sub-commands for managing project cache. const cacheCmdLong = `Contains sub-commands for managing project cache.
The project cache keeps this speedy, without smashing against the GitLab The project cache keeps this speedy, without smashing against the Git
API every time a new project is added / searched for` API every time a new project is added / searched for`
const rootCmdLong = `Finds GitLab projects using fuzzy-find, remembering const rootCmdLong = `Finds Git projects using fuzzy-find, remembering
your chosen term for the project as an alias, and offers helpful your chosen term for the project as an alias, and offers helpful
shortcuts for moving around in projects and opening your code` shortcuts for moving around in projects and opening your code`
const projCmdLong = `Switches to a GitLab project by name or alias const projCmdLong = `Switches to a Git project by name or alias
If not found, will enter fzf mode. If not cloned, will clone If not found, will enter fzf mode. If not cloned, will clone
the project locally.` the project locally.`

View File

@ -1,12 +1,20 @@
// This file contains init methods that may be used by
// multiple sub-commands. For instance, the cach and projects
// sub-commands both depend on a cache and may both call the initProjectCache
// func from their PersistentPreRun commands
package cmd package cmd
import ( import (
"fmt"
"os" "os"
"os/user" "os/user"
"path/filepath" "path/filepath"
"strings" "strings"
"github.com/pterm/pterm"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"golang.org/x/sys/unix"
"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/cache" "gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/cache"
"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/config" "gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/config"
"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes" "gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes"
@ -14,15 +22,9 @@ import (
githubremote "gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/github" githubremote "gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/github"
gitlabremote "gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/gitlab" gitlabremote "gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/gitlab"
"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/remote" "gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/remote"
"golang.org/x/sys/unix"
) )
// This file contains init methods that may be used by func initProjectCache(cmd *cobra.Command, _ []string) {
// multiple sub-commands. For instance, the cach and projects
// sub-commands both depend on a cache and may both call the initProjectCache
// func from their PersistentPreRun commands
func initProjectCache(cmd *cobra.Command, args []string) {
var err error var err error
plog.Debug("Running pre-run for cacheCmd") plog.Debug("Running pre-run for cacheCmd")
conf.Cache.File = conf.ProjectPath + "/.cache.yaml" conf.Cache.File = conf.ProjectPath + "/.cache.yaml"
@ -80,11 +82,11 @@ func getRemotes(cmd *cobra.Command) *remotes.Remotes {
return gitRemotes return gitRemotes
} }
func postProjectCache(cmd *cobra.Command, args []string) { func postProjectCache(_ *cobra.Command, _ []string) {
projectCache.Write() projectCache.Write()
} }
func initProjectPath(cmd *cobra.Command, args []string) { func initProjectPath(_ *cobra.Command, _ []string) {
plog.Debug("Running persistent pre-run for rootCmd") plog.Debug("Running persistent pre-run for rootCmd")
var err error var err error
if conf.ProjectPath == "" { if conf.ProjectPath == "" {
@ -98,7 +100,7 @@ func initProjectPath(cmd *cobra.Command, args []string) {
_, err = os.Stat(conf.ProjectPath) _, err = os.Stat(conf.ProjectPath)
if err != nil { if err != nil {
plog.Error("Failed to stat project path, trying to create", plog.Args("error", err)) plog.Error("Failed to stat project path, trying to create", plog.Args("error", err))
if err := os.MkdirAll(conf.ProjectPath, 0750); err != nil { if err = os.MkdirAll(conf.ProjectPath, 0o750); err != nil {
plog.Error("Failed to create project path", plog.Args("error", err)) plog.Error("Failed to create project path", plog.Args("error", err))
os.Exit(1) os.Exit(1)
} }
@ -120,3 +122,22 @@ func resolvePath(path string) (string, error) {
} }
return filepath.Abs(path) return filepath.Abs(path)
} }
func getConfigName(configPath string) string {
// Check existing config
for _, ext := range []string{"yml", "yaml"} {
configFile := fmt.Sprintf("%s/%s.%s", configPath, configName, ext)
legacyConfigFile := fmt.Sprintf("%s/%s.%s", configPath, legacyConfigName, ext)
if _, err := os.Stat(configFile); err == nil {
return configName
} else if _, err := os.Stat(legacyConfigFile); err == nil {
pterm.DefaultLogger.WithWriter(os.Stderr).
Warn(fmt.Sprintf("using legacy config path, suggest using %s/%s.yaml", configPath, configName))
return legacyConfigName
}
}
// Nothing found, do what we want
return configName
}

View File

@ -0,0 +1,30 @@
## git-project-manager
Find and use Git projects locally
### Synopsis
Finds Git projects using fuzzy-find, remembering
your chosen term for the project as an alias, and offers helpful
shortcuts for moving around in projects and opening your code
### Options
```
--config string config file (default is ~/.config/git-project-manager.yaml)
-h, --help help for git-project-manager
--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.
```
### SEE ALSO
* [git-project-manager alias](git-project-manager_alias.md) - Manage project aliases
* [git-project-manager cache](git-project-manager_cache.md) - Manage Git project cache
* [git-project-manager completion](git-project-manager_completion.md) - Generate the autocompletion script for the specified shell
* [git-project-manager config](git-project-manager_config.md) - Git Project Manager Configuration
* [git-project-manager docs](git-project-manager_docs.md) - Generate documentation for git-project-manager
* [git-project-manager project](git-project-manager_project.md) - Use a Git project
###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,4 +1,4 @@
## gitlab-project-manager alias ## git-project-manager alias
Manage project aliases Manage project aliases
@ -16,7 +16,7 @@ listing, adding, and deleting.
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -24,9 +24,9 @@ listing, adding, and deleting.
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager](gitlab-project-manager.md) - Find and use GitLab projects locally * [git-project-manager](git-project-manager.md) - Find and use Git projects locally
* [gitlab-project-manager alias add](gitlab-project-manager_alias_add.md) - Add a project alias * [git-project-manager alias add](git-project-manager_alias_add.md) - Add a project alias
* [gitlab-project-manager alias delete](gitlab-project-manager_alias_delete.md) - Delete a project alias * [git-project-manager alias delete](git-project-manager_alias_delete.md) - Delete a project alias
* [gitlab-project-manager alias list](gitlab-project-manager_alias_list.md) - List Aliases * [git-project-manager alias list](git-project-manager_alias_list.md) - List Aliases
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,4 +1,4 @@
## gitlab-project-manager alias add ## git-project-manager alias add
Add a project alias Add a project alias
@ -8,7 +8,7 @@ Adds a project alias to a project
project ID can be provided, or will otherwise use fuzzy find project ID can be provided, or will otherwise use fuzzy find
``` ```
gitlab-project-manager alias add [flags] git-project-manager alias add [flags]
``` ```
### Options ### Options
@ -21,7 +21,7 @@ gitlab-project-manager alias add [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -29,6 +29,6 @@ gitlab-project-manager alias add [flags]
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager alias](gitlab-project-manager_alias.md) - Manage project aliases * [git-project-manager alias](git-project-manager_alias.md) - Manage project aliases
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,4 +1,4 @@
## gitlab-project-manager alias delete ## git-project-manager alias delete
Delete a project alias Delete a project alias
@ -8,7 +8,7 @@ Deletes aliases from projects
project ID can be provided, or will otherwise use fuzzy find project ID can be provided, or will otherwise use fuzzy find
``` ```
gitlab-project-manager alias delete [fuzzy project or alias] [flags] git-project-manager alias delete [fuzzy project or alias] [flags]
``` ```
### Options ### Options
@ -21,7 +21,7 @@ gitlab-project-manager alias delete [fuzzy project or alias] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -29,6 +29,6 @@ gitlab-project-manager alias delete [fuzzy project or alias] [flags]
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager alias](gitlab-project-manager_alias.md) - Manage project aliases * [git-project-manager alias](git-project-manager_alias.md) - Manage project aliases
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,4 +1,4 @@
## gitlab-project-manager alias list ## git-project-manager alias list
List Aliases List Aliases
@ -7,7 +7,7 @@ List Aliases
Lists all aliases by project Lists all aliases by project
``` ```
gitlab-project-manager alias list [flags] git-project-manager alias list [flags]
``` ```
### Options ### Options
@ -19,7 +19,7 @@ gitlab-project-manager alias list [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -27,6 +27,6 @@ gitlab-project-manager alias list [flags]
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager alias](gitlab-project-manager_alias.md) - Manage project aliases * [git-project-manager alias](git-project-manager_alias.md) - Manage project aliases
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,11 +1,11 @@
## gitlab-project-manager cache ## git-project-manager cache
Manage GitLab project cache Manage Git project cache
### Synopsis ### Synopsis
Contains sub-commands for managing project cache. Contains sub-commands for managing project cache.
The project cache keeps this speedy, without smashing against the GitLab The project cache keeps this speedy, without smashing against the Git
API every time a new project is added / searched for API every time a new project is added / searched for
### Options ### Options
@ -18,7 +18,7 @@ API every time a new project is added / searched for
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -26,10 +26,10 @@ API every time a new project is added / searched for
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager](gitlab-project-manager.md) - Find and use GitLab projects locally * [git-project-manager](git-project-manager.md) - Find and use Git projects locally
* [gitlab-project-manager cache clear](gitlab-project-manager_cache_clear.md) - Clear GitLab Project Cache * [git-project-manager cache clear](git-project-manager_cache_clear.md) - Clear Git Project Cache
* [gitlab-project-manager cache dump](gitlab-project-manager_cache_dump.md) - Dump GitLab project cache * [git-project-manager cache dump](git-project-manager_cache_dump.md) - Dump Git project cache
* [gitlab-project-manager cache load](gitlab-project-manager_cache_load.md) - Load GitLab Project Cache * [git-project-manager cache load](git-project-manager_cache_load.md) - Load Git Project Cache
* [gitlab-project-manager cache unlock](gitlab-project-manager_cache_unlock.md) - unlock GitLab project cache * [git-project-manager cache unlock](git-project-manager_cache_unlock.md) - unlock Git project cache
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,6 +1,6 @@
## gitlab-project-manager cache clear ## git-project-manager cache clear
Clear GitLab Project Cache Clear Git Project Cache
### Synopsis ### Synopsis
@ -9,7 +9,7 @@ Used to reset a project cache, forcing it to be rebuilt.
If --clearAliases is provided, will also reset aliases. Use with caution. If --clearAliases is provided, will also reset aliases. Use with caution.
``` ```
gitlab-project-manager cache clear [flags] git-project-manager cache clear [flags]
``` ```
### Options ### Options
@ -22,7 +22,7 @@ gitlab-project-manager cache clear [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -31,6 +31,6 @@ gitlab-project-manager cache clear [flags]
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager cache](gitlab-project-manager_cache.md) - Manage GitLab project cache * [git-project-manager cache](git-project-manager_cache.md) - Manage Git project cache
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,13 +1,13 @@
## gitlab-project-manager cache dump ## git-project-manager cache dump
Dump GitLab project cache Dump Git project cache
### Synopsis ### Synopsis
Dumps cache to display Dumps cache to display
``` ```
gitlab-project-manager cache dump [flags] git-project-manager cache dump [flags]
``` ```
### Options ### Options
@ -20,7 +20,7 @@ gitlab-project-manager cache dump [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -29,6 +29,6 @@ gitlab-project-manager cache dump [flags]
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager cache](gitlab-project-manager_cache.md) - Manage GitLab project cache * [git-project-manager cache](git-project-manager_cache.md) - Manage Git project cache
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,15 +1,15 @@
## gitlab-project-manager cache load ## git-project-manager cache load
Load GitLab Project Cache Load Git Project Cache
### Synopsis ### Synopsis
Used to initialize or update a new GitLab cache. With thousands Used to initialize or update a new Git cache. With thousands
of projects, it would be too much work to hit the API every time a user of projects, it would be too much work to hit the API every time a user
wants to find a new project. wants to find a new project.
``` ```
gitlab-project-manager cache load [flags] git-project-manager cache load [flags]
``` ```
### Options ### Options
@ -22,7 +22,7 @@ gitlab-project-manager cache load [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -31,6 +31,6 @@ gitlab-project-manager cache load [flags]
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager cache](gitlab-project-manager_cache.md) - Manage GitLab project cache * [git-project-manager cache](git-project-manager_cache.md) - Manage Git project cache
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,13 +1,13 @@
## gitlab-project-manager cache unlock ## git-project-manager cache unlock
unlock GitLab project cache unlock Git project cache
### Synopsis ### Synopsis
unlocks cache to display unlocks cache to display
``` ```
gitlab-project-manager cache unlock [flags] git-project-manager cache unlock [flags]
``` ```
### Options ### Options
@ -20,7 +20,7 @@ gitlab-project-manager cache unlock [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -29,6 +29,6 @@ gitlab-project-manager cache unlock [flags]
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager cache](gitlab-project-manager_cache.md) - Manage GitLab project cache * [git-project-manager cache](git-project-manager_cache.md) - Manage Git project cache
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -0,0 +1,34 @@
## git-project-manager completion
Generate the autocompletion script for the specified shell
### Synopsis
Generate the autocompletion script for git-project-manager for the specified shell.
See each sub-command's help for details on how to use the generated script.
### Options
```
-h, --help help for completion
```
### Options inherited from parent commands
```
--config string config file (default is ~/.config/git-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.
```
### SEE ALSO
* [git-project-manager](git-project-manager.md) - Find and use Git projects locally
* [git-project-manager completion bash](git-project-manager_completion_bash.md) - Generate the autocompletion script for bash
* [git-project-manager completion fish](git-project-manager_completion_fish.md) - Generate the autocompletion script for fish
* [git-project-manager completion powershell](git-project-manager_completion_powershell.md) - Generate the autocompletion script for powershell
* [git-project-manager completion zsh](git-project-manager_completion_zsh.md) - Generate the autocompletion script for zsh
###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,4 +1,4 @@
## gitlab-project-manager completion bash ## git-project-manager completion bash
Generate the autocompletion script for bash Generate the autocompletion script for bash
@ -11,23 +11,23 @@ If it is not installed already, you can install it via your OS's package manager
To load completions in your current shell session: To load completions in your current shell session:
source <(gitlab-project-manager completion bash) source <(git-project-manager completion bash)
To load completions for every new session, execute once: To load completions for every new session, execute once:
#### Linux: #### Linux:
gitlab-project-manager completion bash > /etc/bash_completion.d/gitlab-project-manager git-project-manager completion bash > /etc/bash_completion.d/git-project-manager
#### macOS: #### macOS:
gitlab-project-manager completion bash > $(brew --prefix)/etc/bash_completion.d/gitlab-project-manager git-project-manager completion bash > $(brew --prefix)/etc/bash_completion.d/git-project-manager
You will need to start a new shell for this setup to take effect. You will need to start a new shell for this setup to take effect.
``` ```
gitlab-project-manager completion bash git-project-manager completion bash
``` ```
### Options ### Options
@ -40,7 +40,7 @@ gitlab-project-manager completion bash
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -48,6 +48,6 @@ gitlab-project-manager completion bash
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager completion](gitlab-project-manager_completion.md) - Generate the autocompletion script for the specified shell * [git-project-manager completion](git-project-manager_completion.md) - Generate the autocompletion script for the specified shell
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,4 +1,4 @@
## gitlab-project-manager completion fish ## git-project-manager completion fish
Generate the autocompletion script for fish Generate the autocompletion script for fish
@ -8,17 +8,17 @@ Generate the autocompletion script for the fish shell.
To load completions in your current shell session: To load completions in your current shell session:
gitlab-project-manager completion fish | source git-project-manager completion fish | source
To load completions for every new session, execute once: To load completions for every new session, execute once:
gitlab-project-manager completion fish > ~/.config/fish/completions/gitlab-project-manager.fish git-project-manager completion fish > ~/.config/fish/completions/git-project-manager.fish
You will need to start a new shell for this setup to take effect. You will need to start a new shell for this setup to take effect.
``` ```
gitlab-project-manager completion fish [flags] git-project-manager completion fish [flags]
``` ```
### Options ### Options
@ -31,7 +31,7 @@ gitlab-project-manager completion fish [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -39,6 +39,6 @@ gitlab-project-manager completion fish [flags]
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager completion](gitlab-project-manager_completion.md) - Generate the autocompletion script for the specified shell * [git-project-manager completion](git-project-manager_completion.md) - Generate the autocompletion script for the specified shell
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,4 +1,4 @@
## gitlab-project-manager completion powershell ## git-project-manager completion powershell
Generate the autocompletion script for powershell Generate the autocompletion script for powershell
@ -8,14 +8,14 @@ Generate the autocompletion script for powershell.
To load completions in your current shell session: To load completions in your current shell session:
gitlab-project-manager completion powershell | Out-String | Invoke-Expression git-project-manager completion powershell | Out-String | Invoke-Expression
To load completions for every new session, add the output of the above command To load completions for every new session, add the output of the above command
to your powershell profile. to your powershell profile.
``` ```
gitlab-project-manager completion powershell [flags] git-project-manager completion powershell [flags]
``` ```
### Options ### Options
@ -28,7 +28,7 @@ gitlab-project-manager completion powershell [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -36,6 +36,6 @@ gitlab-project-manager completion powershell [flags]
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager completion](gitlab-project-manager_completion.md) - Generate the autocompletion script for the specified shell * [git-project-manager completion](git-project-manager_completion.md) - Generate the autocompletion script for the specified shell
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,4 +1,4 @@
## gitlab-project-manager completion zsh ## git-project-manager completion zsh
Generate the autocompletion script for zsh Generate the autocompletion script for zsh
@ -13,23 +13,23 @@ to enable it. You can execute the following once:
To load completions in your current shell session: To load completions in your current shell session:
source <(gitlab-project-manager completion zsh) source <(git-project-manager completion zsh)
To load completions for every new session, execute once: To load completions for every new session, execute once:
#### Linux: #### Linux:
gitlab-project-manager completion zsh > "${fpath[1]}/_gitlab-project-manager" git-project-manager completion zsh > "${fpath[1]}/_git-project-manager"
#### macOS: #### macOS:
gitlab-project-manager completion zsh > $(brew --prefix)/share/zsh/site-functions/_gitlab-project-manager git-project-manager completion zsh > $(brew --prefix)/share/zsh/site-functions/_git-project-manager
You will need to start a new shell for this setup to take effect. You will need to start a new shell for this setup to take effect.
``` ```
gitlab-project-manager completion zsh [flags] git-project-manager completion zsh [flags]
``` ```
### Options ### Options
@ -42,7 +42,7 @@ gitlab-project-manager completion zsh [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -50,6 +50,6 @@ gitlab-project-manager completion zsh [flags]
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager completion](gitlab-project-manager_completion.md) - Generate the autocompletion script for the specified shell * [git-project-manager completion](git-project-manager_completion.md) - Generate the autocompletion script for the specified shell
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,6 +1,6 @@
## gitlab-project-manager config ## git-project-manager config
GitLab Project Manager Configuration Git Project Manager Configuration
### Synopsis ### Synopsis
@ -16,7 +16,7 @@ useful for seeding a new config file
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -24,8 +24,8 @@ useful for seeding a new config file
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager](gitlab-project-manager.md) - Find and use GitLab projects locally * [git-project-manager](git-project-manager.md) - Find and use Git projects locally
* [gitlab-project-manager config generate](gitlab-project-manager_config_generate.md) - Generate a default configuration * [git-project-manager config generate](git-project-manager_config_generate.md) - Generate a default configuration
* [gitlab-project-manager config show](gitlab-project-manager_config_show.md) - Show GitLab Project Manager Configuration * [git-project-manager config show](git-project-manager_config_show.md) - Show Git Project Manager Configuration
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,4 +1,4 @@
## gitlab-project-manager config generate ## git-project-manager config generate
Generate a default configuration Generate a default configuration
@ -8,7 +8,7 @@ Produces yaml to stdout that can be used
to seed the configuration file to seed the configuration file
``` ```
gitlab-project-manager config generate [flags] git-project-manager config generate [flags]
``` ```
### Options ### Options
@ -22,7 +22,7 @@ gitlab-project-manager config generate [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -30,6 +30,6 @@ gitlab-project-manager config generate [flags]
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager config](gitlab-project-manager_config.md) - GitLab Project Manager Configuration * [git-project-manager config](git-project-manager_config.md) - Git Project Manager Configuration
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,9 +1,9 @@
## gitlab-project-manager config show ## git-project-manager config show
Show GitLab Project Manager Configuration Show Git Project Manager Configuration
``` ```
gitlab-project-manager config show [flags] git-project-manager config show [flags]
``` ```
### Options ### Options
@ -16,7 +16,7 @@ gitlab-project-manager config show [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -24,6 +24,6 @@ gitlab-project-manager config show [flags]
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager config](gitlab-project-manager_config.md) - GitLab Project Manager Configuration * [git-project-manager config](git-project-manager_config.md) - Git Project Manager Configuration
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,9 +1,9 @@
## gitlab-project-manager docs ## git-project-manager docs
Generate documentation for git-project-manager Generate documentation for git-project-manager
``` ```
gitlab-project-manager docs [flags] git-project-manager docs [flags]
``` ```
### Options ### Options
@ -16,7 +16,7 @@ gitlab-project-manager docs [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -24,6 +24,6 @@ gitlab-project-manager docs [flags]
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager](gitlab-project-manager.md) - Find and use GitLab projects locally * [git-project-manager](git-project-manager.md) - Find and use Git projects locally
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -0,0 +1,36 @@
## git-project-manager project
Use a Git project
### Synopsis
Switches to a Git project by name or alias
If not found, will enter fzf mode. If not cloned, will clone
the project locally.
### Options
```
-h, --help help for project
```
### Options inherited from parent commands
```
--config string config file (default is ~/.config/git-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.
```
### SEE ALSO
* [git-project-manager](git-project-manager.md) - Find and use Git projects locally
* [git-project-manager project add](git-project-manager_project_add.md) - Add a new Git project
* [git-project-manager project go](git-project-manager_project_go.md) - Go to a Git project
* [git-project-manager project list](git-project-manager_project_list.md) - List Git Projects
* [git-project-manager project open](git-project-manager_project_open.md) - Open project in your IDE
* [git-project-manager project run](git-project-manager_project_run.md) - Run the project (e.g. go run .)
* [git-project-manager project show](git-project-manager_project_show.md) - Show detail for a Git project
###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,6 +1,6 @@
## gitlab-project-manager project add ## git-project-manager project add
Add a new GitLab project Add a new Git project
### Synopsis ### Synopsis
@ -8,7 +8,7 @@ Adds a new project to the local project path
uses fuzzy find to locate the project uses fuzzy find to locate the project
``` ```
gitlab-project-manager project add [flags] git-project-manager project add [flags]
``` ```
### Options ### Options
@ -20,7 +20,7 @@ gitlab-project-manager project add [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -28,6 +28,6 @@ gitlab-project-manager project add [flags]
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager project](gitlab-project-manager_project.md) - Use a GitLab project * [git-project-manager project](git-project-manager_project.md) - Use a Git project
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,6 +1,6 @@
## gitlab-project-manager project go ## git-project-manager project go
Go to a GitLab project Go to a Git project
### Synopsis ### Synopsis
@ -11,7 +11,7 @@ will be cloned from source control.
If conf.projects.alwaysPull, a git pull will be ran automatically If conf.projects.alwaysPull, a git pull will be ran automatically
``` ```
gitlab-project-manager project go [fuzzy alias search] [flags] git-project-manager project go [fuzzy alias search] [flags]
``` ```
### Options ### Options
@ -23,7 +23,7 @@ gitlab-project-manager project go [fuzzy alias search] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -31,6 +31,6 @@ gitlab-project-manager project go [fuzzy alias search] [flags]
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager project](gitlab-project-manager_project.md) - Use a GitLab project * [git-project-manager project](git-project-manager_project.md) - Use a Git project
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,6 +1,6 @@
## gitlab-project-manager project list ## git-project-manager project list
List GitLab Projects List Git Projects
### Synopsis ### Synopsis
@ -8,7 +8,7 @@ List locally cloned projects. Optionally
lists all projects in project cache lists all projects in project cache
``` ```
gitlab-project-manager project list [flags] git-project-manager project list [flags]
``` ```
### Options ### Options
@ -21,7 +21,7 @@ gitlab-project-manager project list [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -29,6 +29,6 @@ gitlab-project-manager project list [flags]
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager project](gitlab-project-manager_project.md) - Use a GitLab project * [git-project-manager project](git-project-manager_project.md) - Use a Git project
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,4 +1,4 @@
## gitlab-project-manager project open ## git-project-manager project open
Open project in your IDE Open project in your IDE
@ -11,7 +11,7 @@ If your editor is set in your config file, it will be used, otherwise
one will be found in your path from a list of known defaults. one will be found in your path from a list of known defaults.
``` ```
gitlab-project-manager project open [fuzzy alias search] [flags] git-project-manager project open [fuzzy alias search] [flags]
``` ```
### Options ### Options
@ -26,7 +26,7 @@ gitlab-project-manager project open [fuzzy alias search] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -34,6 +34,6 @@ gitlab-project-manager project open [fuzzy alias search] [flags]
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager project](gitlab-project-manager_project.md) - Use a GitLab project * [git-project-manager project](git-project-manager_project.md) - Use a Git project
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,4 +1,4 @@
## gitlab-project-manager project run ## git-project-manager project run
Run the project (e.g. go run .) Run the project (e.g. go run .)
@ -8,7 +8,7 @@ Runs the current project. Tries to detect
the language and runs accordingly (e.g. go run .) the language and runs accordingly (e.g. go run .)
``` ```
gitlab-project-manager project run [flags] git-project-manager project run [flags]
``` ```
### Options ### Options
@ -20,7 +20,7 @@ gitlab-project-manager project run [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -28,6 +28,6 @@ gitlab-project-manager project run [flags]
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager project](gitlab-project-manager_project.md) - Use a GitLab project * [git-project-manager project](git-project-manager_project.md) - Use a Git project
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,6 +1,6 @@
## gitlab-project-manager project show ## git-project-manager project show
Show detail for a GitLab project Show detail for a Git project
### Synopsis ### Synopsis
@ -8,7 +8,7 @@ Shows detail for a particular project
Will always fuzzy find Will always fuzzy find
``` ```
gitlab-project-manager project show [fuzzy alias search] [flags] git-project-manager project show [fuzzy alias search] [flags]
``` ```
### Options ### Options
@ -21,7 +21,7 @@ gitlab-project-manager project show [fuzzy alias search] [flags]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--config string config file (default is ~/.config/gitlab-project-manager.yaml) --config string config file (default is ~/.config/git-project-manager.yaml)
--logLevel string Default log level -- info, warn, error, debug (default "info") --logLevel string Default log level -- info, warn, error, debug (default "info")
--projectPath string Sets a path for local clones of projects --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. --remote strings Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
@ -29,6 +29,6 @@ gitlab-project-manager project show [fuzzy alias search] [flags]
### SEE ALSO ### SEE ALSO
* [gitlab-project-manager project](gitlab-project-manager_project.md) - Use a GitLab project * [git-project-manager project](git-project-manager_project.md) - Use a Git project
###### Auto generated by spf13/cobra on 19-Dec-2024 ###### Auto generated by spf13/cobra on 27-Dec-2024

View File

@ -1,30 +0,0 @@
## gitlab-project-manager
Find and use GitLab projects locally
### Synopsis
Finds GitLab projects using fuzzy-find, remembering
your chosen term for the project as an alias, and offers helpful
shortcuts for moving around in projects and opening your code
### Options
```
--config string config file (default is ~/.config/gitlab-project-manager.yaml)
-h, --help help for gitlab-project-manager
--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.
```
### SEE ALSO
* [gitlab-project-manager alias](gitlab-project-manager_alias.md) - Manage project aliases
* [gitlab-project-manager cache](gitlab-project-manager_cache.md) - Manage GitLab project cache
* [gitlab-project-manager completion](gitlab-project-manager_completion.md) - Generate the autocompletion script for the specified shell
* [gitlab-project-manager config](gitlab-project-manager_config.md) - GitLab Project Manager Configuration
* [gitlab-project-manager docs](gitlab-project-manager_docs.md) - Generate documentation for git-project-manager
* [gitlab-project-manager project](gitlab-project-manager_project.md) - Use a GitLab project
###### Auto generated by spf13/cobra on 19-Dec-2024

View File

@ -1,34 +0,0 @@
## gitlab-project-manager completion
Generate the autocompletion script for the specified shell
### Synopsis
Generate the autocompletion script for gitlab-project-manager for the specified shell.
See each sub-command's help for details on how to use the generated script.
### Options
```
-h, --help help for completion
```
### Options inherited from parent commands
```
--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.
```
### SEE ALSO
* [gitlab-project-manager](gitlab-project-manager.md) - Find and use GitLab projects locally
* [gitlab-project-manager completion bash](gitlab-project-manager_completion_bash.md) - Generate the autocompletion script for bash
* [gitlab-project-manager completion fish](gitlab-project-manager_completion_fish.md) - Generate the autocompletion script for fish
* [gitlab-project-manager completion powershell](gitlab-project-manager_completion_powershell.md) - Generate the autocompletion script for powershell
* [gitlab-project-manager completion zsh](gitlab-project-manager_completion_zsh.md) - Generate the autocompletion script for zsh
###### Auto generated by spf13/cobra on 19-Dec-2024

View File

@ -1,36 +0,0 @@
## gitlab-project-manager project
Use a GitLab project
### Synopsis
Switches to a GitLab project by name or alias
If not found, will enter fzf mode. If not cloned, will clone
the project locally.
### Options
```
-h, --help help for project
```
### Options inherited from parent commands
```
--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.
```
### SEE ALSO
* [gitlab-project-manager](gitlab-project-manager.md) - Find and use GitLab projects locally
* [gitlab-project-manager project add](gitlab-project-manager_project_add.md) - Add a new GitLab project
* [gitlab-project-manager project go](gitlab-project-manager_project_go.md) - Go to a GitLab project
* [gitlab-project-manager project list](gitlab-project-manager_project_list.md) - List GitLab Projects
* [gitlab-project-manager project open](gitlab-project-manager_project_open.md) - Open project in your IDE
* [gitlab-project-manager project run](gitlab-project-manager_project_run.md) - Run the project (e.g. go run .)
* [gitlab-project-manager project show](gitlab-project-manager_project_show.md) - Show detail for a GitLab project
###### Auto generated by spf13/cobra on 19-Dec-2024

View File

@ -7,10 +7,11 @@ import (
"time" "time"
"github.com/pterm/pterm" "github.com/pterm/pterm"
"gopkg.in/yaml.v3"
"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/config" "gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/config"
"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes" "gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes"
"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects" "gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
"gopkg.in/yaml.v3"
) )
type Cache struct { type Cache struct {
@ -65,7 +66,7 @@ func (c *Cache) LockCache() {
c.log.Info("Attempting to lock cache") c.log.Info("Attempting to lock cache")
c.checkLock() c.checkLock()
file, err := os.OpenFile(c.file+".lock", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0640) file, err := os.OpenFile(c.file+".lock", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o640)
defer file.Close() defer file.Close()
if err != nil { if err != nil {
@ -81,7 +82,7 @@ func (c *Cache) checkLock() {
// Saves the current state of the cache to disk // Saves the current state of the cache to disk
func (c *Cache) write() { func (c *Cache) write() {
file, err := os.OpenFile(c.file, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0640) file, err := os.OpenFile(c.file, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o640)
if err != nil { if err != nil {
c.log.Error("Failed to write cache to disk", c.log.Args("error", err)) c.log.Error("Failed to write cache to disk", c.log.Args("error", err))
} }
@ -92,6 +93,7 @@ func (c *Cache) write() {
c.log.Debug("Cache saved to disk") c.log.Debug("Cache saved to disk")
} }
} }
func (c *Cache) Write() { func (c *Cache) Write() {
c.lock.Lock() c.lock.Lock()
defer c.lock.Unlock() defer c.lock.Unlock()
@ -132,6 +134,7 @@ func (c *Cache) clear(clearAliases bool) {
} }
c.setUpdated() c.setUpdated()
} }
func (c *Cache) Clear(clearAliases bool) { func (c *Cache) Clear(clearAliases bool) {
c.lock.Lock() c.lock.Lock()
defer c.lock.Unlock() defer c.lock.Unlock()
@ -148,7 +151,7 @@ func (c *Cache) refresh(remotes ...string) {
c.LoadRemotes(remotes...) c.LoadRemotes(remotes...)
} }
// Iterates through all GitLab projects the user has access to, updating // Iterates through all Git projects the user has access to, updating
// the project cache where necessary // the project cache where necessary
func (c *Cache) Refresh(remotes ...string) { func (c *Cache) Refresh(remotes ...string) {
c.lock.Lock() c.lock.Lock()
@ -210,5 +213,5 @@ func NewProjectCache(opts *CacheOpts) (*Cache, error) {
} }
func createProjectCache(path string) error { func createProjectCache(path string) error {
return os.WriteFile(path, nil, 0640) return os.WriteFile(path, nil, 0o640)
} }

View File

@ -23,7 +23,7 @@ func (p *Project) GetGitInfo() string {
commit, _ := repo.CommitObject(head.Hash()) commit, _ := repo.CommitObject(head.Hash())
str += "\n" + commit.String() str += "\n" + commit.String()
str += pterm.LightMagenta("GitLab: ") + pterm.Bold.Sprint(p.HTTPURLToRepo) + "\n" str += pterm.LightMagenta("Git: ") + pterm.Bold.Sprint(p.HTTPURLToRepo) + "\n"
if remotes, _ := repo.Remotes(); len(remotes) > 0 { if remotes, _ := repo.Remotes(); len(remotes) > 0 {
str += pterm.LightBlue("Remote: ") + pterm.Bold.Sprint(remotes[0].Config().URLs[0]) str += pterm.LightBlue("Remote: ") + pterm.Bold.Sprint(remotes[0].Config().URLs[0])