npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

superclix

v1.0.1

Published

A lightweight and extensible TypeScript CLI framework with autocomplete, history, pagination, and i18n.

Readme

⚡ Superclix — TypeScript CLI Framework

Superclix is a lightweight and modern framework for building interactive CLI interfaces in TypeScript. It combines dynamic autocomplete, command history, pagination, interactive selectors, and i18n — all without relying on heavy external dependencies.


🚀 Main Features

  • 🧠 Dynamic Autocomplete (with inline ghost text or via Tab)
  • 🔁 Command History (navigable with ↑ / ↓)
  • 📜 Built-in Pagination (ctx.paginate)
  • 🎯 Interactive Selectors (ctx.select)
  • 🌍 Internationalization (i18n) (English / French)
  • ⚙️ Modular Architecture: Command, Feature, CLI, Adapter
  • 💥 Built-in Commands: help, exit
  • 🔔 Non-TTY Mode for CI/CD environments

🧩 Installation

npm install superclix
# or
yarn add superclix

🧠 Minimal Example

Here’s a simple CLI example using autocomplete and pagination:

import { Command, createCLI } from "superclix";
import { AutocompleteFeature } from "superclix/dist/features/autocomplete";
import { PaginationFeature } from "superclix/dist/features/pagination";
import { createLogger } from "superloggix/dist/logger";

// Create a compatible logger
const logger = createLogger({ level: "info", prefix: "⚡" });

// Initialize CLI
const cli = createCLI({
  logger,
  prompt: "superclix> ",
  enableGhost: true,
});

// Enable features
cli.use(new AutocompleteFeature());
cli.use(new PaginationFeature());

// Example command
class EchoCommand extends Command {
  public readonly signature = "echo <text>";
  public readonly description = "Displays the provided text back to the user.";

  constructor() {
    super("echo");
  }

  public async execute(ctx) {
    ctx.logger.info(ctx.args.text || "(no text provided)");
  }

  public async getCompletions() {
    return { args: ["Hello", "World", "Superclix", "TypeScript"] };
  }
}

// Register and run
cli.register(new EchoCommand());
cli.run();

💡 Built-in Commands

| Command | Description | | ------- | -------------------------------------------- | | help | Lists all available commands with pagination | | exit | Gracefully exits the CLI session |


⚙️ Core API

🔸 createCLI(options)

Creates a new CLI instance.

const cli = createCLI({
  logger,            // Required logger
  prompt: "mycli> ", // Displayed prompt
  enableGhost: true, // Enables inline ghost suggestions
});

🔸 class Command

Base class to extend when creating a custom command.

Key methods:

  • execute(ctx) — main command logic
  • getCompletions(ctx) — static autocompletion
  • onAutocomplete(ctx, argIndex, currentValue) — dynamic autocompletion

🔸 CLIContext

Object provided to every command:

| Property | Type | Description | | ----------------- | ------------------- | -------------------------------- | | args | Record<string, any> | Positional arguments | | options | Record<string, any> | Options --key=value | | logger | Logger | Injected logger | | paginate(lines) | Function | Displays paginated output | | select(options) | Function | Provides an interactive selector | | exit() | Function | Gracefully exits the CLI |


🧰 Local Development

Package organization is private, sorry.


🧱 Project Structure

src/
├── core/
│   ├── CLI.ts               # Main class
│   ├── Command.ts           # Base class for commands
│   ├── Feature.ts           # Base for features
│   ├── adapters/
│   │   ├── TTYAdapter.ts    # Interactive mode
│   │   └── NonTTYAdapter.ts # Non-interactive mode
│   └── Parser.ts            # Argument parser
├── features/
│   ├── autocomplete.ts
│   ├── pagination.ts
│   └── selector.ts
├── utils/
│   ├── i18n.ts
│   ├── colors.ts
│   └── types.ts
└── dev/
    └── index.ts             # Example playground

🧪 Example Commands

  • echo <text> → repeats the given text
  • logs [--level=info|debug|warn|error] → paginated logs
  • select → interactive selector
  • fruit <name> [--color|--origin] → dynamic autocompletion
  • config <section> [--set|--get] → contextual sub-arguments

🌍 Localization

Available languages:

  • 🇬🇧 English (default)
  • 🇫🇷 French

Change the default locale:

import { setDefaultLocale } from "superclix/dist/utils/i18n";
setDefaultLocale("fr");

🧩 License

MIT © 2025 — Built with ⚡ by Matt'