A command-line tool for gitlab

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

  • 我希望 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 里的结构是一样的

  • 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.

  • 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
    
  • `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 的时候支持下也行?

A command-line tool for gitlab
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

Nov 28, 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

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

Dec 22, 2021
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.

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

Dec 31, 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

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

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

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 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

Jan 8, 2023
Go package to make lightweight ASCII line graph ╭┈╯ in command line apps with no other dependencies.
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

Jan 8, 2023
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

Feb 23, 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

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

Mar 27, 2022
Arduino command line tool
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

Jan 7, 2023
Command line tool for Google Cloud Datastore, written in Go
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

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.
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

Dec 31, 2022
pgCenter is a command-line admin tool for observing and troubleshooting Postgres.
pgCenter is a command-line admin tool for observing and troubleshooting Postgres.

Command-line admin tool for observing and troubleshooting Postgres.

Dec 29, 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.

Jan 2, 2023
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

Dec 27, 2022
A command-line tool and library for generating regular expressions from user-provided test cases
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

Jan 9, 2023
A command line tool for file downloads

A command line tool for file downloads

Jul 25, 2021