tanyao
Git repo clone and multi-account manager
Install
pnpm i -g tanyao
Usage
-
Init config on first use :
tanyao init
-
Config your
base
directory and git account info. -
Clone repo from anywhere :
tanyao clone https://github.com/xn-sakina/tanyao.git # or tanyao clone git@github.com:xn-sakina/tanyao.git # or ... tanyao clone https://github.com/xn-sakina/tanyao.git ./tmp-path
directory structure :
base ├── github.com │ └── xn-sakina │ └── tanyao └── gitlab.com └── owner └── repo
Config
Open ~/.config/tanyao/config.json
, set up a code base
and git account info :
// ~/.config/tanyao/config.json
{
"base": "/Users/username/Documents/Code",
"codebase": [
{
"url": "github.com",
"username": "github-username",
"email": "i@domain.com"
},
{
"url": "gitlab.com",
"username": "gitlab-username",
"email": "admin@domain.com"
}
],
"alias": {
"github://": "https://github.com/"
}
}
Advanced config
Shell alias (Recommend)
# ~/.zshrc
alias -s git="tanyao clone"
This will make the :
$ https://github.com/xn-sakina/tanyao.git
# equal
$ tanyao clone https://github.com/xn-sakina/tanyao.git
See Suffix aliases (-s) in Zsh learn more.
base
Flexible // ~/.config/tanyao/config.json
{
"base": [
// use `process.env.CODE_BASE`
"{CODE_BASE}/dir",
// multiple `base`, select when clone
"Other/Codebase/Path"
]
}
Options
--progress
alias: -p
Show git clone progress.
Thanks/Inspiration
- projj : Manage repository easily.
License
MIT