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

@cristiand391/oclif-carapace-spec-plugin

v0.5.1

Published

oclif plugin to generate a carapace spec

Readme

oclif-carapace-spec-plugin

An oclif plugin to generate a carapace spec!

carapace allows to define CLI completions in a spec file, you can use it to get shell completion in all supported shells listed here: https://carapace-sh.github.io/carapace-spec/carapace-spec/usage.html

image image

Supported features

  • Commands
  • Flags
    • Options
    • Exclusive relationships
  • Re-generate spec automatically on plugin install/uninstall
  • Completion overrides (see Macros section below)

Requirements

Install

<CLI> plugins install @cristiand391/oclif-carapace-spec-plugin

Then run the carapace-gen command and follow the instructions to source the spec in your shell.

Macros

carapace allows to use macros for customizing completion style and values:

https://carapace-sh.github.io/carapace-spec/carapace-spec/macros.html

You can use macros to define custom flag completion logic for dynamic flag values that can't be hard-coded in CLIs like usernames, IDs, etc.

Macros file example for the Salesforce CLI:

# this node applies to all commands, define here completion logic for flags that repeat themselves in multiple commands.
persistentFlagsCompletion:
  target-org: ["$(sf org list auth --json | jq -r '.result[].username')"]
  target-dev-hub: ["$(sf org list auth --json | jq -r '.result[] | select(.isDevHub) | .username')"]
  definition-file: ["$files([.json])"]
  manifest: ["$files([.xml])"]
  file: ["$files"]

# override flag completion for specific commands.
# important: command ids need to separated by colons.
commandOverrides:
  flags:
    'project:deploy:start':
      pre-destructive-changes: ["$files([.xml])"]
      post-destructive-changes: ["$files([.xml])"]
    'org:delete:scratch':
        target-org: ["$(sf org list auth --json | jq -r '.result[] | select(.isScratchOrg) | .username')"]
    'org:delete:sandbox':
        target-org: ["$(sf org list auth --json | jq -r '.result[] | select(.isSandbox) | .username')"]

It uses the exec macro for --target-org and --target-dev-hub flags to get completion values from a command, and the files macro for XML/JSON file completion on specific flags.

Usage

  1. Define a YAML file with completion definitions like in the example above.
  2. Set the <CLI>_CARAPACE_SPEC_MACROS_FILE env var to the path to the YAML file.
  3. Run <CLI> carapace-gen --refresh-cache.

[!NOTE]
The <CLI> part in the env var in step 2 refers to the executable name of your oclif CLI. For instance, for the Salesforce CLI (sf) the env var should be SF_CARAPACE_SPEC_MACROS_FILE.

[!NOTE]
This plugin re-generates the carapace spec everytime you install/uninstall plugins via plugins install/uninstall, make sure to set the <CLI>_CARAPACE_SPEC_MACROS_FILE env var in your shell RC file so that you don't miss the custom completions when the automatic re-generation happens under the hood.