DevEnv helper CLI
Install the module with: npm install -g de-cli
and create a config file named de-config
de
will look for the de-config
in:
- Current directory
- Environment variable
DEV_CONFIG
- User home directory
/etc/de-cli/
Most commands can take a --all
option, instead of a project which will perform the command against all repos in all projects, except for projects that have excludeFromAll
specified.
Usage: de [options] [command]
Commands:
git Perform git based commands
npm Perform npm based commands
app Perform app based commands
test Perform grunt based commands
clean Perform clean up based commands
setup [options] Git pull, npm link & install
help [cmd] display help for [cmd]
Options:
-h, --help output usage information
-V, --version output the version number
Commands:
pull [options] Pull configured repos
status|st [options] Get the status for all repos
stash-list|sl [options] Show stashes for repos
checkout|co [options] Checkout [branch] branch for repos
Commands:
clean Clean node_modules
link [options] Link configured modules
install [options] Install configured repos
status [options] Perform npm-check-updates and depcheck on configured repos
Note that this command currently requires forever
to start and stop the applications.
Commands:
start [options] Start configured projects
stop [options] Stop configured projects
Commands:
grunt [options] Run grunt on the configured projects
Configuration can be in either JSON or YAML format. Options available in the config:
This specifies npm packages to globally install.
This is the folder which all project and module repositories will be checked out to.
The default base for clone urls. This allows short repo names like guzzlerio/deride
instead of the full ssh repo url.
The default branch to checkout. This can be overridden by specifying @<branch-name>
at the end of the repo url.
This lists the commands that will be executed when de setup
is invoked.
Command line args to pass to depcheck
The list of projects. Projects also have options that can be changed. defaultBranch
and defaultRepo
are available and behave as above.
Array of projects to depend upon. This ensures projects can be checked out and setup in order to ensure a successful setup.
Exclude this project from any --all
commands.
Array of repos. These can be full ssh or https git clone urls, or short user/repo names which will use the defaultRepo
to build the clone url.
An example de-config
file:
---
npmInstalls: [bower, nesh, mversion]
folder: ~/dev/src
defaultRepo: git@github.com
defaultBranch: master
setupCommands: [git pull, npm link, npm install]
depcheck:
ignores: grunt*
projects:
- name: project1
description: Node.JS project
depends: [github]
defaultBranch: develop
excludeFromAll: false
repos:
- jamlen/repo1
- jamlen/repo2
modules:
- jamlen/module
- name: github
description: public github projects
defaultBranch: develop
excludeFromAll: true
repos:
- depcheck/depcheck
- https://github.com/tjunnone/npm-check-updates.git
- name: newrelic
description: Repos for newrelic agents and modules
excludeFromAll: true
npm:
user: newrelic
repos:
- newrelic/node-native-metrics
modules:
- guzzlerio/deride@develop
{
"npmInstalls": ["bower", "nesh", "mversion"],
"folder": "~/dev/src",
"defaultRepo": "git@github.com",
"defaultBranch": "master",
"setupCommands": ["git pull", "npm link", "npm install"],
"depcheck": {
"ignores": "grunt*"
},
"projects": [{
"name": "project1",
"description": "Node.JS project",
"depends": ["github"],
"defaultBranch": "develop",
"excludeFromAll": false,
"repos": [
"jamlen/repo1",
"jamlen/repo2"
],
"modules": [
"jamlen/module"
]
}, {
"name": "github",
"description": "public github projects",
"defaultBranch": "develop",
"excludeFromAll": true,
"repos": [
"depcheck/depcheck",
"https://github.com/tjunnone/npm-check-updates.git"
]
}, {
"name": "newrelic",
"description": "Repos for newrelic agents and modules",
"excludeFromAll": true,
"npm": {
"user": "newrelic"
},
"repos": [
"newrelic/node-native-metrics"
]
}],
"modules": [
"guzzlerio/deride@develop"
]
}
In lieu of a formal styleguide, take care to maintain the existing coding style.
(Nothing yet)
Copyright ©2015 James Allen Licensed under the MIT license.