Build modern command line apps with Lesy js

Lesy is a super flexible and lightweight CLI framework to build damn good command line apps without too much boilerplate.

Sub commands · Plugin support · Auto help · Web interface · Typescript · Middleware architecture · Better testing · Configurable · Lightweight · Even more ·
Step 1:

Generate a new project

~/terminal
> npx lesy new my-cli
Step 2:

Write your first command

~/my-cli/src/hello.js
export default {
  name: "greet",
  run:() => console.log("Hello!")
}
Step 3:

Execute the command

~/my-cli
> ./bin/cmd greet

Multiple formats

Commands can be a simple object, class or function. And with efficient file discovery, just provide file path or directory for lookup

Deeply nested sub commands

With just an one line change, run unlimited multi level nested sub commands

Run programatically

For apps like bots, or for complex use case, parse, find and run commands externally

Async execution

Commands are fully suported for async run

... and more

Powerful flag parsing, inbuild utilities, ...

Smart arg parser and command architecture

By keeping all the complex logic under the carpet, lesy surfaces intuitive commands API and powerful mechanism to run them flawlessly. Not just that, commands also packed with tons of cool features.

Learn more

Efforlessly hijack the flow with middlewares

Middlewares are simple functions which will be executed during the lifecyle. With this, you will be able to add new functionallity, tweak and change the entire behaviour of the command at any point of the flow.

Learn more
@lesy/lesy-plugin-generator
@lesy/lesy-plugin-store
@lesy/lesy-plugin-config
@lesy/lesy-plugin-help
@lesy/lesy-plugin-pilot
@lesy/lesy-plugin-artist
@lesy/lesy-plugin-validator
@lesy/lesy-plugin-essentials
@lesy/lesy-plugin-prompt

Extend and tweak the core with plugins

By design, Lesy core is a thin layer of fundamental features which allows to extend the capabilities by adding extensions.

There are quite a few official plugins available for most common use cases like, automatic help generation, scaffolding, prompting, Web Interface, and more.

Learn more

Run commands from web interface

Pilot Dashboard is one of the lesy plugins which allows you to view and run commands of any lesy projects from web UI. Pilot comes with inbuild customizable console panel, config viewer, prompt modal support, responsive layout and more.

Learn more

Paint and redraw interface elements

Artist UI is an another cool plugin which helps you to render dynamic elements by updating the screen content on data change.

Artist can also be used independently without lesy, and it comes with commonly used interface elements like, spinner, progress bar, log, colors, layout, and much more. Also, Artist can be extended with plugins!

Learn more
import { resolve } from "path";
import { LesyTestBed } from "@lesy/testbed";
import greetCmd from "../greet";

describe("CLI", () => {
  let app;

  beforeAll(() => {
    app = new LesyTestBed({
      root: resolve(__dirname, "./"),
      commands: [greetCmd],
    });
  });

  it("should log proper output", async () => {
    let response = await app.run(["greet"]);
    expect(response).toContain("hello!");
  });
});

Unit and integration testing made simpler

With Lesy TestBed API, test your commands, middlewares, features and plugins without much boilerplate code.

Learn more

Lesy is just faster and performant

Though lesy does too many things, it is still faster by executing only necessary code.

Learn more

Lesy has more for you

If you are still hungry, here's some more features you might like

Configurable

Whether it is a simple global/local config or from config file, its just easy

Toolkit

Add new features and share between commands and middlewares using toolkit

Typescript

Write in typescript with full types support without any additional setup

Lesy CLI

Scaffold new project and run Pilot web UI

Plugins plugin

Allow plugin support to own or community plugins

Inbuilt utils

Bundled with inbuilt utils to work with colors and spinner

Subscribe for latest news

We wont send you spams or any nonsense mails!