# projects

> You're a prolific developer (or you want to be). Manage, keep track of, and show off your projects.

Latest version **1.6.1** (published 2015-04-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install projects
pnpm add projects
yarn add projects
bun add projects
```

Provides the commands `projects`, `projects-gc`, `projects-ls`, `projects-get`, `projects-set`, `projects-each`, `projects-edit`, `projects-glob`, `projects-info`, `projects-open`, `projects-clone`, `projects-query`, `projects-github`, `projects-import`, `projects-remind`, `projects-json-in`, `projects-not-git`, `projects-resolve`, `projects-json-out`, `projects-git-status`, `projects-git-unpushed`.

## Health

**Score 5/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.6.1 |
| Published | 2015-04-20 |
| First published | 2013-08-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 28 |
| Known vulnerabilities | 0 (+11 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Beau Gunderson |
| Maintainers | beaugunderson |
| Keywords | projects, organization |

## Links

- npm: https://www.npmjs.com/package/projects
- Repository: https://github.com/beaugunderson/projects
- Homepage: https://github.com/beaugunderson/projects#readme
- Issues: https://github.com/beaugunderson/projects/issues
- npm.io page: https://npm.io/package/projects

## Dependencies (28)

- [ini](https://npm.io/package/ini.md) ~1.3.3
- [gift](https://npm.io/package/gift.md) 0.6.0
- [glob](https://npm.io/package/glob.md) ~5.0.5
- [async](https://npm.io/package/async.md) ~0.9.0
- [chalk](https://npm.io/package/chalk.md) ~1.0.0
- [color](https://npm.io/package/color.md) ^0.8.0
- [debug](https://npm.io/package/debug.md) ^2.1.3
- [dirty](https://npm.io/package/dirty.md) ~0.9.9
- [split](https://npm.io/package/split.md) ~0.3.3
- [ignore](https://npm.io/package/ignore.md) ^2.2.15
- [lodash](https://npm.io/package/lodash.md) ~3.7.0
- [mkdirp](https://npm.io/package/mkdirp.md) ~0.5.0
- [moment](https://npm.io/package/moment.md) ~2.10.2
- [parents](https://npm.io/package/parents.md) ^1.0.1
- [request](https://npm.io/package/request.md) ~2.55.0
- [cardinal](https://npm.io/package/cardinal.md) ~0.5.0
- [helmsman](https://npm.io/package/helmsman.md) git+https://github.com/beaugunderson/node-helmsman.git
- [omelette](https://npm.io/package/omelette.md) ^0.3.1
- [progress](https://npm.io/package/progress.md) ^1.1.8
- [commander](https://npm.io/package/commander.md) ~2.8.0
- [epipebomb](https://npm.io/package/epipebomb.md) ^0.1.1
- [get-stdin](https://npm.io/package/get-stdin.md) ^4.0.1
- [log-buffer](https://npm.io/package/log-buffer.md) 0.0.3
- [dirty-query](https://npm.io/package/dirty-query.md) ~0.1.1
- [elementtree](https://npm.io/package/elementtree.md) ~0.1.6
- [lodash-deep](https://npm.io/package/lodash-deep.md) git+https://github.com/beaugunderson/lodash-deep.git
- [dirty-compact](https://npm.io/package/dirty-compact.md) 0.0.2
- [supports-color](https://npm.io/package/supports-color.md) ^1.3.1

## Recent versions

- 1.6.1 (latest) — 2015-04-20
- 1.6.0 — 2015-04-19
- 1.5.0 — 2015-04-17
- 1.4.1 — 2014-12-14
- 1.4.0 — 2014-12-13
- 1.3.1 — 2014-12-10
- 1.3.0 — 2014-12-10
- 1.2.0 — 2014-12-10
- 1.1.0 — 2014-12-10
- 1.0.0 — 2014-11-25
- 0.0.8 — 2013-08-17
- 0.0.7 — 2013-08-14
- 0.0.6 — 2013-08-14
- 0.0.5 — 2013-08-13
- 0.0.4 — 2013-08-13
- … 3 more at https://npm.io/package/projects/versions

## README

## Projects

Project management for power users.

### Installation

```sh
$ npm install -g projects
```

### Quickstart

If the majority of your projects are subdirectories of one folder then the
easiest way to get started is this (in my case my projects live underneath
`~/p/`):

```sh
$ npm install -g projects
$ echo "alias p=projects" >> ~/.bashrc
$ source ~/.bashrc
$ vim ~/.config/projects

# edit like so (note: this file will probably become JSON soon!)
[github]
username = beaugunderson

[projects]
directory = ~/p

$ p import ~/p/*
$ p github  # if you want to import metadata about your GitHub projects too
```

Try `p remind`, `p git-status`, `p git-unpushed`, and `p not-git` for examples
of the time savings and management functionality I'm trying to enable.

Note that the color scheme currently assumes a dark background; if you find it
hard to read try `DISABLE_COLOR=true` in your environment (a revamp of all
colors is coming in the next version).

### Shell completion

For autocompletion you can redirect `projects --completion` to a file in
`~/.bash_completion` (zsh is also supported) or use `projects-modified.sh`
which also contains a fallback to `_filedir` so that you can still complete
files and directories (I've opened [an
issue](https://github.com/f/omelette/issues/4) to get that improvement back
into omelette, the completion library we use).

### Commands

| Command        | Description                                                |
|----------------|------------------------------------------------------------|
| `alias`        | output shell aliases                                       |
| `clone`        | `git clone` a project                                      |
| `each`         | run a command in each project directory                    |
| `edit`         | edit projects files                                        |
| `gc`           | compact the projects database                              |
| `get`          | get an attribute for a project                             |
| `git-status`   | `git status` across all repositories                       |
| `git-unpushed` | display repositories with unpushed commits                 |
| `github`       | fill your projects database with your GitHub repositories  |
| `glob`         | glob across all project directories                        |
| `import`       | import a directory into projects                           |
| `info`         | show the JSON for a given project                          |
| `json-in`      | import your projects from plain JSON                       |
| `json-out`     | export your projects to plain JSON                         |
| `ls`           | list your porojects                                        |
| `open`         | open a project's homepage                                  |
| `not-git`      | list projects not in git                                   |
| `query`        | query your projects                                        |
| `remind`       | get a reminder of what you were last working on            |
| `set`          | set an attribute to a given value for a project            |

### Writing your own commands

Projects is primarily a framework for making it easy to execute actions on one
or more of your projects. For example, you could write a command to check the
clean/dirty status of all of your checked out git repositories and list the
dirty ones.

If you have an executable file in your PATH that starts with `projects-` then
you can execute it underneath projects (and you're encouraged to share them
with others!)

### Examples

```sh
$ alias p=projects
$ cat ~/.config/projects
[github]
username = beaugunderson

[projects]
directory = ~/p

$ p info vim-scss-instead
{
  "name": "vim-scss-instead",
  "repository": "https://github.com/beaugunderson/vim-scss-instead.git",
  "language": "VimL",
  "role": "creator",
  "released": true,
  "status": "inactive"
}

$ p set vim-scss-instead homepage https://github.com/beaugunderson/vim-scss-instead
Set vim-scss-instead:homepage to "https://github.com/beaugunderson/vim-scss-instead"
$ p open vim-scss-instead # opens a web browser to the homepage URL
$ p clone vim-scss-instead
Cloning into '/Users/beau/p/vim-scss-instead'...
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 5 (delta 0), reused 5 (delta 0)
Receiving objects: 100% (5/5), done.

$ p github
<snip>
Adding vim-scss-instead
Adding vim-human-dates
<snip>
Finished

$ p git-unpushed
node-helmsman: 6 commits ahead of origin
projects: 3 commits ahead of origin
```

You can also use something like [fzf](https://github.com/junegunn/fzf) to make
selecting a project via the CLI very easy:

```sh
contract-home() {
  sed "s|^$HOME|~|"
}

# cd to a project via fzf
pd() {
  cd $(projects ls -1 | \
    fzf --query="$1" | \
    xargs -I {} projects get --porcelain "{}" directory)
}

# open a project's URL via fzf
po() {
  open $(projects ls -1 | \
    fzf --query="$1" | \
    xargs -I {} projects get --porcelain "{}" homepage)
}

# edit a project file with $EDITOR via fzf
# note: requires gnu findutils
# on OS X you'll want to:
# `npm install -g ignore-pipe`
# `brew install findutils --with-default-names`
pe() {
  FILTERS='-type f '

  # filter out .git and node_modules with -prune to make the find much faster
  FILTERS+='-not -path \*/.git/\* -prune '
  FILTERS+='-not -path \*/node_modules/\* -prune '

  ADDITIONAL_FILTERS=$1

  if PROJECT_DIRECTORY=`projects resolve --relative .`; then
    FILE=$(bash -c "find $PROJECT_DIRECTORY \
      $FILTERS $ADDITIONAL_FILTERS 2> /dev/null" | \
        ignore-pipe | contract-home | fzf)
  else
    FILE=$(projects glob --expand | \
      xargs -I {} bash -c "find "{}" \
        $FILTERS $ADDITIONAL_FILTERS 2> /dev/null" | \
         ignore-pipe | contract-home | fzf)
  fi

  # bash -c needed to handle tilde expansion
  [ ! -z "$FILE" ] && bash -c "${EDITOR:-vim} "$FILE""
}

# edit a project file modified within in the last 7 days
per() {
  pe "-mtime -7"
}
```

---
_Source: https://npm.io/package/projects · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
