Git Product home page Git Product logo

gl's Introduction

Gl

Gl is a small CLI that hooks into your Git config and GitLab API to easily access information based on the project your are currently in.

Installation

$ gem install gl

Usage

Inside your git workspace you can issue the following commands:

$ gl

Commands:
  gl global          # commands unrelated to the current project
  gl help [COMMAND]  # Describe available commands or one specific command
  gl issues          # handle issues of the project
  gl mr              # handle merge requests of the project
  gl registry        # handle registry of the project

Issues

List

$ gl issues list

+-----+----------------+-------------------------------------------------------------------------------+
| IID | Author         | Title                                                                         |
+-----+----------------+-------------------------------------------------------------------------------+
| 409 | XXXXXXXXXXXXXX | XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                                  |
| 105 | XXXXXXXXXXXXXX | XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                                  |
| 44  | XXXXXXXXXXXXXX | XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                                  |
| 33  | XXXXXXXXXXXXXX | XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                                  |
+-----+----------------+-------------------------------------------------------------------------------+

With interactive switch

$ gl issues list -i

Open a issue (Use ↑/↓ and ←/→ arrow keys, press Enter to select)
‣ 409 - XXXXXXXXXXXX - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  408 - XXXXXXXXXXXX - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  407 - XXXXXXXXXXXX - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  406 - XXXXXXXXXXXX - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  405 - XXXXXXXXXXXX - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  404 - XXXXXXXXXXXX - XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Open

Open a issue directly with the IID or viathe interactive list

$ gl issue open 409

Merge Requests

Interactive

$ gl mr list -i

Select a merge request (Use ↑/↓ arrow keys, press Enter to select, and letter keys to filter)
‣ 2 - robert.mueller - WIP: Update README.md

In interactive mode you can also perform all the other actions

$ gl mr list -i

Select a merge request 2 - robert.mueller - WIP: Update README.md
┌────────────────────────────────────────WIP: Update README.md─────────────────────────────────────────┐
│                                                                                                      │
│ # Nec verum procul trahuntur velle                                                                   │
│                                                                                                      │
│ ## Foedantem blandis malorum mox                                                                     │
│                                                                                                      │
│     chipsetMyspace.perlUltra.font_document(iscsiStandbyPermalink(                                    │
│             computing_mac_modem, streamingSli));                                                     │
│     address_operating = 40 + binComputingTransistor + rw * minimize;                                 │
│     wired(-1, qbe_export);                                                                           │
│                                                                                                      │
└State: opened────────────────────────────────────────────────────────────────────────by robert.mueller┘
What to do next? (Use ↑/↓ arrow keys, press Enter to select)
‣ open
  merge
  approve
  exit

List

$ gl mr list

+-----+----------------+-----------------------+
| IID | Author         | Title                 |
+-----+----------------+-----------------------+
| 2   | robert.mueller | WIP: Update README.md |
+-----+----------------+-----------------------+

Open

$ gl mr open 2

Approve

$ gl mr approve 2

Merge

$ gl mr merge 2

Registry

With the registry subcommand you can get a overview about the registry usage.

$ gl registry status

+---------------------------+------+-------------+
| Registry                  | Tags | Size        |
+---------------------------+------+-------------+
| XXXXXXXXXXXXXXXXXXXXXXXXX |   42 | 13511.85 MB |
+---------------------------+------+-------------+
$ gl registry list

+---------------------------+-----------------------+-----------+-------------------------------+-----------+
| Registry                  |                   Tag | Image_ID  | Created_at                    | Size      |
+---------------------------+-----------------------+-----------+-------------------------------+-----------+
| XXXXXXXXXXXXXXXXXXXXXXXXX |                latest | 90112d580 | 2019-08-19T12:23:11.129+02:00 | 305.42 MB |
| XXXXXXXXXXXXXXXXXXXXXXXXX |               v0.87.3 | 90112d580 | 2019-08-19T12:23:11.129+02:00 | 305.42 MB |
+---------------------------+-----------------------+-----------+-------------------------------+-----------+

Development

After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Flipez/gl.

License

The gem is available as open source under the terms of the AGPL-3.0.

gl's People

Contributors

dependabot[bot] avatar flipez avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

gl's Issues

Trigger merge

If my MergeRequest is approved and ready to merge I have to go to the MR and click on Merge. It would be nice if I could just do

gl mr merge ID [FLAGS]

with delete_branch beeing on by default.

Allow to add labels to MR / Issues ...

and replace rather specific ready thing. https://github.com/Flipez/gl/blob/master/lib/gl/cli/merge_requests.rb#L24

Since Issues and MR are literally the same objects the code would be almost identical besides calling create_merge_request_note and create_issue_note.

It could look like this:

gl mr label MyLabel
gl mr label -d MyLabel

which then internally is converted into

create_X_note("/label MyLabel")
create_X_note("/unlabel MyLabel")

The I could just create an bash-alias for my specific needs e.g.

alias gl-mr-ready='gl mr label -a Status::Reviewable'

Add `gl ci open`

Since the gitlab search is awfull I use the open cli command more and more too easily jump to the projects I currently work at. Another common occurrence is that I push some commits and then get a popup that my pipeline broke. Usually I then have to click a few times until I finally see what actually is the problem.

Would be cool if the CLI could ease the pain by providing a shortcut.

Proposal:

  • gl ci open -> Jump to pipeline overview
  • gl ci open --latest -> Jump to the latest pipeline
  • gl ci open my-branch-name -> Jump to the latest pipeline of this branch

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.