Metadata-Version: 2.1
Name: gl-search
Version: 0.2.0
Summary: Script to help search code in self-hosted gitlab
Home-page: https://github.com/Bernardoow/gl_search
License: MIT
Keywords: gitlab,search,search code,api
Author: Bernardo Gomes
Author-email: bgomesdeabreu@gmail.com
Maintainer: Bernardo Gomes
Maintainer-email: bgomesdeabreu@gmail.com
Requires-Python: >=3.9,<4.0
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Terminals
Classifier: Topic :: Utilities
Requires-Dist: click (>=8.1.3,<9.0.0)
Requires-Dist: dynaconf (>=3.1.11,<4.0.0)
Requires-Dist: pydantic (>=1.10.2,<2.0.0)
Requires-Dist: requests (>=2.28.1,<3.0.0)
Requires-Dist: rich (>=12.6.0,<13.0.0)
Requires-Dist: toml (>=0.10.2,<0.11.0)
Project-URL: Repository, https://github.com/Bernardoow/gl_search
Description-Content-Type: text/markdown

# gl-search

This is a lib that use gitlab api to search code.
This code is based in the lib [gitlab-search](https://github.com/phillipj/gitlab-search).

## About

It is a lib to search code at gitlab.
This search can be parameterized with params groups, extension, filename, path, max-workers and visibility.

## How install?

```bash
pip install gl_search
```

## How it works?

The lib use gitlab token (GITLAB_PRIVATE_TOKEN) to search.

## How to setup the token?

Get your token at gitlab and then execute following command to save at home user at the .gl-settings.toml file.

```bash
gl-search setup-token <token>
```

## Can I change gitlab official to self hosted?

Yes you can. Use following command to setup the gitlab-address

```bash
gl-search setup-gitlab-address <self-hosted-gitlab-address>
```

## Where I get gitlab token?

You can get on following link [gitlab-token](https://gitlab.com/-/profile/personal_access_tokens)

## Why this lib was built?

I had problem with repo visibility using a mentioned lib above so I built this script to resolve my problem.

## How to use

```bash
gl-search search test
```

This options is show up below.

```bash
➜  gl_search git:(main) ✗ gl-search search --help
Usage: gl-search search [OPTIONS] SEARCH_CODE_INPUT

  Search command.

Options:
  -p, --path TEXT                 search by Path
  -fn, --filename TEXT            search by filename
  -ext, --extension TEXT          code filename extension :: py,js,cs
  -g, --groups TEXT               search by gitlab group
  -mw, --max-workers INTEGER      number of parallel requests
  -v, --visibility [internal|public|private]
                                  repositories visibility
  -xdr, --max-delay-request INTEGER
  --help                          Show this message and exit.
```

## How was made the lib?

The lib was built using click, rich, request, ThreadPoolExecutor.

