npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

git-lab-cli

v2.0.12

Published

Create a merge request from command line in gitlab

Downloads

124

Readme

gitlab-cli

gitlab-cli is a command line utility created in JavaScript. Inspired from hub. It tries to provide commands which makes working with gitlab from the command line easier.

Creating a merge request with gitlab-cli is as simple as

$ lab merge-request

Installation

Install it using npm

$ npm install git-lab-cli -g

Usage

$ lab command [options]

To get a list of available commands

$ lab --help

Commands available

browse [options]          Open current branch or a specific page in gitlab
compare [options]         Open compare page between two branches
merge-request [options]   Create merge request on gitlab
merge-requests [options]  Opens merge request page for the repo.

Check help of each command like following

$ lab merge-request --help

Running example

$ lab merge-request -b feature/feature-name -t develop

Above will create merge request for merging feature/feature-name in develop.

Options for create-merge-request

-b, --base [optional]                  Base branch name
-t, --target [optional]                Target branch name
-m, --message [optional]               Title of the merge request
-a, --assignee [optional]              User to assign merge request to
-l, --labels [optional]                Comma separated list of labels to assign while creating merge request
-r, --remove_source_branch [optional]  Flag indicating if a merge request should remove the source branch when merging
-s, --squash [optional]                Squash commits into a single commit when merging
-e, --edit [optional]                  If supplied opens edit page of merge request. Prints the merge request URL otherwise
-o, --open [optional]                  If supplied open the page of the merge request. Prints the merge request URL otherwise
-p, --print [deprecated]               Doesn't do anything. Kept here for backward compatibility. Default is print.
-v, --verbose [optional]               Detailed logging emitted on console for debug purpose
-h, --help                             output usage information

Configurations

gitlab-cli captures configurations needed for itself on the first run. Just run the command you want to run and it will capture the information needed.

You can also set the configurations yourself as git config (project specific) or environment variables (global).

git config

Setting git config allows you to provide separate configurations for each gitlab repository.

$ git config --add gitlab.url "https://gitlab.yourcompany.com"
$ git config --add gitlab.token "abcdefghijskl-1230"

Find your gitlab token at https://gitlab.yourcompany.com/profile/account

Environment variables

Setting environment variables allows you to provide global configurations which will be used for all your gitlab repositories when using gitlab-cli.

GITLAB_URL=https://gitlab.yourcompany.com
GITLAB_TOKEN=abcdefghijskl-1230

Find your gitlab token at https://gitlab.yourcompany.com/profile/account

Features supported

  1. Base branch is optional. If base branch is not provided. Current branch is used as base branch.
  2. Target branch is optional. If target branch is not provided, default branch of the repo in gitlab will be used.
  3. Created merge request page will be opened automatically after successful creation.
  4. If title is not supported with -m option value. It will be taken from in place editor opened. First line is taken as title.
  5. In place editor opened contains latest commit message.
  6. In the editor opened third line onwards takes as description.
  7. Comma separated list of labels can be provided with its option.
  8. Supports forks. If base branch and target branch are on different remotes. Merge request will be created between forks.
  9. Supports setting assignee for merge request.