Create CLI’s quickly without any external files!

The entire codebase is minified into a single line, copy and paste it at the top of a new Javascript file and you’re ready to go! A perfect cross-platform alternative to shell scripts in development environments!

/* Using QuiCLI v1.0.0                                                                                                        */

cli.addCommand("iam", (flags) => {
    cli.log(`I’m ${flags.name[0]}, I’m ${flags.age[0]} years old!`);
})
.addFlag("name", "string", true) // name, type, required
.addFlag("age", "number", true)

// Example input: node myapp iam --name John --age 26
// Example output: I’m John, I’m 26 years old!

cli

Function - addCommand

Description: The addCommand function registers a new command to the command pool.

Returns: A Command object to set additional information, eg. flags.

Name Type Description
path string The command name. For nested commands, separate each name with a dot.
callback function The function that will be called when the command is used.

Function - question

Description: Prompts the user for input. (stdin, stdout)

Returns: A promise containing the answer as a string.

Name Type Description
message string The message that comes before the user input.

Function - log

Description: An alternative to console.log() with color styling capabilities.

Name Type Description
args string[] An array of strings to be written to stdout.

Command

Type alias - FlagTypeNames

Description: The names of the types that a command flag can be.

Type: "any" | "string" | "boolean" | "number"

Method - addFlag

Description: Registers a flag to a command.

Returns: A command object for chaining.

Name Type Description
name string The name of the flag. Use "*" to accept any flag.
type FlagTypeNames The type of value this flag will accept. "any" by default.
required boolean Is this flag required or optional?