loading...
Cover image for Managing your projects

Managing your projects

konstantin profile image Konstantin ・1 min read

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

GitHub logo zsh-users / zsh-autosuggestions

Fish-like autosuggestions for zsh

or

GitHub logo rupa / z

z - jump around

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
  • cd to it
  • do git init
  • do npm init or cargo 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):

GitHub logo 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.

demo

After project init you will be prompted to create a github repo (private or public).

github

You can read more about it in the «Managing your projects» article.

Installation

You will need to install hub 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 into its folder.

If no name…

It allows you to just type:

project <project name>

and it will prompt you to create npm, cargo, gem or pip package

Create package

as well as a private or public github repo (you need to install and configure hub for that) and jump into it:

Create repository

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

Posted on by:

konstantin profile

Konstantin

@konstantin

My name is Konstantin and I'm a developer based in Paris.

Discussion

markdown guide