tanyao
v1.2.0
Published
Git repo clone and multi-account manager
Downloads
13
Maintainers
Readme
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 [email protected]: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": "[email protected]"
},
{
"url": "gitlab.com",
"username": "gitlab-username",
"email": "[email protected]"
}
],
"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.
Flexible base
// ~/.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.
--depth
alias: -d
Git clone depth.
Thanks/Inspiration
- projj : Manage repository easily.
License
MIT