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

easycli-plugins

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easycli-plugins

Plugin system for EasyCLI

npmnpm
Version
0.0.1
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

@easycli/plugins

Plugin system for EasyCLI applications.

Features

  • Lifecycle Hooks: Hook into onInit, onBeforeCommand, onAfterCommand, onError, and onExit.
  • Flexible Definition: Define plugins as simple objects or factory functions with context.
  • Context Aware: Access CLI configuration and execution context within hooks.

Usage

Defining a Plugin

import { definePlugin } from "@easycli/plugins";

export const loggerPlugin = definePlugin({
  name: "logger",
  hooks: {
    onBeforeCommand: (ctx) => {
      console.log(`Executing command: ${ctx.command}`);
    },
    onAfterCommand: (ctx) => {
      console.log(`Finished command: ${ctx.command}`);
    }
  }
});

Using a Plugin

Plugins are passed to defineCLI in the core package:

import { defineCLI } from "@easycli/core";
import { loggerPlugin } from "./plugins/logger";

const cli = defineCLI({
  name: "my-app",
  plugins: [loggerPlugin],
  commands: { ... }
});

API

definePlugin(def)

Defines a plugin. Can take an object or a function that returns the plugin object.

Hooks available:

  • onInit: Called when CLI starts.
  • onBeforeCommand: Called before a command runs.
  • onAfterCommand: Called after a command runs.
  • onError: Called when an error occurs.
  • onExit: Called before the process exits.

FAQs

Package last updated on 16 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