Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/benitolopez/p

Project automator for Bash and Zsh
https://github.com/benitolopez/p

bash project-management tool zsh

Last synced: about 2 months ago
JSON representation

Project automator for Bash and Zsh

Awesome Lists containing this project

README

        

# P

**P** is a minimal project automator for Bash and Zsh. It was inspired by [prm](https://github.com/eivind88/prm), an awesome project of Eivind Arvesen. While I'm still thinking that *prm* is very good, I was looking for a project manager with a different logic and more simple. During the day, I switch between projects constantly, losing a lot of time. Sometimes I need to start some common tasks (launch Vim, start Gulp and so on), but often I only need to open the project with my editor.

That's why I have created **P**.

## How it works

When you run **P**, you run the script associated to your project. You can open a new shell window, start a task runner or run a command. It's up to you. **P** creates this script with only one variable, `PROJECT_PATH`, the path of your project.

Example:

```bash
# cd to your project directory
cd $PROJECT_PATH

# run Gulp
gulp
```

## Installation

Clone this repository:

```bash
git clone https://github.com/benitolopez/p.git
```

Then add something like this in your `.bashrc`:

```bash
. /path/to/p.sh
```

And ensure the script is executable

```bash
chmod +x /path/to/p.sh
```

## Usage

```bash
Usage: p

Options:
Run project(s) configuration script.
add Add project.
list List all projects.
delete Delete project(s).
o Open project(s) with the default editor.
g Go to the project directory.
edit Edit project(s).
rename Rename project.
-h --help Display this information.
-v --version Display version info.
```

So, to add a project just run `p add ` from the root of your project. This creates a `.sh` file in `~/.projects/`. Then you can run that script with `p `.

You can run multiple projects at once with:

```bash
p
```

But sometimes you only need a quick way to open a project with your default editor. In this case, just run (multiple projects allowed):

```bash
p o
```

And to go the project directory run:

```bash
p g
```

## Options

You can modify some defaults exporting these environment variables:

```
_P_CMD # the P command, default 'p'
_P_DIR # projects directory where the scripts are saved
default '~/.projects'
_P_OPEN_FUNC # function used to open the project with
your default editor, default '$EDITOR .'
```

## License

[MIT](http://opensource.org/licenses/MIT)
Copyright (c) 2016 [Benito Lopez](http://lopezb.com)