@avalane/nel v0.5.45
Nel
Command line interface for common development tasks.
🏗️ Install
Install Nel globally using npm or your favorite package manager:
npm install --global @avalane/nelInstall Github CLI
Some of the commands in Nel require the Github CLI to be installed. You can install it by following the instructions here: https://cli.github.com/manual/installation
After installation you need to login to Github using the CLI:
gh auth loginSetup jira
For the jira commands to work you need to set up a token for your jira account and add email to a .nelrc file.
- Go to: https://id.atlassian.com/manage-profile/security/api-tokens
- Create a new token
- Run
nel jira encrypt <token>to encrypt the token. This is more obfuscation than secure, still it's better than exposing the token in plain text for other processes to read. - Add
export JIRA_TOKEN=<your-encrypted-token>to your.bashrcor.zshrc
Configuration
Nel will start in current working directory and search up the directory tree for config file. It supports multiple formats. For example .nelrc.json, .nelrc.yml, .nelrc.js, and .nelrc.cjs. For full list see cosmiconfig.
Jira email should always be specified in the config file. To change development defaults you can add a development section to the config file. See: nel dev for options.
Example config file .nelrc.yml:
jira:
email: <your-jira-email>
development:
ardoq: # Must match name specified in the projects package.json file
environment: local
subdomain: piedpiper
open: false
ardoq-discover:
environment: engagement
subdomain: marintech
ardoq-login:
environment: appsec
subdomain: piedpiper
ardoq-surveys:
environment: test
subdomain: martech
my-awesome-project:
port: 8080Open browser
To customize the browser that opens when using the nel dev command, you can set the BROWSER environment variable. For example, to open in Edge:
export BROWSER="Microsoft Edge"BROWSER is often used for other CLIs, if you want to use a specific browser just for nel, you can set the NEL_BROWSER environment variable.
🚀 Usage
nel --helpOptions:
-v, --version Print current version
-h, --help display help for command
Commands:
interactive|i Interactive prompt
check Check setup and config
open [options] [jira_key...] Open project or jira ticket
mergeable
merge [options] Merge pull request
dev [options] Start dev server
watch Watch project
build Build project
deploy Deploy project
release Release project
vc Interactively choose a version control
command.
branch [name] Create a new branch
checkout-pr|cpr Checkout pull request
delete-branches|d [options] Delete local branches
checkout|co [options] Checkout branch
jira Interactively choose a Jira command.
link [options] <pathToPackage> Link package
unlink Unlink package
test [options] Test project
status Display PR status👤 Aliases
Don't want to type nel every time? Here are some suggested alias you can copy into your shells rc file(s):
alias dev='nel dev'
alias build='nel build'
alias watch='nel watch'
alias deploy='nel deploy'
alias merge='nel merge'
alias test='nel test'
alias cb='nel vc co'
alias cpr='nel vc cpr'🛠️ Commands
nel interactivenel checknel opennel mergeablenel mergenel devnel watchnel buildnel deploynel releasenel vcnel branchnel checkout-prnel delete-branchesnel checkoutnel jiranel linknel unlinknel testnel status
interactive
Interactive prompt
Usage: nel interactive|i [options]
Interactively choose a command to run.
Options:
-h, --help display help for commandcheck
Check setup and config
Usage: nel check [options]
Check that Github CLI is installed and that we can find and read a config file.
Options:
-h, --help display help for commandopen
Open project or jira ticket
Usage: nel open [options] [jira_key...]
Command for opening various development related tools or services. Currently supports opening jira ticket or current project in a browser
Options:
-s, --subdomain <org-name> Subdomain (organisation name) to open in browser
-e, --environment <env> Choose environment (choices: "local", "test",
"core", "platform", "partners", "insight",
"integration", "engagement", "prod")
-h, --help display help for commandmergeable
Usage: nel mergeable [options]
Options:
-h, --help display help for commandmerge
Merge pull request
Usage: nel merge [options]
Squashes the current branch into main/master. Prompts user for deploy/release of project and closing of related jira after merge.
Options:
-y, --yes Deploy and close jira after merge.
-f, --force Force merge without checking status.
-h, --help display help for commanddev
Start dev server
Usage: nel dev [options]
Starts a dev server in the current project if it finds a valid script in package.json. It opens a browser window after the dev server has started.
Options:
-n, --no-open Don't open browser after starting dev server.
-s, --subdomain <org-name> Subdomain (organisation name) to open in the
browser.
-p, --port <number> Port number to open in the browser (default:
3000). Should be the port the dev server is
using.
-e, --environment <env> Choose environment (choices: "local", "test",
"core", "platform", "partners", "insight",
"integration", "engagement", "prod")
-h, --help display help for commandwatch
Watch project
Usage: nel watch [options]
Runs the watch script in a project.
Options:
-h, --help display help for commandbuild
Build project
Usage: nel build [options]
Runs the build script in a project.
Options:
-h, --help display help for commanddeploy
Deploy project
Usage: nel deploy [options]
Run the deploy or release script in a project after checking that there are no local or remote changes.
Options:
-h, --help display help for commandrelease
Usage: nel release [options]
Release project
Options:
-h, --help display help for commandvc
Interactively choose a version control command.
Usage: nel vc [options] [command]
Options:
-h, --help display help for command
Commands:
branch [name] Create a new branch
checkout-pr|cpr Checkout pull request
delete-branches|d [options] Delete local branches
checkout|co [options] Checkout branchbranch
Create a new branch
Usage: nel branch [options] [name]
Interactively create a new branch linked to an existing jira issue or lets you create a new issue.
Options:
-h, --help display help for commandcheckout-pr
Checkout pull request
Usage: nel checkout-pr|cpr [options]
Interactively checkout a open pull request
Options:
-h, --help display help for commanddelete-branches
Delete local branches
Usage: nel delete-branches|d [options]
Interactively delete branches
Options:
-y, --yes Delete without confirmation.
-h, --help display help for commandcheckout
Checkout branch
Usage: nel checkout|co [options]
Interactively checkout a local or remote branch
Options:
-r, --remote List remote branches
-h, --help display help for commandjira
Interactively choose a Jira command.
Usage: nel jira [options] [command]
Jira commands
Options:
-h, --help display help for command
Commands:
close <key> Closes the jira issue
new [options] Create a new jira issue through interactive prompts
encrypt <token> Returns an encrypted jira token you can expose as an ENV
variablelink
Usage: nel link [options] <pathToPackage>
Link package
Options:
-w, --watch Watch for changes in linked package
-h, --help display help for commandunlink
Usage: nel unlink [options]
Unlink package
Options:
-h, --help display help for commandtest
Test project
Usage: nel test [options]
Runs the test script in a project.
Options:
-w, --watch Watch tests if supported by the project
-h, --help display help for commandstatus
Display PR status
Usage: nel status [options]
Command for display the status of the PR. This lets you see details about the PR without opening it in your browser..
Options:
-h, --help display help for command📓 Logging
You can specify the log level for the nel command by setting the NEL_LOG_LEVEL environment variable. The default is info. Supported levels are debug, info, warn, and error.
Example:
$ NEL_LOG_LEVEL=debug nel