Skip to content

Quick start

Convoker provides several packages. The easiest way to install Convoker is through the bundle package, which comes with the following pieces:

  • @convoker/core: Argument parsing.
    • @convoker/input: Input parsing for commands.
  • @convoker/log: Logging.
  • @convoker/prompt: Prompting.
  • @convoker/theme: Theming utilities.

At the moment, these are the only pieces in Convoker, but in the future, you will have more extras. These extras will need to be installed separately.

You can also install them individually if you prefer.

Terminal window
pnpm add convoker

You can then paste this code to make a Hello World application:

index.js
import { Command, log } from "convoker"; // or:
// import { Command } from "@convoker/core";
// import * as log from "@convoker/log";
const program = new Command();
program.subCommand("greet", (c) =>
c.action(() => {
log.info("Hello, World!");
}),
);
program.run().catch(log.fatal);

You can then run node index.js greet, and it’ll work! Check out our Command Guide for how to create your own subcommands, define command metadata, define middleware and customize argument parsing.