Skip to content
/ gogh Public

Gogh is a tool to manage GitHub repositories efficiently, inspired by `ghq`

License

Notifications You must be signed in to change notification settings

kyoh86/gogh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

52401b7 · Mar 24, 2025
Mar 16, 2025
Mar 5, 2025
Mar 5, 2025
Jun 3, 2021
Mar 5, 2025
Mar 5, 2025
Feb 14, 2025
Feb 27, 2021
Oct 26, 2024
Oct 26, 2024
Nov 15, 2020
Jul 28, 2024
Feb 22, 2025
May 5, 2021
Feb 9, 2025
Mar 24, 2025
Mar 24, 2025
Dec 18, 2024
Feb 14, 2025
Feb 27, 2021
Jun 3, 2021
May 5, 2021
Apr 22, 2021
May 5, 2021
Feb 14, 2025
Feb 14, 2025
Feb 9, 2025
Feb 14, 2025
Mar 5, 2025
Feb 14, 2025
Feb 14, 2025
Nov 13, 2023
Feb 14, 2025
Feb 9, 2025

Repository files navigation

Gogh

Gogh is a tool to manage GitHub repositories efficiently, inspired by ghq.

PkgGoDev Go Report Card Coverage Status GitHub release

Description

gogh is forked from ghq.

$ gogh list
github.com/kyoh86/git-branches
github.com/kyoh86/gogh
github.com/kyoh86/vim-wipeout
github.com/kyoh86-tryouts/bare
github.com/nvim-telescope/telescope.nvim
...

gogh provides a way to organize remote repository clones, like go get does. When you clone a remote repository by gogh get, gogh makes a directory under a specific root directory (by default ~/go/src) using the remote repository URL's host and path. And creating new one by gogh new, gogh make both of a local project and a remote repository.

$ gogh get https://github.com/kyoh86/gogh
# Runs `git clone https://github.com/kyoh86/gogh ~/go/src/github.com/kyoh86/gogh`

You can also do:

  • List projects (local repositories) (gogh list).
  • Create a new project (gogh new).
  • Fork a repository (gogh fork).
  • Clone a repository (gogh clone).
  • Delete a project (gogh delete).
  • List remote repositories (gogh repos).

See #Available commands for more information.

Install

For Golang developers

Ensure you have Go installed before running the following commands.

$ go install github.com/kyoh86/gogh/v3/cmd/gogh

If you want zsh-completions, you can create completions file like this:

$ echo "autoload -Uz compinit && compinit" >> ~/.zshrc
$ gogh completion zsh > $fpath[1]/_gogh

Homebrew/Linuxbrew

$ brew tap kyoh86/tap
$ brew update
$ brew install kyoh86/tap/gogh

Setup

gogh manages repositories in multiple servers that is pairs of an owner and a host name. To login in new server or logout, you should use auth login.

Available commands

See usage/gogh.md for detailed command usage.

Show projects

Command Description
gogh list List local projects
gogh repos List remote repositories
gogh cwd Print the project in current working directory

Manipulate projects

Command Description
gogh create Create a new project with a remote repository
gogh delete Delete a repository with a remote repository
gogh fork Fork a repository
gogh clone Clone a repository to local

Others

Command Description
gogh roots Manage roots
gogh auth Manage Authentications
gogh bundle Manage bundle
gogh help Help about any command

Use gogh [command] --help for more information about a command. Or see the manual in usage/gogh.md.

Environment variables

  • GOGH_CONFIG_PATH: The path to the configuration file. Default: ${XDG_CONFIG_HOME}/gogh/config.yaml.
  • GOGH_FLAG_PATH: The path to the configuration file. Default: ${XDG_CONFIG_HOME}/gogh/flag.yaml.
  • GOGH_TOKENS_PATH: The path to the configuration file. Default: ${XDG_CACHE_HOME}/gogh/tokens.yaml.

Configurations

Roots

gogh manages projects under the roots directories.

See also: Directory structures

You can change the roots with roots add <path> or roots remove <path> and see all of them by roots list. gogh uses the first one as the default one, create, fork or clone will put a local project under it. If you want to change the default, use roots set-default <path>.

Default: ~/Projects.

Default Host and Owner

When you specify a repository with ambiguous user or host, it will be interpolated with a default value. You may set them with auth set-default.

If you set them like below:

key value
host example.com
owner kyoh86

ambiguous repository names will be interpolated:

Ambiguous name Interpolated name
gogh example.com/kyoh86/gogh
foobar/gogh example.com/foobar/gogh

NOTE: default host will be "github.com" if you don't set it.

Directory structures

Local projects are placed under gogh.roots with named `host/user/repo.

~/Projects
+-- github.com/
    |-- google/
    |   +-- go-github/
    |-- kyoh86/
    |   +-- gogh/
    +-- alecthomas/
        +-- kingpin/

LICENSE

MIT License

This software is released under the MIT License, see LICENSE. And this software is based on ghq.