As most of developers I have ~/projects folder where I stock all my projects.
To jump from one project to another I normally use either a cd with
zsh-users
/
zsh-autosuggestions
Fish-like autosuggestions for zsh
But sometimes I get to a wrong folder (z sometimes jumps to parent folder) and if I want to create a project I have to:
- create folder
-
cdto it - do
git init - do
npm initorcargo init - do
hub create
A lot of stuff, just to create a project.
Enter gko/project
Some time ago I created a small zsh plugin (it works in bash as well):
gko
/
project
☕️ Create node, rust, python or ruby project locally and on github (private or public)
Project
Create npm, cargo, gem or pip project locally and on github or just cd into existing.
After project init you will be prompted to create a github repo (private or public).
You can read more about it in the «Managing your projects» article.
Installation
You will need to install github cli (see this installation instructions) in order to create project repository on github.
With antigen
In your .zshrc
antigen bundle gko/project
Manually
You need to clone repo:
git clone --recursive --depth 1 https://github.com/gko/project
then add it to .bashrc or .zshrc:
source ./project/project.sh
Usage
Usage: project [options]
Example:
project -p test
Options:
-h, --help help
-p, --private create private github repository
-f, --folder your projects folder(defaults to ~/projects)
-n, --no-init avoid initializing package
then to create public repo:
project test
create private repo:
project -p test
If the project exist you will just cd…
It allows you to just type:
project <project name>
and it will prompt you to create npm, cargo, gem or pip package
as well as a private or public github repo (you need to install and configure hub for that) and jump into it:
If the project exists you will just cd to the project folder.
Project folder
By default project folder is ~/projects but you can either specify another folder when running project:
project -f /projects_path
or use PROJECTS_HOME variable
export PROJECTS_HOME=/projects_path
ZSH autocomplete
It supports zsh-autocomplete. On Tab will show the list of available projects.
Alias it
You can also alias it (in ~/.zshrc or ~/.bashrc):
alias p='project'
to get:
p test-project




Top comments (0)