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

easycli-core

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easycli-core

Core engine for EasyCLI

latest
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

easycli-core

The core engine for building powerful, type-safe CLI applications with EasyCLI.

Features

  • Type-Safe: Full TypeScript support for arguments and flags.
  • Declarative: Define commands and CLIs with simple objects.
  • Fast: deeply nested subcommands with efficient routing.
  • Extensible: Built-in hook system and plugin architecture.

Installation

pnpm add easycli-core

Usage

1. Define a Command

commands/hello.ts:

import { defineCommand } from "easycli-core";

export default defineCommand({
  description: "Say hello",
  flags: {
    name: { type: "string", default: "World", alias: "n" }
  },
  async run({ flags }) {
    console.log(`Hello, ${flags.name}!`);
  }
});

2. Create the CLI

index.ts:

import { defineCLI } from "easycli-core";
import hello from "./commands/hello";

const cli = defineCLI({
  name: "my-cli",
  version: "1.0.0",
  commands: {
    hello
  }
});

cli.run();

API

defineCLI(config)

Creates the CLI application.

  • name: Name of the executable.
  • version: Current version.
  • commands: Object mapping command names to definitions.

defineCommand(definition)

Defines a command with:

  • description: Help text.
  • flags: Flag definitions (type, alias, default).
  • args: Positional argument definitions.
  • run: Async function to execute.

Advanced

  • Hooks: onInit, onExit, onError hooks for lifecycle management.
  • Plugins: Extend functionality with the plugin system.

FAQs

Package last updated on 19 Jan 2026

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