Command Line

@web-kits/audio ships a small CLI that installs sound patches into your project as typed TypeScript modules. Patches can come from a central registry, a GitHub repository, a direct URL, or a local path — in every case the CLI writes a generated .ts file per patch and keeps a barrel index.ts up to date.

Run without installing

The CLI is published as the bin field of @web-kits/audio, so you can invoke it with npx, pnpm dlx, or bunx without adding anything to your dependencies.

Running the bare command prints a banner with a short command list. Pass --help for the full reference, or --version to print the installed version.

Commands

CommandAliasesWhat it does
add [source]aInstall sound patches from any source
find [query]f, s, searchSearch the registry by name, tag, or text
listlsList installed patches
remove [names...]rmRemove installed patches
checkCheck the registry for updates
updateupgradeRe-download installed patches
initScaffold a new local patch file

Source formats

add accepts four kinds of source. The CLI picks a strategy based on what the argument looks like.

SourceExampleBehavior
(none)@web-kits/audio addBrowse the registry with a multiselect
Local path@web-kits/audio add ./.web-kits/Scan a directory (or a single .json)
GitHub shorthand@web-kits/audio add raphaelsalaja/audioDiscover patches via the GitHub Tree API
Direct JSON URL@web-kits/audio add https://example.com/sfx.jsonFetch and validate a single patch file

What gets written

Installing a patch creates two things inside the output directory (default .web-kits/):

  1. <slug>.ts — a generated module with one SoundDefinition export per sound plus a _patch: SoundPatch aggregate.
  2. index.ts — a barrel that re-exports every installed patch as a namespace.
.web-kits/index.ts
export * as core from "./core";
export * as playful from "./playful";

In app code, import the barrel and play sounds by name:

import { playful } from "./.web-kits";

playful.tap();
playful.success();