<commit_before># _GitLab CLI Tool_

_Many people prefer to work from the CLI when possible. This tool aims to bring some of the GitLab functionality into the CLI to avoid repeated trips to the web UI. At this time the tool only allows interaction with snippets._

## Version 2.0.0 

This version contains breaking changes!!

* Now packaged as a gem! 
* Configuration file loaded from user's home directory - ~/.gitlab_cli.yml
* Easier to use within your Ruby scripts/applications (see "Use as a library")

## GitLab Versions

This tool has only been tested with the following versions of GitLab.  Some or all of the features may or may not work with other versions but they are not _officially_ supported.

* 5.1.0
* 5.0.x

[How to use (Commands)](#Commands)
[Use as a Library](#Library)

## Installation and Setup 

_How do I get started?_ 

Install from rubygems (Recommended)

1. _`gem install gitlab_cli`_

Install from the repo (requires rake and bundler).

1. _Clone the repo._
2. _`rake build`_
3. _`rake install` (Requires root privileges)._

You now have access to the `gitlab` command.

_Required Gems_

If you install from rubygems then you will not need to install these required gems yourself. The gem package manager will attempt to install the proper versions for you.

1. thor >= 0.17.0 and < 0.19
2. json >= 1.7.7 and < 1.8
3. rest-client >= 1.6.7 and < 1.7

Note for Linux users: You may need to install the `ruby-devel` package via YUM if you receive an error on install.  The error you would see is:

```
Building native extensions.  This could take a while...
 ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/json-1.7.7 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/json-1.7.7/ext/json/ext/generator/gem_make.out
```

_How can I find the private token for my user?_

Login to your GitLab web UI, go to 'My Profile', and select the 'Account' tab.  Copy the private token from the box and paste into your config.  

_How can I add the repo bin path to my environment PATH variable?_

Place it in your ~/.bash_profile file.  You should end up with something like this:
`export PATH=$PATH:/path/to/gitlab-cli/repo/bin/`

## How to use (Commands) 
<a id="Commands"></a>

View a list of all the commands you can use to interact with Gitlab CLI, complete with examples.

[Commands](doc/Commands.md)

## Use as a library
<a id="Library"></a>

Now that Gitlab CLI is distributed as a gem it is increasingly easy to use in your Ruby scripts or applications.  Click the link below to see documentation on how to get started using Gitlab CLI as a library.

[Use as a library](doc/Library.md)

## Issues

If you encounter issues with this project, please find help via one of these avenues.
<commit_msg>Update README.md with anchor links<commit_after># _GitLab CLI Tool_

_Many people prefer to work from the CLI when possible. This tool aims to bring some of the GitLab functionality into the CLI to avoid repeated trips to the web UI. At this time the tool only allows interaction with snippets._

## Version 2.0.0 

This version contains breaking changes!!

* Now packaged as a gem! 
* Configuration file loaded from user's home directory - ~/.gitlab_cli.yml
* Easier to use within your Ruby scripts/applications (see "Use as a library")

## GitLab Versions

This tool has only been tested with the following versions of GitLab.  Some or all of the features may or may not work with other versions but they are not _officially_ supported.

* 5.1.0
* 5.0.x

[How to use (Commands)](#how-to-use-commands)
[Use as a Library](#use-as-a-library)

## Installation and Setup 

_How do I get started?_ 

Install from rubygems (Recommended)

1. _`gem install gitlab_cli`_

Install from the repo (requires rake and bundler).

1. _Clone the repo._
2. _`rake build`_
3. _`rake install` (Requires root privileges)._

You now have access to the `gitlab` command.

_Required Gems_

If you install from rubygems then you will not need to install these required gems yourself. The gem package manager will attempt to install the proper versions for you.

1. thor >= 0.17.0 and < 0.19
2. json >= 1.7.7 and < 1.8
3. rest-client >= 1.6.7 and < 1.7

Note for Linux users: You may need to install the `ruby-devel` package via YUM if you receive an error on install.  The error you would see is:

```
Building native extensions.  This could take a while...
 ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/json-1.7.7 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/json-1.7.7/ext/json/ext/generator/gem_make.out
```

_How can I find the private token for my user?_

Login to your GitLab web UI, go to 'My Profile', and select the 'Account' tab.  Copy the private token from the box and paste into your config.  

_How can I add the repo bin path to my environment PATH variable?_

Place it in your ~/.bash_profile file.  You should end up with something like this:
`export PATH=$PATH:/path/to/gitlab-cli/repo/bin/`

## How to use (Commands) 

View a list of all the commands you can use to interact with Gitlab CLI, complete with examples.

[Commands](doc/Commands.md)

## Use as a library

Now that Gitlab CLI is distributed as a gem it is increasingly easy to use in your Ruby scripts or applications.  Click the link below to see documentation on how to get started using Gitlab CLI as a library.

[Use as a library](doc/Library.md)

## Issues

If you encounter issues with this project, please find help via one of these avenues.

{'fraction_non_alphanumeric': 0.07693643626259118, 'fraction_numerical': 0.014588398749565822, 'mean_word_length': 3.697389885807504, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '434601', 'n_tokens_mistral': 1828, 'n_tokens_neox': 1710, 'n_words': 868}