A simple tool to search the expression in the project scope for GitLab and GitHub repositories.
Project description
GITLAB SEARCH COMMAND TOOLS
A simple tool to search the expression in the project scope for GitLab and GitHub repositories.
Prerequisites
- Install Python3+.
- Create a personal GitLab access token and store it in a secure place.
Installation
python -m pip install --upgrade pip
python -m pip install git-search-command
Environment
After finishing the installation you need to create new environment for searching
gsc gl env --new <environment_name>
Then input your host name and personal token as following
See more
gsc gl env --help
Usage: gsc gl env [OPTIONS]
Setup the environment for searching, support multiple environments.
Options:
-n, --new <environment> Create new or override the env information if
it was existed.
-d, --default <environment> Set the environment as default.
-r, --remove <environment> Remove the environment.
-i, --info <environment> Display the environment info.
-l, --list List all environment.
-h, --help Show this message and exit.
Usage
Search in project
gsc gl search <keywork> --project <project_id>
You can find project ID as below image
Search in group
gsc gl search <keywork> --group <group_id_or_group_path>
You can search in group using id or path name. You refer the below image to get them.
See more
$ gsc gl search --help
Usage: gsc gl search [OPTIONS] <keyword>
Search the content in GitLab repositories.
Options:
-g, --group <int> Search in the specified project group, input
group id or group path.
-p, --project <int> Search in the specified project, input project
id.
-e, --environment <string> Select the environment for searching, if not
declare, default environment has been used.
-v Show result preview, available only when
searching project, not in group.
-o, --output <file_path> Export the search result to file, only support
text file.
-h, --help Show this message and exit.
Development
Environments
- Python 3.7+
- Visual Studio Code with Python extension.
Setup
Terminal
Create and activate the virtual environment
python -m venv .venv
source .venv/bin/activate
Then install the dependencies for development environment
python -m pip install -e .[develop]
Vscode task
Ctrl Shift B
to selectTasks: Run Task
- Run
Install DEV environment
task
Build
Terminal
python setup.py -v build install
Vscode task
Run Build Project
task.
License
Reference documents
GitLab
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
git_search_command-1.0.1.tar.gz
(405.4 kB
view hashes)
Built Distribution
Close
Hashes for git_search_command-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 545f6020576667d6db039b28e8056046de6c9b66cc1e8f22b8a80cbc1701122e |
|
MD5 | 018bc445dd51d92a5bd5d7a5aaba01c8 |
|
BLAKE2b-256 | 6b402affef1fb13f5ca30565b50b330a3eb02e80bcc9baedf775e7a10ac78c95 |