tanyao
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

tanyao

Git repo clone and multi-account manager

Install

  pnpm i -g tanyao

Usage

  1. Init config on first use :

      tanyao init
  2. Config your base directory and git account info.

  3. 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.

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

Package Sidebar

Install

npm i tanyao

Weekly Downloads

56

Version

1.2.0

License

MIT

Unpacked Size

82.8 kB

Total Files

22

Last publish

Collaborators

  • fz6m