Git Repository Manager
Plase note that the API will strongly evolve until the stable version in
1.0.0
. Do not use if you're looking for a stable software.
GRM : A light git repository manager written in Rust for use in terminal
Available with :
- Bash
- Zsh (work in progress)
- Powershell (work in progress)
USAGE:
grm(.exe) [SUBCOMMAND]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
SUBCOMMANDS:
add Search and add your git repositories for a given path; default path is the current directory
goto Go to the repository directory
help Prints this message or the help of the given subcommand(s)
list List your saved repositories for the given pattern
rm Remove a git repository from the list
Getting started
Waiting the final installation process, you can use the following steps to install GRM :
Setup
Download the repository and build the binary
Clone the repository and build the project (with cargo or rustc, it's up to you) :
git clone [email protected]:theredfish/git-repo-manager.git
cd git-repo-manager
cargo build --release
Setup the installation folder
Linux
mkdir ~/.grm
cd git-repo-manager
# Copy the bash wrapper and the completion file
cp wrapper_scripts/grm.sh ~/.grm
cp completion_scripts/grm.bash-completion.sh ~/.grm
# Copy the binary
cp target/release/grm ~/.grm
Windows (powershell)
mkdir ~/.grm
Copy the powershell wrapper
cp grm.ps1 ~/.grm
# Copy the binary
cp target/release/grm.exe ~/.grm
Setup grm alias
Linux
# Edit your ~/.bashrc or your ~/.bash_aliases with these lines
source ~/.grm/grm.bash-completion.sh
alias grm='source ~/.grm/grm.sh'
# Reload your bashrc
source ~/.bashrc
Windows
More information here.
First you need to change your execution policy :
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Next, create your Windows Powershell profile if doesn't exist :
# Microsoft.PowerShell_profile.ps1 already exists
cd $env:USERPROFILE\Documents
md WindowsPowerShell
cd WindowsPowerShell
New-Item Microsoft.PowerShell_profile.ps1 -ItemType "file"
Then edit Microsoft.PowerShell_profile.ps1
to add your alias :
# You must split args one by one, grm can handle two arguments
function GrmCall {
~/.grm/grm.ps1 $args[0] $args[1]
}
Set-Alias grm GrmCall
Finally source your profile :
. $PROFILE
Development
Prerequisites
- Rust 1.37
SQLite3
Install the following dependencies (it may change depending of your distribution):
# OS dependencies
sudo apt-get install libsqlite3-dev
# Diesel CLI with sqlite only
cargo install diesel_cli --no-default-features --features sqlite
Or avoid installing OS dependencies by playing with the bundled libsqlite3-sys in diesel_cli.
Manage wrapper scripts
TODO
Features
This project is work in progress, here the list of expected features :
must-have features
- add repositories
- list repositories
- change directory for a given repository name
- remove repository
- refresh repositories (delete dead ones and add new ones)
- list repositories with filters / pattern
nice-to-have features
- parallelized search
- categorize repositories
- installation script
migrations and updates
- automatic migrations
- always make a save of
grm.db
before a migration - if a migration fails, restore the previous version
system wrappers
- grm powershell script wrapper for built-in commands
- grm bash script wrapper for built-in commands
- bash auto-completion
- powershell auto-completion
- zsh auto-completion
not so sure
- use r2d2 : set of open db connections for repeated use
- implement tui-rs or termion : wait for a Windows implementation (see termion issue "interest in windows port")