►
From YouTube: CLI Tools for All the Things - Ruy Adorno, npm
Description
CLI Tools for All the Things - Ruy Adorno, npm
Speakers: Ruy Adorno
Come learn how to build cli tools to enhance your day-to-workflows & change your life for the better.
A
So
I'm
a
local
from
Montreal
I've
been
living
here
for
11
almost
11
years
now.
So
it's
one
of
my
greatest
accomplishment.
All
my
life
like
become
a
Canadian
citizen,
so
yeah
I
really
love
the
people
here,
really
love
the
country
just
the
weather.
At
this
time
of
the
year.
It
starts
it's
not
so
great,
but
yeah
and
I.
Recently
it's
been
three
months
now.
Almost
four
I
joined
NPM.
So
now
I'm
work
at
the
open
source
team
with
Darcy.
A
A
A
A
So
yes,
this
disclaimer
you're
about
to
see
a
graphic
designer
by
formation,
giving
a
talk
about
the
command-line
interface,
which
yeah
and
I
think
it
makes
a
lot
of
sense.
It
is
a
great
user
interface
and
there
is
something
that
maybe
sometimes
people
don't
realize,
because
our
very
communication,
like
it's
word,
base
right.
We
with
think
and
word
terms
word
they
link
into
things
in
our
minds
right
so
and
developers
are
always
looking
to
reuse
things
right
and
words
are
really
key
words
in
our
minds
and
we're
gonna
map
them
into
things.
A
We
want
to
do
right,
so
that's
what
makes
the
the
CLI
the
command-line
interface
so
powerful,
because
basically
the
commands
there
they're
reusable
stuff
right.
We
love
to
redo
stuff
and
basically
we're
storing
commands
we're
doing
our
workflow,
and
these
commands
is
just
something
that
okay,
oh
yeah,
now
I
need
to
do
this
thing,
oh
yeah,
so
maybe
it's
maybe
the
command
is
run.
Maybe
the
command
is
like
run
my
project,
it's
gonna
map
to
something
in
your
mind,
is
gonna,
make
sense
to
you
and
it's
going
to
be
reusable.
A
So
alright,
we're
gonna
go
through
bunch
of
quick
examples,
so
very
adventurous
here.
Gonna
do
a
lot
of
live
coding
stuff,
but
it's
gonna
be
fun,
yeah,
it's
fun
stuff,
so
not
gonna
jump
into
node.
Yet
so
quick
thing
like
basically
here
gonna
use
the
cat
command.
Basically
that
prints
out
contents
of
a
file
right.
So
here
I'm,
just
going
to
define
like
okay
I
want
to
create
a
new
command.
It's
gonna
be
food
like
for
now
it's
only
like
it's
only
gonna
be
cutting
things
like
good,
just
like
printing
it
out.
A
So
that's
like
step
like
one.
The
very
most
basic
thing
like
defining
analyze
is
one
of
the
ways
to
create
your
own
command
in
this
case
doesn't
do
much
because
well
that's
already
a
building
thing
so,
but
sometimes
you
want
to
maybe
use
a
variation
of
a
command
write
command
that
takes
a
flag
like
okay,
like
get
status
so
like
get
status.
A
Usually
it's
gonna
print
all
this
and
for
right-
and
let's
say
you
like
the
ass
flag,
which
turns
into
this
more
pretty
printed
things
way
of
displaying
your
this
status
after
get
repo
right
now
so
yeah,
okay,
let's
make
okay
status.
Okay,
that's
gonna,
be
my
new
command.
Okay,
I,
like
that
thing,
like
I
wanna,
be
reusing
that
so
from
now
on
every
time.
Okay,
now
I
wanna
do
status,
but
the
way
I
like
it.
So
you
basically
like
get
status
like
you.
Have
you
have
that
Elias
is
a
new
command.
A
You
can
use
and
reuse,
and
you
can
also
like
making
more
versatile
like
the.
There
is
also
the
function
batch
function
way
of
defining
it.
So,
basically,
in
this
one
over
here,
I'm
just
going
to
hey
it
status
and
then
just
basically
gonna
be
setting
a
parameter
so
now
I
can
send
down
the
ass
flag
or
some
other
ones
like
not
yeah.
So
it's
going
to
do
the
very
same
thing.
The
other
one
did
right,
but
basically
just
to
show
showcase
the
batch
functions
to
is
also
something
we
can
do
so.
A
Yeah
using
note
like
something
I
did
to
like
I
just
went
on
NPM
real,
quick,
like
let's
find
a
useful
library.
We
could
use
this
something
fun
right
so
based
in
this
case
I'm
just
using
some
load
library
and
just
invoking
the
node
runner
itself
and
I'm
requiring
right
away
right
from
bash
that
command
and
what
it
does
is
that,
okay,
if
there
is
an
offensive
word
there,
it
returns
true,
then
it's
gonna
print
block.
Otherwise
it's
just
gonna
print.
Whatever
was
it
right?
So
let's
try
it
out.
A
That
starts
to
be
more
fun
right,
so
I'm
already
for
the
sake
of
like
making
sure,
doesn't
derail
too
much.
It's
already
npm
install.
So
let's
just
create
this
new
command
here.
So,
okay,
no
they're,
gonna
print
that
and
it's
gonna
require
offensive
words
filter.
Thank
you
so
much.
Whoever
did
this
and
it's
going
to
take
the
word
as
an
argument.
I'm
gonna
use
that
and
then,
if
it's
blocked,
which
are
it's
true,
I'm
gonna
show
anything
and
otherwise,
let's
print
whatever.
A
Was
that
their
end
and
I
close
this
thing:
they're
gonna
close
my
function,
so,
let's
print
safe,
oh
hi,
yay!
There's
nothing
offensive
in
this
word.
It
works.
Well.
So,
let's
print
save-
oh
oh
yeah,
amazing,
so
yeah,
basically
just
quick
them
on
on
how
to
use
a
node
module
like
even
within
bash
itself.
A
A
Does
it
is
your
path
environment
variable
it's
going
to
be
available
as
a
command
as
long
as
that
file
is
a
cuticle,
so
you
can
even
like
from
the
lookout
installed
modules
like
usually
they're,
not
available
as
comment
lines
right,
even
if,
though,
even
though,
if
they
provide
command
line
interfaces,
let's
say
jewelz
thing
over
there
CLI
slides
it
is
a
command
line
thing,
but
right
now
is
not
available.
So
if
I
go
on
and
just
like
export
my
path
and
I'm
gonna
contact
black.
A
This
is
here,
I'm,
not
concatenating
it
with
whatever
was
already
there
getting
my
current
directory
here
and
I
like
okay.
Let's
get
everything
that
is
in
node
modules,
bin
and
that's
that'll
be
part
of
the
path.
So
now
the
commands
lights
thing
that
I
have
it's
available.
It's
not
gonna
work
because
it
takes
some
other
arguments.
It's
not
the
point.
The
point
is
that
now
the
your
internal
node
module
been
like
whatever
local
modules
we
have
installed
they're
available
as
a
command
for
this
prompt
now,
like.
A
And
it's
very,
very
useful
to
like
you,
can't
define
your
own
path.
You
can
have
your
own
being
in
your
user
local
folder
and
be
dropping
your
your
real
go
commands
there.
It's
something!
I
do
a
lot
yeah!
Yes,
also
any
yeah
package.json
script
yeah!
This
is
super
handy
way
of
like
just
for
project
based
I
know.
Here's
the
crowd
is
most
no
yeah.
So
probably
you
all
know
this
one
already,
but
it's
the
mandatory
one
I
had
to
mention
right.
So
in
your
package
JSON
you
can
define
scripts
and
those
crypts.
A
They
can
be
run
anytime
later
so
npm
run.
You
can
npm
run
hello
as
long
as
hello
is
available
as
a
script
for
that
package,
jason,
it
is
going
to
is
going
to
run.
You
can
reuse.
A
handy
thing
is
that
this
way
you
can
even
reuse
CLI
tools
that
are
local
to
that
project
without
having
to
do
the
pad
thing
like
npm.
Does
it
for
yourself?
Basically,.
A
A
That's
what
we
use
when
we
want
to
distribute
the
comment
line
tools
on
NPM
right,
then
people
can
just
npm
install
it
and
like
conveniently
reuse
it
so
I
tend
to
try
to
share
how
the
things
that
I
do
when
I
find
it
like
little
bit
useful
I'm
going
to
make
it
a
quick
note,
no
module,
you
know
push
to
NPM,
then
myself,
I'll
be
reinstalling
that
later,
whenever
I
switch
computers,
whenever
something
happened
and
other
people
can
reuse
right,
you
can
share
to
your
co-workers.
Oh
I
have
a
have
a
script
for
that.
A
Just
MPM
install
this
name.
It's
going
to
do
it
so,
and
here
we
get
to
the
composing
commands
yeah,
which
is
the
powerful
thing
about
the
UNIX
like
the
idea.
Unix
has
this
idea
where
every
command
is
its
own
thing
and
it
tries
to
be
like
really
specific.
Some
of
them
are
really
not
like
some
of
them
get
really
busy.
We
follow
all
the
kinds
of
arguments
and
and
powerful
things.
It
does,
but
the
idea
is
that
you
can.
Are
you
gonna
run?
A
Alas,
it's
going
to
list
the
files
that
are
in
that
folder
right,
you're
gonna
run
cat,
it's
it's
going
to
like
print
the
contents
of
that
file.
You
so
you
can
do
all
can
actually
like
combine
those
together
and
start
creating
like
okay,
now
I'm
creating
my
own
stuff,
I'm
reusing
the
basic
basic
commands
that
are
available.
You
might
be
reusing.
Some
other
commands
that
you
installed
from
from
some
other
open
source
projects,
and
you
can
be
combined
and
together
and
create
your
own
workflow
and
you
can
share
to
people.
A
It's
so
basically
yeah
a
couple
more
examples,
and
this
is
where
things
start
to
get
more
risky,
because
this
might
fail
and
you,
let
me
see,
yeah
I,
think
last
time.
I
had
to
do
this.
So,
let's
just
say:
fine
fine
is
a
command
that
allows
you
to
list
all
the
file
it's
going
to
be
like
recursively
traversing,
all
the
folders
and
like
printing
all
the
files,
and
you
can
specify
arguments
to
start
filter
it
out
like,
in
this
case,
I'm
filtering.
A
Okay,
just
file
that
has
the
name
that
ends
in
a
s,
so
it's
going
to
print
all
the
files
and
no
surprise
there's
a
lot
of
J's
files
in
my
node
modules.
So
let's
say:
okay
I
want
to
get
word.
Five
I
think
I
make
sense
of
a
command
that
I
can
reuse
later.
Where
I
could
like.
Oh,
let's
get
all
these
files
and
then
I
wanna
grab
rap
is
one
very
handy
command
that
allows
you
to
filter
items.
A
So
in
this
case
yeah
I
wanna
I
want
to
be
able
to
just
like
future
out
one
one
of
these
so
get
word
file
it's
going
to
traverse
all
these
files
and
I
want
to
just
like.
Oh
just
give
me
the
ones
that
has
CLI
on
it.
So
you
see
the
other
one
is
gone
and
if
I,
just
okay,
no
actually
just
word
so
all
the
CLI
stuff
is
gone.
It's
just
printed
the
one
that
has
words
word
on
it,
which,
which
is
offensive,
word
filter
there.
A
So
this
is
like
very
basic
first
example
of
using
the
UNIX
pipeline
right.
So
the
idea
here
is
basically
like
the
pipeline's
you
combining
the
output
coming
from
a
command
into
the
second
command
right.
So
this
is
because
it
kinds
of
connecting
pipelines
and
then
the
stream
of
information
flows
through
them-
and
this
is
like
this
is
the
origins
of
the
stream
library
in
a
module.
We
know
Jas,
which
I
always
had
a
hard
time
with
and
I
wish.
I
didn't
miss
the
other
talk
from
météo
about
it,
but
anyways.
A
So
all
this
complex
comes
all
these
concepts
can
actually
come
from
the
units
pipelines
where
you
can
connect.
The
commands
together
right
so
exerts
is
a
handy
utility
that
helps
out
because,
when
you're
connecting
those
pipelines
you're
connecting
the
standard
output
into
the
input
of
the
next
one.
So
when
you
have
a
command
like
cat
that
wants
to
receive
an
argument,
X
X
Argos
is
going
to
help
you
out:
okay,
okay,
not
not
connecting
the
standard
input.
I'm
gonna
read
that
thing
as
an
argument,
so
in
this
case
let's
make
another
handy
command
print
file.
A
So
again
the
same
recepy
had
last
time
with
the
name
and
future
in
Jas.
Then,
let's
just
select
one
so
basically
continue
from
the
idea
of
the
last
command,
but
this
time,
let's
print
the
contents
of
the
file
which
we
just
select
right
so
print
file
and
okay
I
want
that
word
file
again.
But
this
time
printed.
A
Yeah
not
going
to
debug
that
one,
but
let's
just
let's
just
do
it
this
way,
I'm
gonna
do
it
manually,
because
I
probably
just
got
something
wrong
here
and
I'm,
just
gonna
manually
like
instead
of
using
the
argument.
I'm
just
gonna
hurt
type
the
word
here
where
the
argument
usually
goes
and
let's
cut
that
and
there
you
go
like
my.
My
word
file
like
I,
can
see
that
that
that
module
is
actually
very
simple,
very
simple.
It's
just
like
reading
from
a
term
to
block
Jason
and
I.
A
A
A
It
was
going
Wow-
okay,
oh
good.
Okay,
let
me
let
me
move
up.
Yes,
so
continue.
Yes,
you
can
also
write
down
files
from
the
the
pipelines.
They
have
more
operators,
and
this
is
the
only
one
I'm
going
to
be
showcasing
like
basically
the
greater
than
sign
or
smaller
in
anyways
it's
going
to
get
that
stream
and
dump
it
into
a
file.
So
like
very
handy
too,
in
this
case
oh
yeah.
This
is
this
is
a
fun
one
yeah.
So
let
me
get
back
my
demo,
yes
yeah!
A
A
So
let
just
quick
show
what's
going
on
here:
Damodar
Jas
is
basically
doing
the
same
thing
that
other
command
was
doing
using
the
library,
but
this
is
this
time
is
a
JavaScript
file
itself,
so
it's
just
console.log.
So
what
I
want
with
this
is
just
okay,
let's
replace
log
with
error
for
any
file
that
that
I
sent
into
this
thing
so
make
error
and
I
sent
in
demo,
Jas
and
and
I
want
to
save
an
error.
Yes
from
that,
so
I
run
it
and
now
I
can
say:
I
can
see.
Error.
A
Jas
has
the
same
thing,
but
replays
love
with
error,
so
basically
showcasing
the
the
writing
to
a
file
operator
using
the
greater
than
operator
and
multiple
arguments
with
number
two
there.
So
yes
I
hope
we
have
seen
the
light
like:
okay,
okay,
okay,
this
is
good.
This
is
good.
I
can
I
can
actually
reuse
this
like
it's,
not
it's
not
rocket
science
right,
hopefully,
you're
all
good
to
go
like
composing
news.
Your
work
flows
from
the
basic
units
comments
that
you
already
know
and
then
you're
probably
gonna,
be
interesting.
A
You
learn
about
those
some
other
more
like
because
the
more
you
know
the
more
commands
you
start
learning
about
the
more
ideas.
You're
gonna
have
oh
yeah.
This
can
actually
be
automated
like
that,
because
is
that
the
other
tutor
I
just
learned
about
yeah
so
and
I
like
to
introduce,
like
a
very
very
cool
handy
feature,
basically
a
unique
Alaska
UNIX
command
that
just
allows
you
to
turn
any
of
this
stream
input
like
into
interactive
interfaces.
A
So,
given
any
list
and
in
the
shell
you
can
like
okay,
listen
the
files
there,
so
I
can
pipe
that
list
of
files
into
I
pipe
to
and
it's
going
to
build
a
interactive
interface,
oh
nice
and
then
I
can
just
like
select
one
and
what
it
does
is
just
just
prints.
Whatever
you
slept
so
it's
going
to
allow
you
to
connect
that
to
some
other
stuff,
then
you
can
start
creating
really
handy
workflows
right
with
that.
A
A
A
Another
yeah
not
a
very
basic
one.
You
can
have
like
a
list
of
branch
for
a
get
get
get
also
like,
because
it
has
so
many
less
ready
has
little
branches
list
of
comets
this
of
remote
repos
you
might
pointing
to
so
you
can
do
all
sorts
of
like
crazy
ideas.
Okay
I
admit.
Let
me
connect
together.
The
list
of
brands,
then
I
pipe
that
into
the
interactive
thing,
and
then
I
can
like
whoa.
Why
not?
They
can
check
out
into
a
different
right
right.
A
So
yeah
like
hey,
let
me
check
out
but
like
in
this
case.
It
failed
because
I
had
some
modified
files,
but
you
can
get
a
idea
and
yeah
and
it
has
some
handy
options
too,
like
in
this
case
I
have
this
command
for
printing
files
and
it's
going
to
be
a
listening.
Other
files
in
the
folder
and
I'm
gonna
use
this
multiple
argument.
A
dash
M
that
is
going
to
allow
me
to
select
multiple
items
on
that
list.
A
So,
instead
of
being
just
like
selecting,
one
is
going
to
be
like
more
like
filtering
out
the
unselected
files.
So
oh
yeah,
let,
let's
print
out
of
the
things
that
I
selected
in
there,
so
print
files
is
going
to
show
me
your
handle
s.
There
is
now
a
checkbox
or
Duff
and
I
can
go
and
like
oh
yeah,
let's
select
the
demo
and
the
error
and
its
gonna
pipe
that
input
into
cap.
That
is
going
to
print
both
of
them,
and
we
seen
that
earlier
and
you
can
see
it
is
the
same
thing
so.
A
Handling
file
names.
Basically,
it
also
has
like
this
very
handy
thing
when
you're
dealing
with
get
that
when
you're
doing
like
get
status
in
this
case
that
same
fancy
view
with
the
notification
in
there
like
showing
the
showcases
the
status
for
each
file
right,
I'm
gonna
use
this
handy
P
option
that
is
going
to
just
try
to
parse
a
file
the
file
path
out
of
the
item
itself,
so
that
I
get
rid
of
like
the
DS
&
M's
and
question
marks,
so
that
I
can
actually
reuse.
A
That
path
right
away
and
I
can
like
I,
can
just
print
the
info
for
that
one.
So,
as
you
can
see,
the
list
still
has
the
metadata
in
the
beginning,
but
as
soon
as
I
sell
that
one,
the
next
command
works,
because
the
peak
man
like
get
rid
of
all
the
things
that
are
not
part
of
the
file
path.
They're
a
file
name
yeah
and
yeah
last
thing
to
showcase
is
the
fuzzy
finder
out
a
complete
mode?
A
So
basically,
I
can,
like
you
know,
I've,
also
going
to
take
the
opportunity
here
to
show
that
you
can
also
send
in
as
a
file
name.
So,
like
I
can
like
send
him
just
IPT
or
like
the
package
jason.
So
it's
going
to
explode
like
the
file
into
mode
like
for
each
line
is
going
to
become
an
item
and
then
the
argument
is
actually
a.
A
This
is
wrong
in
the
slider,
sorry
about
it,
but
then
it's
just
like
it's
just
going
to
filter
out
basic
based
on
what
you're
typing,
like
a
1,
autocomplete
kind
of
thing,
looking
like
Oh
description,
so
oh
yeah,
so
I
think
that
line
so
we're
gonna
output,
it
so
yeah,
Oh,
crazy
ways
to
like
cool
commands
like
interactive
commands
with
it.
Just
throwing
out
like
a
real,
quick
thing,
I
put
together
for
the
demo.
A
A
But
the
idea
is
kind
of
argument
and
then
gonna
be
sending
into
node,
because
I
want
to
be
able
to
parse
that
metadata
to
retrieve
just
the
result
of
that
kochi
call
and
that
thing
over
there.
Yes,
I'm
gonna
get
only
the
versions
and
then
I'm
going
to
turn
this
into
a
string
and
then
I'm
going
to
type
that
into
I
bt.
A
This
was
too
complicated.
I
should
have
saved
it
for
this,
but
anyways.
Let
me
show
case,
like
document
the
Picasa
vacuum,
and
what
it's
going
to
do
then
you're
going
to
get
the
idea
of
it
like
so
basically,
I'm
fetching
the
metadata
for
I
for
a
specific
package.
In
this
case
I
Apep
to
itself,
then
I
can
get
like
a
list
of
versions
didn't
touch
anything.
A
A
Yeah,
so
I
have
a
list
of
all
the
versions,
so
this
list
what
I
was
doing
after
that
was
like
concatenating
them
like
making
them
a
string
of
like
just
like,
like
we
had
the
LS
in
other
commands
right
and
those
I
can
like
pipe
into
I
pipe
two
and
then
we
can
select
one
and
then,
with
that
selected,
one
I
can
just
like
type
that
into
NPM
install
and
do
like
the
name
of
the
thing
at
that
result.
That
thing
I,
don't
think,
is
gonna
work.
I
had
to
do
that.
A
A
So
yes,
interactive
commands
are
fun
and,
as
the
last
one
I
wanted
to
showcase
is
the
no
test
list
is
the
is
when
I,
when
I
start
digging
into
these,
like
sometimes
it
gets
out
of
hand.
So
this
one
became
like
a
kind
of
larger
project
like
there's
a
lot
of
interest
from
the
community
people
that
just
jump
in
and
start
contributing
more,
so
it
became
kind
of
like
larger
package
because
it
has
like
many
features
around
it.
A
It's
just
not
the
basic
thing
for
my
pipe
to,
but
it
uses
I
pipe
to
to
provide
the
same.
The
same
interface
right
so
basically,
NGO
is
going
to
list
all
the
scripts
you
have
in
that
package
Jason
and
once
you
select
any
of
them,
you
just
hit
enter.
It
runs.
So
that's
the
basic
idea
of
it
right
at
that
point
is
just
like
the
basic
I
pipe
to
kind
of
thing,
but
then
it
it.
Those
are
sort
of
things
like
in
these
comes
from
the
community.
Contributions
like
keep
track
of
the
last
run
command.
A
So
then
you
run
it
again,
like
it's
already
select
right,
super
handy
if
you
like,
using
it
day
to
day
basis
like
and
also,
if
you
just
like,
if
you're
just
maybe
it's
a
task,
you're
running
all
the
time,
then
you
can
remove
the
L.
So
it's
not
no
task
list.
It's
just
running
no
task
like
it
just
runs
the
latest
one,
so
you
can
just
like
be
running
them
again
and
whatever
you
want
to
switch,
you
can
go
back
to
the
L.
A
You
can
select
multiple
items
like
okay,
let's
run
both
of
them
like
same
thing
with
the
multiple
you
still
have
them
selected
by
default,
so
yeah
yeah,
it's
also
available
on
NPM.
You
can
npm
install
ntl
at
the
end
install
I
do
yeah
and
I
hope
you
all
feel
really
confident
about
creating
all
these
workflows.