New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

quicli-js

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quicli-js

A CLI framework with zero dependencies!

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Logo

Why QuiCLI?

QuiCLI is a lightweight CLI framework that was intentionally designed to be used without a package manager or any external files. The built code has no dependencies and is entirely minified into a single line. Paste it on top of a new .js file and you're ready to go! No package.json, no node_modules and your colleagues don't have to install any global packages making it a great cross-platform alternative to shell scripts in development environments.

When creating CLI's with QuiCLI, the goal of the program should be to assist development. It's not meant to be used to create CLI's that will eventually be provided to end-users. There are better, and more feature-rich CLI frameworks that can help you achieve that goal.

Getting started

  • Simply copy and paste the contents of the lib/quicli.min.js file in this repository to a new .js file.
  • On a new line below the pasted contents, add some commands (Check the examples below).
  • Run your CLI with node myapp mycommand.

Features

Nested commands

cli.addCommand("foo.bar", (flags) => {
    cli.log("Hello world!");
})
> node myapp foo bar
Hello world!

Typed flags

cli.addCommand("foo", (flags) => {
    cli.log(flags.bar[0], "is a nice number!");
})
.addFlag("bar", "number", true) // Name, Type, Required
> node myapp foo
Missing flag: bar
> node myapp foo --bar hello
Incorrect type: bar must be a number!
> node myapp foo --bar 24
24 is a nice number!

Input handling

cli.addCommand("foo", async (flags) => {
    const answer = await cli.question("What's up?");
    cli.log("Your answer: " + answer);
})
> node myapp foo
What's up? Nothing much...
Your answer: Nothing much...

Styled output

cli.addCommand("ping", (flags) => {
    cli.log(
        $.BOLD +
        $.RED + "P" +
        $.YELLOW + "O" +
        $.GREEN + "N" +
        $.BLUE + "G" +
        $.MAGENTA + "!"
    );
})

Documentation

Documentation can be found on the projects website.

Keywords

cli

FAQs

Package last updated on 04 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts