alexilyaev / runrun-cli Goto Github PK
View Code? Open in Web Editor NEWDelightful interactive CLI to quickly run npm scripts.
License: MIT License
Delightful interactive CLI to quickly run npm scripts.
License: MIT License
If we go lazy typing, let's go all the way ๐.
It would also work nicely with re-run which could be rrr
.
Currently if the script exits with a code other than 0 we show:
If you can't settle this, please open an issue at:
https://github.com/alexilyaev/runrun-cli/issues
We should either remove that or change the text to make it clear the script exited with non 0 code.
Would be nice to show when a new version is available, like npm and yarn.
First mentioned in #8
Then recently requested again by @julienben
I didn't want to pursue this path due to he complexity of finding the relevant history file for each shell and supporting different history formats and OS's.
But maybe we could satisfy most users using existing utils:
https://github.com/sindresorhus/shell-history
Relevant environment variables:
SHELL
- Current used shell (e.g. bash
, zsh
)HISTFILE
- Path to history file (ref http://tldp.org/LDP/abs/html/histcommands.html)Known history file locations:
$HOME/.bash_history
$HOME/.zsh_history
$HOME/.zhistory
(legacy or Oh My Zsh variant or something)If the goal is to save time in running npm scripts, it makes sense to make the cli command even shorter.
It will also play nicely with running the last command which will use rrr
(#8).
If I run:
rr
lint
โฏ eslint:base
lint:eslint
lint
If I usually pick lint
, maybe it would make sense to hoist it to the top.
Or have a dedicated section of "Recently Used" scripts.
Could there be an option to enable "vim" style key bindings, just for up and down movement?
I'm imagining an option such as rr --vim
that would disable completion and enable "j" for down and "k" for up. I would then probably alias this on my machine, e.g. alias rr="rr --vim"
.
e.g. Passing arguments to scripts
When you run a command regularly, you can see it in shell history, as well as search back to it with ctrl+r or using the arrow keys.
It would be nice to somehow add the selected command to shell history, if it's possible
-i
(--info
) flagShould be able to install with:
npm i -D runrun-cli
Given:
"start:app-admin": "APP_VARIANT=app-admin npm run start",
"start:app-viewer": "APP_VARIANT=app-viewer npm run start",
"build:app-viewer:staging": "APP_VARIANT=app-viewer npm run build",
"build:app-viewer:prod": "APP_VARIANT=app-viewer npm run build",
"deploy:app-viewer:staging": "npm run lint-and-test && npm run build:app-viewer:staging",
"deploy:app-viewer:prod": "npm run lint-and-test && npm run build:app-viewer:prod",
view
Down
until highlighting build:app-viewer:prod
sta
deploy:app-viewer:prod
is highlighted.
Should reset the selection on search updates.
rr
to run tests with Jestrrr
and adding --watch
type-check
rr
to load up for thatnpx
or yarn
to run the full script namenpx type-check
e.g.:
terkelg/prompts#158
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.