Simple terminal tool of Git.
Project description
pigit
A terminal tool for git. When we use git, do you feel very uncomfortable with too long commands. For example: git status --short
, this project can help you improve it. This project is written in Python. Now most UNIX like systems come with Python. So you can easily install and use it.
Installation
Pip
pip install -U pigit
Source
git clone https://github.com/zlj-zz/pigit.git
cd pigit
make install
# or
python setup.py install # On windows
Usage
You can run pigit
in terminal, and you will see this:
[pigit] version: 1.0.9
git version 2.30.1 (Apple Git-130)
Path: /opt/homebrew/lib/python3.9/site-packages/pigit-1.0.9-py3.9.egg/pigit/__init__.py
Description:
Terminal tool, help you use git more simple. Support Linux and MacOS. Partial support for windows.
It use short command to replace the original command, like:
`pigit ws` -> `git status --short`, `pigit b` -> `git branch`.
Also you use `g -s` to get the all short command, have fun and good lucky.
The open source path: https://github.com/zlj-zz/pigit.git
You can use -h and --help to get help and more usage.
runtime: 0.00 second
You can run pigit -h
or pigit --help
to get the help message.
usage: pigit [-h] [-C] [-s] [-S TYPE] [-t] [-f] [-i] [-c [PATH]] [--create-ignore TYPE]
[--create-config] [--debug] [--out-log] [-v]
[command] [args ...]
If you want to use some original git commands, please use -- to indicate.
positional arguments:
command Short git command.
args Command parameter list.
optional arguments:
-h, --help show this help message and exit
-C, --complete Add shell prompt script and exit.(Supported `bash`, `zsh`)
-s, --show-commands List all available short command and wealth and exit.
-S TYPE, --show-command TYPE
According to given type(Branch, Commit, Conflict, Fetch, Index,
Log, Merge, Push, Remote, Stash, Tag, WorkingTree, Setting, Extra)
list available short command and wealth and exit.
-t, --types List all command types and exit.
-f, --config Display the config of current git repository and exit.
-i, --information Show some information about the current git repository.
-c [PATH], --count [PATH]
Count the number of codes and output them in tabular form. A given
path can be accepted, and the default is the current directory.
--create-ignore TYPE Create a demo .gitignore file. Need one argument, support:
[android, c++, cpp, c, dart, elisp, gitbook, go, java, kotlin,
lua, maven, node, python, qt, r, ros, ruby, rust, sass, swift,
unity]
--create-config Create a preconfigured file of git-tools.
--debug Run in debug mode.
--out-log Print log to console.
-v, --version Show version and exit.
runtime: 0.00 second
Interaction
It support a simple interactive mode. You can use pigit i
into the interactive mode. like this:
And in the interaction mode, you can use ?
to see the help message.
Open remote
You can use pigit open
to open your remote website (just support github). These are some other parameters supported:
-i, --issue:
open given issue of the repository.
# pigit open -- -i 20
# pigit open -- --issue=20
-c, --commit:
open the current commit in the repo website.
# pigit open -- --commit
-p, --print:
only print the url at the terminal, but don't open it.
<branch>:
open the page for this branch on the repo website.
Alias
Alias is recommended for faster use. Open your shell profile and append:
alias g=pigit
Then, you can use g
to call pigit.
Configuration
You can use pigit --create-config
to create a demo configuration at pigit home path.
On Linux or MacOS: ~/.config/pigit
here is a configuration template.
Extra cmds
You can setting your custom cmds. Need create a extra_cmds.py
file at the pigit home. And writing like this:
import os
def print_user(args):
print(os.system('whoami'))
extra_cmds = {
'echo': {
'command': 'echo 123',
},
'print-user': {
'command': print_user,
'type': 'func',
'help': 'print system user name.'
}
}
The extra_cmds
dict is must. And the structure is command key and command info.
The command info has some options:
command
: (Must have) Short life corresponds to the complete command or a method. If it is a method, it must receive a parameter tuple.type
: (Option) Mark the type of command, support ['func', 'string'], and the default is 'string'.help
: (Option) Command help message.has_arguments
: (Option, bool) Whether the command accepts parameters. Default is True.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.