Multiple Repo Manager
multi
is a CLI for managing node packages across multiple Github organizations and repositories. Autocomplete and user defined aliases are supported for linux and osx users.
Getting Started
Install
$ npm install -g multiple-repo-manager
$ multi --help [COMMAND]
USAGE
$ multi COMMAND
...
Setup
In order for multi
to work, you must always have your github access token set in the environment - either as GH_TOKEN
or GITHUB_TOKEN
. See the github docs for how to do this.
After you've set your github token, run multi setup
. This command will prompt you for the directory that you want your repos to live. It defaults to ~/repos
.
Adding Organizations and Repositories
Once you've run multi setup
, you're ready to begin adding organizations and/or repositories:
To add an organization:
multi add my-github-org
To add a repository:
multi add my-github-org/my-repo
Tasks
One the main advantages of using multi
is that you can define your own tasks. Theses tasks are stored at ~/.mutli/tasks.yml
and can set be set and unset using the multi task
command.
Examples
open-circle: multi exec . -- open https://app.circleci.com/pipelines/github/{repo.fullName}
done-with-branch: |
local current_branch=$(git rev-parse --abbrev-ref HEAD)
multi exec . -- git checkout {repo.defaultBranch}
git pull
git remote prune origin
git branch -D $current_branch
Commands
multi add ENTITY
Add a github org or repo. Requires GH_TOKEN to be set in the environment.
USAGE
$ multi add ENTITY [-c <value>] [-d] [-f] [--method ssh|https]
ARGUMENTS
ENTITY Github org, repo, or url to add
FLAGS
-c, --concurrency=<value> Number of concurrent clones. Defaults to the number of repositories.
-d, --dry-run Print what would be done without doing it.
-f, --force Force overwrite of existing repos.
--method=<option> [default: ssh] Method to use for cloning.
<options: ssh|https>
DESCRIPTION
Add a github org or repo. Requires GH_TOKEN to be set in the environment.
EXAMPLES
Add a github org
$ multi add my-github-org
Add a github org by url
$ multi add https://github.com/my-github-org
Add a github repo by name
$ multi add my-github-org/my-repo
Add a github repo by url
$ multi add https://github.com/my-github-org/my-repo
See code: src/commands/add.ts
multi alias KEYVALUE
Set or unset an alias
USAGE
$ multi alias KEYVALUE...
ARGUMENTS
KEYVALUE... alias=value
DESCRIPTION
Set or unset an alias
Provide an empty to value to unset the alias
EXAMPLES
Set an alias
$ multi alias myrepo=my-org/my-repo
Unset an alias
$ multi alias myrepo=
See code: src/commands/alias.ts
multi cd REPO
cd into a repository.
USAGE
$ multi cd REPO
ARGUMENTS
REPO Name of repository.
DESCRIPTION
cd into a repository.
See code: src/commands/cd.ts
multi diff ORG
Show repositories in an org that are not cloned locally. Requires GH_TOKEN to be set in the environment.
USAGE
$ multi diff ORG
ARGUMENTS
ORG Github org
DESCRIPTION
Show repositories in an org that are not cloned locally. Requires GH_TOKEN to be set in the environment.
EXAMPLES
$ multi diff my-github-org
See code: src/commands/diff.ts
multi exec REPO
Execute a command or script in a repository.
USAGE
$ multi exec REPO...
ARGUMENTS
REPO... Name of repository to execute in. Use "." to specify the current working directory.
DESCRIPTION
Execute a command or script in a repository.
ALIASES
$ multi x
EXAMPLES
Execute a script in a different repository
$ multi exec my-repo -- yarn compile
Execute a script in the current working directory
$ multi exec . -- yarn compile
Interpolate values into command execution
$ multi exec . -- open https://app.circleci.com/pipelines/github/{repo.fullName}
See code: src/commands/exec.ts
multi list
List all repositories.
USAGE
$ multi list
DESCRIPTION
List all repositories.
ALIASES
$ multi ls
See code: src/commands/list.ts
multi open REPO
Open a repository in github.
USAGE
$ multi open REPO [-f <value> | -t actions|discussions|issues|pulls|pulse|security|settings|wiki]
ARGUMENTS
REPO [default: .] Name of repository.
FLAGS
-f, --file=<value> File to open in github.
-t, --tab=<option> Tab to open in github.
<options: actions|discussions|issues|pulls|pulse|security|settings|wiki>
DESCRIPTION
Open a repository in github.
ALIASES
$ multi o
EXAMPLES
Open the main page of a github repository
$ multi open my-repo
Open the issues tab of a github repository
$ multi open my-repo --tab issues
Open a specific file in a github repository
$ multi open my-repo --file path/to/my/code.ts
See code: src/commands/open.ts
multi org discussions ORG
List all open discussions for added repos in an org. Requires GH_TOKEN to be set in the environment.
USAGE
$ multi org discussions ORG [-b created|repo|author|updated] [-s <value>]
ARGUMENTS
ORG Github org
FLAGS
-b, --sort-by=<option> [default: repo] Sort by
<options: created|repo|author|updated>
-s, --since=<value> Only show discussions updated after this date
DESCRIPTION
List all open discussions for added repos in an org. Requires GH_TOKEN to be set in the environment.
EXAMPLES
$ multi org discussions my-github-org --since 1/1/24
$ multi org discussions my-github-org --since friday
See code: src/commands/org/discussions.ts
multi org issues ORG
List all open issues for added repos in an org. Requires GH_TOKEN to be set in the environment.
USAGE
$ multi org issues ORG -s <value> [-b created|repo|author|updated]
ARGUMENTS
ORG Github org
FLAGS
-b, --sort-by=<option> [default: repo] Sort by
<options: created|repo|author|updated>
-s, --since=<value> (required) Only show issues updated after this date
DESCRIPTION
List all open issues for added repos in an org. Requires GH_TOKEN to be set in the environment.
EXAMPLES
$ multi org issues my-github-org --since 1/1/24
$ multi org issues my-github-org --since friday
See code: src/commands/org/issues.ts
multi org list ORGS
Show all repositories in the org. Requires GH_TOKEN to be set in the environment.
USAGE
$ multi org list ORGS...
ARGUMENTS
ORGS... Github org
DESCRIPTION
Show all repositories in the org. Requires GH_TOKEN to be set in the environment.
ALIASES
$ multi list org
EXAMPLES
$ multi org list my-github-org
See code: src/commands/org/list.ts
multi org overview ORG
Provides issue, pull request, and discussion counts for the request repositories. Requires GH_TOKEN to be set in the environment.
USAGE
$ multi org overview ORG [--json] [-d] [-b repo|issues|pulls] [-f <value>]
ARGUMENTS
ORG Github org
FLAGS
-b, --sort-by=<option> [default: repo] Sort by
<options: repo|issues|pulls>
-d, --discussions Include discussions
-f, --filter=<value>... Filter out repositories by minimatch pattern
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Provides issue, pull request, and discussion counts for the request repositories. Requires GH_TOKEN to be set in the
environment.
EXAMPLES
Get an overview of the issues and PRs for an org
$ multi org overview my-github-org
Get an overview of the issues, PRs, and discussions for an org
$ multi org overview my-github-org --discussions
Filter out repositories by minimatch pattern
$ multi org overview my-github-org --filter "my-repo-*"
See code: src/commands/org/overview.ts
multi org pulls ORG
List all open pull requests for added repos in an org. Requires GH_TOKEN to be set in the environment.
USAGE
$ multi org pulls ORG [-i | -d] [-b created|repo|author] [-s <value>]
ARGUMENTS
ORG Github org
FLAGS
-b, --sort-by=<option> [default: repo] Sort by
<options: created|repo|author>
-d, --only-dependabot Only show dependabot
-i, --[no-]ignore-dependabot Ignore dependabot
-s, --since=<value> Only show pull requests created after this date
DESCRIPTION
List all open pull requests for added repos in an org. Requires GH_TOKEN to be set in the environment.
EXAMPLES
$ multi org pulls my-github-org
$ multi org pulls my-github-org --ignore-dependabot
$ multi org pulls my-github-org --only-dependabot
$ multi org pulls my-github-org --since 1/1/24
$ multi org pulls my-github-org --since friday
See code: src/commands/org/pulls.ts
multi pulls
List all your pull requests for added repositories. Requires GH_TOKEN to be set in the environment.
USAGE
$ multi pulls
DESCRIPTION
List all your pull requests for added repositories. Requires GH_TOKEN to be set in the environment.
EXAMPLES
$ multi pulls
See code: src/commands/pulls.ts
multi refresh
Refresh the list of repositories and corresponding metadata.
USAGE
$ multi refresh [-a | -o <value>] [-c <value>] [-d]
FLAGS
-a, --all Refresh all orgs.
-c, --concurrency=<value> Number of concurrent refreshes. Defaults to the number of orgs.
-d, --dry-run Show what would be done without doing it.
-o, --org=<value>... Github org to refresh.
DESCRIPTION
Refresh the list of repositories and corresponding metadata.
See code: src/commands/refresh.ts
multi remove REPO
Remove a repository from your local file system.
USAGE
$ multi remove REPO
ARGUMENTS
REPO Name of repository.
DESCRIPTION
Remove a repository from your local file system.
ALIASES
$ multi rm
See code: src/commands/remove.ts
multi setup
Setup multi
USAGE
$ multi setup
DESCRIPTION
Setup multi
See code: src/commands/setup.ts
multi task get TASK
Return the value of a task.
USAGE
$ multi task get TASK
ARGUMENTS
TASK Name of task to get
DESCRIPTION
Return the value of a task.
See code: src/commands/task/get.ts
multi task set KEYVALUE
Set or unset an executable task.
USAGE
$ multi task set KEYVALUE... [--interactive]
ARGUMENTS
KEYVALUE... task=value
FLAGS
--interactive Open a vim editor to add your task
DESCRIPTION
Set or unset an executable task.
Provide an empty to value to unset the task. This feature is not support on Windows.
EXAMPLES
Set a task
$ multi task set build=yarn build
Set a task that uses multi exec
$ multi task set circle=multi exec . open https://app.circleci.com/pipelines/github/{repo.fullName}
Unset a task
$ multi task set build=
Set a task interactively
$ multi task set build --interactive
See code: src/commands/task/set.ts
multi version
Print the version of multi
USAGE
$ multi version
DESCRIPTION
Print the version of multi
See code: src/commands/version.ts
multi view REPO
View a repository.
USAGE
$ multi view REPO
ARGUMENTS
REPO Name of repository.
DESCRIPTION
View a repository.
ALIASES
$ multi v
See code: src/commands/view.ts
multi where REPO
Print location of a repository.
USAGE
$ multi where REPO [--remote]
ARGUMENTS
REPO Name of repository.
FLAGS
--remote Return url of repository.
DESCRIPTION
Print location of a repository.
See code: src/commands/where.ts