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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ooneex/cli

v1.54.0

Published

Interactive CLI toolkit for scaffolding Ooneex projects, modules, controllers, services, repositories, and more with customizable code generation templates

Readme

@ooneex/cli

Interactive CLI toolkit for scaffolding Ooneex projects, modules, controllers, services, repositories, and more with customizable code generation templates.

Bun TypeScript MIT License

Features

Application Scaffolding - Generate complete Ooneex applications with best practices

Module Generation - Create feature modules with controllers, entities, and services

Controller Generation - Generate HTTP and WebSocket controllers with route definitions

Service Generation - Create service classes with dependency injection

Entity & Repository Generation - Generate entities and repository classes

Middleware Generation - Scaffold HTTP and WebSocket middleware classes

Interactive Prompts - User-friendly prompts with input validation constraints

Docker Support - Add docker services to docker-compose.yml

Migration & Seeds - Create database migrations and seed files

AI & Vector Database - Generate AI and vector database classes

Claude Skill Generation - Scaffold Claude AI skill templates

Comprehensive Templates - 20+ code generation commands covering cron, logger, mailer, storage, analytics, cache, permissions, pub/sub, and more

Installation

Bun (Global)

bun add -g @ooneex/cli

Bun (Local)

bun add -D @ooneex/cli

Usage

Creating a New Application

ooneex app:create

This command will interactively prompt you for:

  • Application name
  • Destination path

The generated application includes:

  • Configured package.json with all necessary dependencies
  • TypeScript configuration
  • Biome linting setup
  • Nx workspace configuration
  • Git configuration with .gitignore
  • Initial app module

Generating a Module

ooneex module:create

Creates a new feature module with:

  • Module file (src/ModuleNameModule.ts)
  • Migrations directory (src/migrations/)
  • Seeds directory (src/seeds/)
  • Bin scripts (bin/migration/up.ts, bin/seed/run.ts)
  • Test file
  • package.json and tsconfig.json

Generating a Controller

ooneex controller:create

Interactive prompts will ask for:

  • Controller name
  • Socket or HTTP controller
  • Route name (e.g., api.user.create)
  • Route path
  • HTTP method (for HTTP controllers)

Example output:

✔ src/controllers/UserListController.ts created successfully
✔ src/types/routes/api.users.list.ts created successfully
✔ tests/controllers/UserListController.spec.ts created successfully

Generating a Service

ooneex service:create

Creates a service class with:

  • Service file
  • Test file

Generating an Entity

ooneex entity:create

Creates a TypeORM entity with:

  • Entity file
  • Test file

Installing Zsh Completions

ooneex completion:zsh

Installs Zsh completions for the oo and ooneex commands with context-aware option suggestions per command.

Additional Commands

| Command | Description | |---------|-------------| | completion:zsh | Install Zsh completion for oo command | | ai:chat:create | Generate a new AI chat class | | ai:tool:create | Generate a new AI tool class | | ai:middleware:create | Generate a new AI middleware class | | analytics:create | Generate a new analytics class | | cache:create | Generate a new cache class | | cron:create | Generate a new cron class | | database:create | Generate a new database class | | docker:create | Add a docker service to docker-compose.yml | | event:create | Generate a new PubSub event class | | flag:create | Generate a new feature flag class | | logger:create | Generate a new logger class | | mailer:create | Generate a new mailer class | | middleware:create | Generate a new middleware class | | migration:create | Generate a new migration file | | permission:create | Generate a new permission class | | repository:create | Generate a new repository class | | seed:create | Generate a new seed file | | storage:create | Generate a new storage class | | translation:create | Generate a new translation class | | vector-database:create | Generate a new vector database class | | claude:init | Initialize Claude configuration and skills |

API Reference

Interfaces

ICommand<Options>

Interface for creating custom CLI commands.

interface ICommand<Options extends Record<string, unknown> = Record<string, unknown>> {
  run: (options: Options) => Promise<void> | void;
  getName: () => string;
  getDescription: () => string;
}

Types

CommandClassType

type CommandClassType = new (...args: any[]) => ICommand;

Decorators

@decorator.command()

Decorator to register a command with the CLI container.

import { decorator } from '@ooneex/cli';
import type { ICommand } from '@ooneex/cli';

@decorator.command()
class MyCustomCommand implements ICommand {
  public getName(): string {
    return 'my:command';
  }

  public getDescription(): string {
    return 'My custom command description';
  }

  public async run(options: Record<string, unknown>): Promise<void> {
    // Command implementation
  }
}

Advanced Usage

Creating Custom Commands

import { decorator } from '@ooneex/cli';
import type { ICommand } from '@ooneex/cli';
import { TerminalLogger } from '@ooneex/logger';

type MyCommandOptions = {
  name?: string;
  verbose?: boolean;
};

@decorator.command()
class MyCustomCommand implements ICommand<MyCommandOptions> {
  private readonly logger = new TerminalLogger();

  public getName(): string {
    return 'custom:generate';
  }

  public getDescription(): string {
    return 'Generate custom files for the project';
  }

  public async run(options: MyCommandOptions): Promise<void> {
    const { name, verbose } = options;

    if (verbose) {
      this.logger.info('Running in verbose mode');
    }

    // Custom generation logic
    await Bun.write('output.ts', 'export const example = true;');

    this.logger.success('File generated successfully', undefined, {
      showTimestamp: false,
      showArrow: false,
      useSymbol: true,
    });
  }
}

Using with Arguments

ooneex controller:create --name UserList --route-name api.users.list --route-path /api/users --route-method GET

Available CLI flags: --name, --route-name, --route-path, --route-method, --is-socket, --dir, --channel, --table-name.

Programmatic Usage

import { getCommand } from '@ooneex/cli';

const command = getCommand('controller:create');

if (command) {
  await command.run({
    name: 'UserList',
    isSocket: false,
    route: {
      name: 'api.users.list',
      path: '/api/users',
      method: 'GET'
    }
  });
}

Generated Application Structure

When running app:create, the following structure is created:

my-app/
├── .husky/
│   ├── commit-msg
│   └── pre-commit
├── modules/
│   └── app/
│       ├── src/
│       │   └── AppModule.ts
│       │   └── index.ts
│       ├── tests/
│       │   └── AppModule.spec.ts
│       ├── var/
│       ├── package.json
│       └── tsconfig.json
├── .commitlintrc.ts
├── .env
├── .env.example
├── .gitignore
├── biome.jsonc
├── bunfig.toml
├── nx.json
├── package.json
└── tsconfig.json

Generated Module Structure

modules/
└── user/
    ├── bin/
    │   ├── migration/
    │   │   └── up.ts
    │   └── seed/
    │       └── run.ts
    ├── src/
    │   ├── migrations/
    │   │   └── migrations.ts
    │   ├── seeds/
    │   │   └── seeds.ts
    │   └── UserModule.ts
    ├── tests/
    │   └── UserModule.spec.ts
    ├── package.json
    └── tsconfig.json

Error Handling

The CLI provides informative error messages when something goes wrong:

import { CommandException } from '@ooneex/cli';

// Errors are automatically caught and displayed
// with proper formatting via TerminalLogger

Environment

The CLI respects the following environment variables:

| Variable | Description | |----------|-------------| | CWD | Custom working directory for file generation |

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Development Setup

  1. Clone the repository
  2. Install dependencies: bun install
  3. Run tests: bun run test
  4. Build the project: bun run build

Guidelines

  • Write tests for new features
  • Follow the existing code style
  • Update documentation for API changes
  • Ensure all tests pass before submitting PR

Made with ❤️ by the Ooneex team