{"id":26075902,"url":"https://github.com/jordilin/gitar","last_synced_at":"2025-04-11T21:13:13.023Z","repository":{"id":190909429,"uuid":"683565078","full_name":"jordilin/gitar","owner":"jordilin","description":"Git all remotes. git cli tool that targets both Github and Gitlab","archived":false,"fork":false,"pushed_at":"2025-04-05T18:36:42.000Z","size":2199,"stargazers_count":7,"open_issues_count":12,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T21:13:00.416Z","etag":null,"topics":["cli","developer-tools","etl","git","github","github-cli","gitlab","gitlab-cli","rest","rust","rust-lang"],"latest_commit_sha":null,"homepage":"https://jordilin.github.io/gitar/","language":"Rust","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/jordilin.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}},"created_at":"2023-08-27T01:34:30.000Z","updated_at":"2025-04-05T18:36:45.000Z","dependencies_parsed_at":"2023-08-27T03:41:25.789Z","dependency_job_id":"5763651a-535f-4a62-929e-9b70b0fdfaee","html_url":"https://github.com/jordilin/gitar","commit_stats":null,"previous_names":["jordilin/gitar"],"tags_count":105,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordilin%2Fgitar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordilin%2Fgitar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordilin%2Fgitar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordilin%2Fgitar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jordilin","download_url":"https://codeload.github.com/jordilin/gitar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248480430,"owners_count":21110937,"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":["cli","developer-tools","etl","git","github","github-cli","gitlab","gitlab-cli","rest","rust","rust-lang"],"created_at":"2025-03-09T01:29:48.000Z","updated_at":"2025-04-11T21:13:13.001Z","avatar_url":"https://github.com/jordilin.png","language":"Rust","readme":"# GitAR - Git All Remotes\n\n[![Build status](https://github.com/jordilin/gitar/actions/workflows/ci.yml/badge.svg)](https://github.com/jordilin/gitar/actions)\n[![codecov](https://codecov.io/gh/jordilin/gitar/graph/badge.svg)](https://codecov.io/gh/jordilin/gitar)\n\n![GitAR](./doc/src/images/logo.svg)\n\n- [GitAR - Git All Remotes](#gitar---git-all-remotes)\n  - [Installation](#installation)\n  - [Usage](#usage)\n    - [Configuration](#configuration)\n    - [Example open a merge/pull request](#example-open-a-mergepull-request)\n    - [Worth a thousand words](#worth-a-thousand-words)\n  - [Remotes supported](#remotes-supported)\n  - [Operations supported](#operations-supported)\n    - [Merge requests](#merge-requests)\n    - [Pipeline](#pipeline)\n    - [Container registry](#container-registry)\n    - [Project](#project)\n    - [Browse remote using your browser](#browse-remote-using-your-browser)\n    - [Releases](#releases)\n    - [Auth User](#auth-user)\n    - [Trending Repositories](#trending-repositories)\n  - [Logging](#logging)\n  - [Unit tests](#unit-tests)\n  - [Gitar-Amps additional scripts and workflows](#gitar-amps-additional-scripts-and-workflows)\n  - [License](#license)\n\nGit multi-remote command line tool. Brings common development operations such as\nopening a pull request down to the shell.\n\nThis is an alternative to both Github \u003chttps://github.com/cli/cli\u003e and Gitlab\n\u003chttps://gitlab.com/gitlab-org/cli\u003e cli tools. The scope for now is\nsmaller. If you happen to use both Gitlab and Github and wanted to just have one\nsingle tool, this can help.\n\nSome benefits:\n\n* It supports Gitlab and Github. One tool, to rul'em all.\n* Written in Rust. Fast and Parallelizes operations to gather data locally and\n  remotely.\n* Common defaults. For example, the title of a pull requests is automatically\n  set to the last commit. Defaults can be overridden when prompted.\n* Caches API read calls. Common remote calls like gather project data that does\n  not change often (project id, namespace, members), so subsequent calls are\n  very fast.\n\nI've only tested on MacOS and Linux.\nManual can be found at: \u003chttps://jordilin.github.io/gitar/\u003e\n\n## Installation\n\nYou can download the latest release from the releases page\n\u003chttps://github.com/jordilin/gitar/releases\u003e and place the binary anywhere in\nyour path.\n\nOr you can build from source. Building from source requires the latest stable\nrelease of Rust.\n\n\u003e**NOTE:** If you decide to build from source at this moment, please be aware\nthat the `main` branch breaks backward compatibility with the current\nconfiguration. It uses **TOML**. Please see unit tests for examples in the\n`src/config.rs` file.\n\n```bash\ncargo build --release\n./target/release/gr --help\n```\n\n## Usage\n\n**WARNING**: Before using, I'd recommend to familiarize yourself in a test git\nrepository.\n\n### Configuration\n\n**VERSION v1.0.0 and newer**: Configuration file format has changed and it uses TOML.\nCheck the manual for more information.\n\n**VERSION v0.1.93 or OLDER**:\nPlace your configuration information in a file called `$HOME/.config/gitar/api`.\nYou'll need to gather a read/write API token from your Gitlab/Github account.\n\nYou can generate a new configuration file with the following command:\n\n```bash\ngr init --domain \u003cdomain\u003e\n```\n\nWhere `\u003cdomain\u003e` is the domain of the remote. For example, `gitlab.com` or\n`github.com`. This will create a new configuration file with some default\nvalues.\nOnce created you can append new values for each domain you want.\n\nConfiguration follows a properties file format.\n\n```\n\u003cdomain\u003e.property=value\n```\n\nExample configuration file:\n\n```\n# Gitlab.com\ngitlab.com.api_token=\u003cyour api token\u003e\ngitlab.com.cache_location=/home/\u003cyouruser\u003e/.cache/gr\ngitlab.com.preferred_assignee_username=\u003cyour username\u003e\ngitlab.com.merge_request_description_signature=\u003cyour signature, @someone, etc...\u003e\n\n## Cache expiration configuration\n\n# Expire read merge requests in 5 minutes\ngitlab.com.cache_api_merge_request_expiration=5m\n# Expire read project metadata, members of a project in 5 days\ngitlab.com.cache_api_project_expiration=5d\n# Pipelines are read often, change often, so expire immediately.\ngitlab.com.cache_api_pipeline_expiration=0s\n# Expire read container registry in 5 minutes\ngitlab.com.cache_api_container_registry_expiration=5m\n# Cache for reading releases\ngitlab.com.cache_api_release_expiration=1d\n\n## Max pages configuration\n\n# Get up to 10 pages of merge requests when listing\ngitlab.com.max_pages_api_merge_request=10\n# Get up to 5 pages of project metadata, members of a project when listing\ngitlab.com.max_pages_api_project=5\n# Get up to 10 pages of pipelines when listing\ngitlab.com.max_pages_api_pipeline=10\n# Get up to 10 pages of container registry when listing\ngitlab.com.max_pages_api_container_registry=10\n# Get up to 10 pages of releases when listing\ngitlab.com.max_pages_api_release=10\n\n# Rate limit remaining threshold. Threshold by which the tool will stop\n# processing requests. Defaults to 10 if not provided. The remote has a counter\n# that decreases with each request. When we reach this threshold we stop for safety.\n# When it reaches 0 the remote will throw errors.\n\ngitlab.com.rate_limit_remaining_threshold=10\n\n# Github\ngithub.com.api_token=\u003cyour api token\u003e\ngithub.com.cache_location=/home/\u003cyouruser\u003e/.cache/gr\ngithub.com.preferred_assignee_username=\u003cyour username\u003e\n# github.com.merge_request_description_signature=@my-team\n\n# Your company gitlab\ngitlab.mycompany.com.api_token=\u003cyour api token\u003e\n...\n```\n\nCache expiration configuration has three keys:\n\n- `\u003cdomain\u003e`.cache_api_merge_request_expiration: List merge_requests, get a\n  merge request, etc... Any read operation involving merge/pull requests.\n- `\u003cdomain\u003e`.cache_api_project_expiration: Get project metadata, members of a\n  project. This information does not change often, so a long expiration is fine.\n- `\u003cdomain\u003e`.cache_api_pipeline_expiration: List pipelines, get a pipeline, etc...\n\nThe values for these keys can accept any number followed by `s` for seconds, `m`\nfor minutes, `h` for hours, `d` for days. For example, `5m` means 5 minutes,\n`5d` means 5 days, `0s` means immediate expiration.\n\nIf omitted, the default is immediate expiration, so read operations are always\npulled from the remote.\n\nWhen listing merge requests, projects, pipelines, etc... the tool will fetch up\nto max pages. We can control this per API as follows:\n\n- `\u003cdomain\u003e`.max_pages_api_merge_request: List merge_requests, get a\n  merge request, etc... Any read operation involving merge/pull requests.\n- `\u003cdomain\u003e`.max_pages_api_project: Get project metadata, members of a project.\n- `\u003cdomain\u003e`.max_pages_api_pipeline: List pipelines, get a pipeline, etc...\n\nIf omitted, the default global number of pages for all APIs is 10. This is to\navoid fetching too much data when the amount of information is large.\nThe default number of results per page for Gitlab is 20 and for Github is 30.\n\n### Example open a merge/pull request\n\nCreate a configuration file with an API read/write token as explained above.\n\n```bash\ngr mr create\n```\n\n* You are in a feature branch\n* Prompt for assignee user\n* Confirmation\n* Open a merge request\n\n### Worth a thousand words\n\n[demo.webm](https://github.com/jordilin/gitar/assets/1031376/83a37d6e-e2eb-4b68-978e-816439b2c122)\n\n## Remotes supported\n\nGitlab and Github.\n\n## Operations supported\n\n### Merge requests\n\nIn Gitlab they are known as merge requests and in Github as pull requests.\n\n| Operation | GitLab | GitHub |\n| --------- | -------------- | -------------- |\n| Open  | \u0026#x2714; | \u0026#x2714; |\n| Approve | \u0026#x2714; | \u0026#x2716; |\n| Merge | \u0026#x2714; | \u0026#x2714; |\n| Get merge request details | \u0026#x2714; | \u0026#x2714; |\n| List merge requests by their state | \u0026#x2714;| \u0026#x2714; |\n| Close | \u0026#x2714; | \u0026#x2714; |\n| Create comments on timeline | \u0026#x2714; | \u0026#x2714; |\n| List comments on timeline | \u0026#x2714; | \u0026#x2714; |\n\n### Pipeline\n\nIn Gitlab they are known as pipelines and in Github as actions.\n\n| Operation | GitLab | GitHub |\n| --------- | -------------- | -------------- |\n| List all pipelines | \u0026#x2714; | \u0026#x2714; |\n| List pipeline runners | \u0026#x2714; | \u0026#x2716; |\n| Get pipeline runner details | \u0026#x2714; | \u0026#x2716; |\n| Lint pipeline configuration | \u0026#x2714; | \u0026#x2716; |\n| Get total merged pipeline configuration | \u0026#x2714; | \u0026#x2716; |\n| List project jobs | \u0026#x2714; | \u0026#x2716; |\n\n\n### Container registry\n\n| Operation | GitLab | GitHub |\n| --------- | -------------- | -------------- |\n| List repositories | \u0026#x2714; | \u0026#x2716; |\n| List tags | \u0026#x2714; | \u0026#x2716; |\n| Get image metadata | \u0026#x2714; | \u0026#x2716; |\n\n### Project\n\n| Operation | GitLab | GitHub |\n| --------- | -------------- | -------------- |\n| Get | \u0026#x2714; | \u0026#x2714; |\n\n### Browse remote using your browser\n\n| Operation | GitLab | GitHub |\n| --------- | -------------- | -------------- |\n| Open git repo in browser | \u0026#x2714; | \u0026#x2714; |\n| Open merge request in browser | \u0026#x2714; | \u0026#x2714; |\n| Open pipeline in browser | \u0026#x2714; | \u0026#x2714; |\n| Open releases in browser | \u0026#x2714; | \u0026#x2714; |\n\n### Releases\n\n| Operation | GitLab | GitHub |\n| --------- | -------------- | -------------- |\n| List releases | \u0026#x2714; | \u0026#x2714; |\n| List release assets | \u0026#x2714; | \u0026#x2714; |\n\n### Auth User\n\nProvided by the `gr my` command provides information about the user that holds\nthe auth token.\n\n| Operation | GitLab | GitHub |\n| --------- | -------------- | -------------- |\n| List assigned merge requests | \u0026#x2714; | \u0026#x2714; |\n| List your projects | \u0026#x2714; | \u0026#x2714; |\n| List your starred projects | \u0026#x2714; | \u0026#x2714; |\n| List your gists | \u0026#x2716; | \u0026#x2714; |\n\n\n### Trending Repositories\n\n| Operation | GitLab | GitHub |\n| --------- | -------------- | -------------- |\n| List by programming language | \u0026#x2716; | \u0026#x2714; |\n\nAll list operations support the following flags:\n\n- `--page` to specify the page to fetch.\n- `--from-page` and `--to-page` to specify a range of pages to fetch.\n- `--num-pages` queries how many pages of data are available\n- `--refresh` to force a refresh of the cache.\n- `--sort` sorts data by date ascending or descending. Ascending is the default.\n- `--created-after` and `--created-before` to filter by date if response\n  payloads support `created_at` field.\n- `--format` to specify the output format. Delimit fields by using a pipe, i.e. ` | ` is the default.\n\n## Logging\n\nLogging can be enabled by issuing the `--verbose` or `-v` global flag.\n\nBy default, INFO logs are enabled and will output to STDERR without interfering\nwith STDOUT in case you want to pipe the output to another command or file. INFO\nwill give just enough information to understand what is happening.\n\nYou can enable DEBUG logs by setting the `RUST_LOG` environment variable to\n`debug`. DEBUG is way more verbose.\n\nEx: List all pipelines/actions with logging.\n\n```bash\n# INFO logs\ngr --verbose pp list\n# DEBUG logs\nRUST_LOG=debug gr --verbose pp list\n```\n\n## Unit tests\n\nJSON responses from Gitlab and Github are verified in the contracts folder.\nThose are used to generate mock responses for unit tests.\n\n```bash\ncargo test\n```\n\n## Gitar-Amps additional scripts and workflows\n\nGitar-Amps are wrapper scripts that make use of gitar in order to provide\nadditional workflows and use cases.\nIt is a companion project that can be found at\n\u003chttps://github.com/jordilin/gitar-amps\u003e\n\n## License\n\nThis project is licensed under\n\n- Source code: MIT license ([LICENSE](LICENSE) or\n  [http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT))\n\n- GitAR logo: [Creative Commons\nAttribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordilin%2Fgitar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjordilin%2Fgitar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordilin%2Fgitar/lists"}