{"id":16206948,"url":"https://github.com/fabiospampinato/gitman","last_synced_at":"2025-10-30T07:42:45.010Z","repository":{"id":65946306,"uuid":"426836166","full_name":"fabiospampinato/gitman","owner":"fabiospampinato","description":"A simple yet powerful opinionated tool for managing GitHub repositories.","archived":false,"fork":false,"pushed_at":"2024-06-16T17:36:40.000Z","size":368,"stargazers_count":24,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-05T08:45:51.026Z","etag":null,"topics":["automation","bulk","git","github","man","manager","multiple","shell"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fabiospampinato.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"fabiospampinato","custom":"https://www.paypal.me/fabiospampinato"}},"created_at":"2021-11-11T01:45:18.000Z","updated_at":"2024-06-26T21:31:07.000Z","dependencies_parsed_at":"2024-05-19T17:26:56.975Z","dependency_job_id":"47326a65-2c15-4937-8c6d-aa5e9528cfbd","html_url":"https://github.com/fabiospampinato/gitman","commit_stats":{"total_commits":56,"total_committers":1,"mean_commits":56.0,"dds":0.0,"last_synced_commit":"4fc6e61f8699bf031b3236c8340f3f882b70ea6d"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fgitman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fgitman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fgitman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fgitman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabiospampinato","download_url":"https://codeload.github.com/fabiospampinato/gitman/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243814907,"owners_count":20352037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","bulk","git","github","man","manager","multiple","shell"],"created_at":"2024-10-10T10:09:21.121Z","updated_at":"2025-10-30T07:42:45.001Z","avatar_url":"https://github.com/fabiospampinato.png","language":"TypeScript","readme":"\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./resources/banner.png\" alt=\"GitMan's Banner\" width=\"640px\" height=\"320px\"\u003e\n\u003c/p\u003e\n\n# GitMan\n\nA simple yet powerful opinionated tool for managing GitHub repositories.\n\n## Features\n\n- **Simple**: There's almost nothing to configure and very few commands are provided.\n- **Powerful**: It allows you to clone in bulk repositories easily and execute commands on them.\n- **Tiny**: The entire thing is ~40kb min+gzipped, and only dependencies I personally maintain are used.\n- **Beautiful**: All of its power derives from being opinioned about the folder structure where repositories are cloned.\n\n## Install\n\n```sh\nnpm install -g gitman\n```\n\n## Configuration\n\nThere are only two, optional, pieces of configuration:\n\n- **GitHub token**: a GitHub personal access token, possibly with the `repo` scope enabled, can be provided to avoid rate limits and being able to manage private repositories too. You can set a token by using either the `GITMAN_GITHUB_TOKEN` or `GITHUB_TOKEN` environment variables, or with the `--github-token` option.\n- **Root path**: the folder path where repositories are cloned. By default the first folder found matching the following is used `~/{GitHub,github,Git,git,Repositories,repositories,Repos,repos,Code,code,Projects,projects,Developer,developer,Dev,dev}`, otherwise `~/Code` is used. You can set a custom root path via the `GITMAN_ROOT` environment variable, or with the `--root` option.\n\nThe only other thing to remember is that repositories are saved according to the following schema: `$ROOT/username/reponame`, if you want GitMan to recognize manually-created repositories too you must follow that convention.\n\n## Usage\n\nThe following interface is provided:\n\n```\ngitman 2.0.0\n\nUSAGE\n\n  gitman [command]\n\nOPTIONS\n\n  --help                  Display help for the command\n  --version, -v           Display the version number\n  --github-token \u003ctoken\u003e  GitHub personal access token\n  --root \u003cpath\u003e           The folder path where repositories are cloned\n\nCOMMANDS\n\n  help [command]        Display help for the command\n  backup \u003cusers...\u003e     Backup all repositories of the provided users\n  cd \u003crepository\u003e       CD into a local repository\n  clone \u003crepository\u003e    Clone a remote repository\n  ls                    List all known repositories\n  publish \u003crepository\u003e  Publish a local repository to GitHub\n  sh \u003ccommand\u003e          Execute a shell command in all known repositories\n  sync \u003crepository\u003e     Synchronize all known repositories with GitHub (fetch, description, keywords)\n  whoami                Output the user associated with the provided GitHub token, if any\n```\n\nThe following filtering options are available for most commands:\n\n```\n--no-archived         Ignore archived repositories\n--no-clean            Ignore clean repositories\n--no-dirty            Ignore dirty repositories\n--no-forks            Ignore forked repositories\n--no-private          Ignore private repositories\n--no-public           Ignore public repositories\n--exclude, -e \u003cglob\u003e  Exclude repositories matching this glob\n--include, -i \u003cglob\u003e  Include only repositories matching this glob\n```\n\n## Examples\n\nClone a single repository:\n\n```sh\ngitman clone fabiospampinato/gitman\n```\n\nClone all repositories from a user/org:\n\n```\ngitman clone 'fabiospampinato/*'\n```\n\nClone all non-archived and non-forks repositories from a user/org:\n\n```\ngitman clone --no-archived --no-forks 'fabiospampinato/*'\n```\n\nClone all my vscode-related repositories:\n\n```\ngitman clone -i '**/vscode-*' 'fabiospampinato/*'\n```\n\nCD into a repository (actually this spawn a sub-shell, which you can `exit` from to go back):\n\n```\ngitman cd fabiospampinato/gitman\n```\n\nList all locally cloned repositories, this provides some useful information about the dirty status and number of commits ahead/behind origin:\n\n```\ngitman ls\n```\n\nList all locally cloned repositories that have uncommitted changes:\n\n```\ngitman --no-clean\n```\n\nList all locally cloned repositories that don't have uncommitted changes:\n\n```\ngitman --no-dirty\n```\n\nList all locally cloned repositories as JSON, useful for third-party tools integrations:\n\n```\ngitman ls --json\n```\n\nList minimal data about all locally cloned repositories as JSON, this is much quicker but omits git-specific data:\n\n```\ngitman ls --json --minimal\n```\n\nList all remote repositories available on GitHub for a user/org:\n\n```\ngitman ls --user fabiospampinato\n```\n\nList all non-archived and non-forks repositories for a user/org:\n\n```\ngitman ls --no-archived --no-forks --user fabiospampinato\n```\n\nExecute a command on all locally cloned repositories:\n\n```\ngitman sh 'cat package.json | grep typescript'\n```\n\nExecute a command on a subset of locally cloned repositories:\n\n```\ngitman sh -i '**/vscode-*' 'git fetch \u0026\u0026 echo \"Something\"'\n```\n\nExecute a command and get the output as JSON:\n\n```\ngitman sh 'cat package.json | grep typescript' --json\n```\n\nExecute a command, listing the unpacked size of NPM dependencies, and get a sorted output:\n\n```\ngitman sh 'npm view --json | jq .dist.unpackedSize' --sort\n```\n\nPublish a repository:\n\n```\ngitman publish fabiospampinato/gitman\n```\n\nPublish all my vscode-related repositories:\n\n```\ngitman publish -i '**/vscode-*' 'fabiospampinato/*'\n```\n\nSync a repository:\n\n```\ngitman sync fabiospampinato/gitman\n```\n\nSync all repositories for a user/org:\n\n```\ngitman sync 'fabiospampinato/*'\n```\n\nGet the user handle associated with the provided GitHub token:\n\n```\ngitman whoami\n```\n\n## Tips\n\n- The `exclude` and `include` globs are matched against the full repository identifier (e.g. username/reponame), therefore most of the times your glob should probably look something like this: `**/foo-*`.\n- GitMan will generally output nothing (except in `--json` mode) if there are no targeted repositories for your command (i.e. user with no repositories, no locally cloned repositories, using filters that exclude everything etc.).\n- GitMan works with any kind of git repository, but it's especially suited for NPM packages, since it's able to extract a description, keywords, and private status from them.\n\n## Related\n\n- **[GitMan for VSCode](https://marketplace.visualstudio.com/items?itemName=fabiospampinato.vscode-gitman)**: The official companion extension for vscode, for switching to repositories quickly.\n- **[Projects+](https://marketplace.visualstudio.com/items?itemName=fabiospampinato.vscode-projects-plus)**: A VSCode extension I wrote for switching quickly between projects, it requires some manual configuration though.\n\n## License\n\nMIT © Fabio Spampinato\n","funding_links":["https://github.com/sponsors/fabiospampinato","https://www.paypal.me/fabiospampinato"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiospampinato%2Fgitman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabiospampinato%2Fgitman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiospampinato%2Fgitman/lists"}