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

@wolfstar/plugin-subcommands-advanced

v2.0.1

Published

Plugin for @wolfstar/http-framework to modularize slash subcommands into separate command classes

Readme

@wolfstar/plugin-subcommands-advanced

Plugin for @wolfstar/http-framework that lets you split slash subcommands (and subcommand groups) into separate command classes, instead of putting every handler method on the parent.

Adapted from @kaname-png/plugin-subcommands-advanced for WolfStar’s HTTP interaction framework.

Installation

pnpm add @wolfstar/http-framework @wolfstar/plugin-subcommands-advanced

Usage

Import the register entrypoint before creating the client:

import "@wolfstar/plugin-subcommands-advanced/register";
import { Client, RegisterCommand } from "@wolfstar/http-framework";
import {
  Command,
  Subcommand,
  RegisterAsSubcommand,
  RegisterAsSubcommandGroup,
} from "@wolfstar/plugin-subcommands-advanced";

const client = new Client({
  subcommandsAdvanced: {
    // optional: piece names become parent/sub or parent/group/sub
    nameCommandsAutogenerated: true,
  },
});

Recommended layout:

commands/
└── utils/
    ├── parent.ts          // parent chat-input command
    ├── ping.ts            // subcommand
    └── poll/
        └── create.ts      // grouped subcommand

Parent command

import { RegisterCommand } from "@wolfstar/http-framework";
import { Subcommand } from "@wolfstar/plugin-subcommands-advanced";

@RegisterCommand((builder) =>
  builder
    .setName("utils")
    .setDescription("Utility commands")
    .addSubcommandGroup((group) => group.setName("poll").setDescription("Poll tools")),
)
export class UtilsCommand extends Subcommand {}

Direct subcommand

import { Command, RegisterAsSubcommand } from "@wolfstar/plugin-subcommands-advanced";

@RegisterAsSubcommand("utils", (builder) => builder.setName("ping").setDescription("Ping the bot"))
export class PingCommand extends Command {
  public override chatInputRun(interaction: Command.ChatInputInteraction) {
    return interaction.reply({ content: "Pong!" });
  }
}

Grouped subcommand

import { Command, RegisterAsSubcommandGroup } from "@wolfstar/plugin-subcommands-advanced";

@RegisterAsSubcommandGroup("utils", "poll", (builder) =>
  builder.setName("create").setDescription("Create a poll"),
)
export class PollCreateCommand extends Command {
  public override chatInputRun(interaction: Command.ChatInputInteraction) {
    return interaction.reply({ content: "Created!" });
  }
}

Constructor options (no decorators)

import { Command } from "@wolfstar/plugin-subcommands-advanced";

export class PingCommand extends Command {
  public constructor(context: Command.LoaderContext, options: Command.Options) {
    super(context, {
      ...options,
      registerSubCommand: {
        parentCommandName: "utils",
        slashSubcommand: (builder) => builder.setName("ping").setDescription("Ping!"),
      },
    });
  }

  public override chatInputRun(interaction: Command.ChatInputInteraction) {
    return interaction.reply({ content: "Pong!" });
  }
}

How it works

@wolfstar/http-framework routes subcommands to methods on the parent command instance. This plugin:

  1. Lets child command classes register themselves into in-memory registries (by parent name).
  2. After all command pieces are constructed, rebuilds the parent’s chat-input resolver and CommandRouter, installing thin delegate methods that call each child’s chatInputRun.

You do not need to call the optional hooks.subcommands / hooks.groups helpers unless you are registering the parent imperatively and want to attach builders yourself.

Notes

  • HTTP-only: there is no message-command support (unlike the Sapphire original).
  • Child classes should not use @RegisterCommand — only the parent registers the top-level slash command.
  • Subcommand groups must still be declared on the parent (via @RegisterCommand builder or registerApplicationCommands).