A command-line tool for gitlab

Overview

Lab

CI Go Report Card release

ackerr/lab

A fuzzy finder command line tool for gitlab. 中文文档

Feature

lab sync        Sync gitlab projects
lab browser     Fuzzy find gitlab repo and open it in $BROWSER
lab clone       Fuzzy find gitlab repo and clone it
lab cs          Fuzzy find repo in your codespace
lab lint        Check .gitlab-ci.yml syntax
lab open        Open the current repo remote in $BROWSER
lab config      Use $EDITOR open config file, support custom config path, use --config filepath
lab ci (Beta)   View the pipeline jobs trace log, default view running job

For more information, please use lab help.

Install

homebrew

$ brew install ackerr/tap/lab

scoop

$ scoop bucket add ackerr https://github.com/Ackerr/scoop-bucket
$ scoop install ackerr/lab

go get

$ go get -u "github.com/ackerr/lab"

Configure

Recommend use lab config to edit config file (~/.config/lab/config.toml), this command will open the config file use $EDITOR. If config file don't exist, it will auto generate by config template .

Two variables are required, base_url and token. The way to get gitlab token, see this

Comments
  • How to start?

    How to start?

    I followed the README.md and this happens:

    image

    When I run the go get it downloads fine (Screenshot is after) Then, I try to run lab or lab config and it doesn't find it

    opened by ghost 3
  • 我希望 lab clone 可以按照结构来克隆项目

    我希望 lab clone 可以按照结构来克隆项目

    - gitlab.com
    - gitlab.lilithgames.com
      - be
        - davinci
        - einstein
      - fe
        - homepage
    

    比如目录结构是这样的时候,lab clone [email protected]:be/newproject 会自动地放在 $CODE/gitlab.lilithgames.com/be/newproject 里 (这样也跟 gopath 里的结构是一样的

    opened by LKI 2
  • lab project create no longer works

    lab project create no longer works

    the above command on lab v0.2.20 now returns an error. All my project scripts now fail. macOS Big Sur and on Linux. All used to work well until recently. The feature appears to have been removed.

    opened by ghost 1
  • Add Project Variables feature

    Add Project Variables feature

    Would be very useful to be added to the project, here is an example of fetching Project Variables from the API in Ruby (supporting a hardcoded max of 2 paginated pages of variables at 100 per page).

    It's nice to group variables by 'environment_scope', and do an alphabetical sort for presentation.

    #!/usr/bin/env ruby
    
    require 'net/http'
    require 'json'
    
    
    unless defined?(ENV['GITLAB_PERSONAL_TOKEN'])
      puts 'GITLAB_PERSONAL_TOKEN required'
      exit 1
    end
    
    
    TOKEN=ENV['GITLAB_PERSONAL_TOKEN']
    PROJECT_ID=File.read('.gitlab/project_id')
    API_ENDPOINT="https://gitlab.com/api/v4/projects/#{PROJECT_ID}/variables"
    PER_PAGE=100
    
    def fetch_project_variables_page(page)
    
      uri = URI(API_ENDPOINT + "?per_page=#{PER_PAGE}&page=#{page}")
      Net::HTTP.start(uri.host, 443,
        :use_ssl => uri.scheme == 'https') do |http|
        request = Net::HTTP::Get.new uri
        request['PRIVATE-TOKEN'] = TOKEN
    
        response = http.request(request)
    
        project_variables = JSON.parse(response.body)
    
        project_variables
    
      end
    
    end
    
    
    
    def print_vars
    
      project_variables = Array.new
    
      page_1 = fetch_project_variables_page(1)
      page_2 = fetch_project_variables_page(2)
    
      project_variables = project_variables + page_1
    
      if page_2.count > 99
         puts 'real pagination of Gitlab Project Variables should be implemented. exiting'
         exit 1
      else
          project_variables = project_variables + page_2
      end
    
    
    
      group_by_scope = project_variables.group_by {|x| x['environment_scope']}
    
      group_by_scope.each_pair do |scope,vars|
    
       puts "-----------------------------------------------------------------"
       puts scope
       puts "-----------------------------------------------------------------"
    
       sorted_vars = vars.sort_by { |v| v['key'] }
       sorted_vars.each do |var|
         puts "#{var['key']}=#{var['value']}"
       end
    
       puts ''
    
      end
    
    end
    
    
    print_vars
    
    opened by robj 1
  • `lab sync` support wiki

    `lab sync` support wiki

    GitLab 中,有些项目是开启 wiki 的。

    对于此类项目,可以使用 git clone https://gitlab.com/group/project.git 来克隆本体,也可以使用 git clone https://gitlab.com/group/project.wiki.git 来克隆 wiki 项目~

    希望 sync 的时候可以支持一下 (或者 clone 的时候支持下也行?

    enhancement 
    opened by LKI 0
Releases(v0.3.1)
Owner
ZmJ
ZmJ
A command-line tool for gitlab

Lab A fuzzy finder command line tool for gitlab. 中文文档 Feature lab sync Sync gitlab projects lab browser Fuzzy find gitlab repo and open it

ZmJ 81 Oct 19, 2022
A command line tool that builds and (re)starts your web application everytime you save a Go or template fileA command line tool that builds and (re)starts your web application everytime you save a Go or template file

# Fresh Fresh is a command line tool that builds and (re)starts your web application everytime you save a Go or template file. If the web framework yo

null 0 Nov 22, 2021
A command line tool to prompt for a value to be included in another command line.

readval is a command line tool which is designed for one specific purpose—to prompt for a value to be included in another command line. readval prints

Venky 0 Dec 22, 2021
git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.

Table of contents Introduction Reference Contributing Introduction Overview git-xargs is a command-line tool (CLI) for making updates across multiple

Gruntwork 685 Nov 21, 2022
git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command

git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command. You give git-xargs:

Maxar Infrastructure 1 Feb 5, 2022
A command line tool for simplified docker volume command built with go

dockervol A command line tool for simplified docker volume command built with go. Features: Remove anonymous volume (beta) Remove volume by matching n

Moh Achun Armando 0 Dec 18, 2021
fofax is a fofa query tool written in go, positioned as a command-line tool and characterized by simplicity and speed.

fofaX 0x00 Introduction fofax is a fofa query tool written in go, positioned as

null 502 Nov 27, 2022
Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.

asciigraph Go package to make lightweight ASCII line graphs ╭┈╯. Installation go get github.com/guptarohit/asciigraph Usage Basic graph package main

Rohit Gupta 2.1k Nov 28, 2022
Package command provide simple API to create modern command-line interface

Package command Package command provide simple API to create modern command-line interface, mainly for lightweight usage, inspired by cobra Usage pack

chenen 0 Jan 16, 2022
Watcher - A simple command line app to watch files in a directory for changes and run a command when files change!

Watcher - Develop your programs easily Watcher watches all the files present in the directory it is run from of the directory that is specified while

Geet Sethi 1 Mar 27, 2022
Terraform gitlab environment

terraform-gitlab-environment terraform-gitlab-environment for gitlab Requirements This is a list of plugins that need to be installed previously to en

hadenlabs 2 Feb 23, 2022
Arduino command line tool

arduino-cli Arduino CLI is an all-in-one solution that provides builder, Boards/Library Manager, uploader, discovery and many other tools needed to us

Arduino 3.7k Nov 25, 2022
Command line tool for Google Cloud Datastore, written in Go

dsio dsio is a command line tool for Google Cloud Datastore. This tool is under development. Please use in your own risk. Features Bulk upsert entitie

Shinichi Nishimura 66 Feb 8, 2022
A simple command line tool using which you can skip phone number based SMS verification by using a temporary phone number that acts like a proxy.

Fake-SMS A simple command line tool using which you can skip phone number based SMS verification by using a temporary phone number that acts like a pr

Narasimha Prasanna HN 745 Nov 29, 2022
pgCenter is a command-line admin tool for observing and troubleshooting Postgres.

Command-line admin tool for observing and troubleshooting Postgres.

Lesovsky Alexey 1.4k Nov 26, 2022
textnote is a command line tool for quickly creating and managing daily plain text notes.

textnote is a command line tool for quickly creating and managing daily plain text notes. It is designed for ease of use to encourage the practice of daily, organized note taking. textnote intentionally facilitates only the management (creation, opening, organizing, and consolidated archiving) of notes, following the philosophy that notes are best written in a text editor and not via a CLI.

Daniel Kaslovsky 161 Nov 16, 2022
Command line tool for adding Windows resources to executable files

go-winres A simple command line tool for embedding usual resources in Windows executables built with Go: A manifest An application icon Version inform

null 168 Nov 11, 2022
A command-line tool and library for generating regular expressions from user-provided test cases

Table of Contents What does this tool do? Do I still need to learn to write regexes then? Current features How to install? 4.1 The command-line tool 4

Peter M. Stahl 5.7k Nov 27, 2022
A command line tool for file downloads

A command line tool for file downloads

null 258 Jul 25, 2021