skills/stricli/SKILL.md
Build type-safe CLI applications with Stricli. Use when creating TypeScript CLIs with typed flags/positional args, multi-command routing, or automatic help generation. Stricli catches parameter errors at compile time. Use this whenever the user mentions CLI frameworks, command-line tools, argument parsing, or typed commands in TypeScript.
npx skillsauth add johnie/skills stricliInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Stricli is Bloomberg's type-safe CLI framework for TypeScript. It focuses on strongly typed flags and positional arguments, explicit command routing, automatic help generation, and isolated command context.
Prefer current upstream APIs and terminology:
buildCommand({ func | loader, parameters, docs })buildRouteMap({ routes, docs, aliases?, defaultCommand? })buildApplication(rootCommandOrRouteMap, config)run(app, inputs, context)CommandContext for runtime contextStricli's official quick start is Node and npm oriented. Follow that by default, but keep install and execution guidance package-manager agnostic when helpful.
npm install @stricli/core # required
npm install @stricli/auto-complete # optional, bash completion support
# pnpm add / bun add also work
Prefer the upstream generator when scaffolding from scratch:
npx @stricli/create-app@latest my-app
# pnpm dlx / bunx also work
Create a minimal single-command CLI.
import { buildCommand } from "@stricli/core";
interface GreetFlags {
readonly shout?: boolean;
}
export const greetCommand = buildCommand({
docs: {
brief: "Print a greeting"
},
parameters: {
flags: {
shout: {
kind: "boolean",
brief: "Uppercase the greeting",
optional: true
}
},
positional: {
kind: "tuple",
parameters: [
{
brief: "Name to greet",
parse: String,
placeholder: "name"
}
]
}
},
func(this, flags: GreetFlags, name: string) {
const message = `Hello, ${name}!`;
this.process.stdout.write(
`${flags.shout ? message.toUpperCase() : message}\n`
);
}
});
import { buildApplication } from "@stricli/core";
import { version } from "../package.json";
import { greetCommand } from "./commands/greet";
export const app = buildApplication(greetCommand, {
name: "my-cli",
versionInfo: {
currentVersion: version
}
});
import { run } from "@stricli/core";
import { app } from "./app";
await run(app, process.argv.slice(2), { process });
buildCommand() creates a command from either an inline func or a lazy loaderbuildRouteMap() organizes commands into nested subcommandsbuildApplication() wraps a root command or route map with runtime configurationrun() executes the application with already-tokenized CLI input and a runtime contextSee Commands, Routing, and Applications for current API details.
Stricli supports four flag kinds and two positional modes:
parsed, enum, boolean, countertuple, arrayVariadic behavior is configured with variadic, not a separate flag kind.
See Parameters.
buildCommandparametersbuildApplication(command, config)run(app, process.argv.slice(2), { process })buildRouteMapdefaultCommand if neededbuildApplication(routes, config)Prefer the lazy loader pattern for heavy commands:
import { buildCommand, numberParser } from "@stricli/core";
export const analyzeCommand = buildCommand({
docs: {
brief: "Analyze a report"
},
parameters: {
flags: {
depth: {
kind: "parsed",
parse: numberParser,
brief: "Traversal depth",
optional: true,
default: "1"
}
}
},
loader: async () => import("./impl")
});
CommandContextthisCommandContext to inject custom services or shared staterun(app, inputs, context) or by importing the command implementation directlySee Context and Examples.
@stricli/auto-complete currently supports bash. The current public integration is based on:
@stricli/auto-completebuildInstallCommand() / buildUninstallCommand() commands for your appSee Auto-Complete.
strict: true in tsconfig.json; Stricli relies on TypeScript inference--version is available only when versionInfo is configured on the application--helpAll is built in and reveals hidden commands and flags-h is reserved for help, -H for help-all, and -v for version when version info is enabledpnpm and bun alternatives when useful, but keep npm examples firstOnly use APIs documented in this skill and its reference files. Stricli is a niche library with a narrow public API surface — do not invent flag kinds, parsers, application config fields, or auto-complete features that are not shown here. If something is not documented, assume it does not exist.
buildCommand, buildRouteMap, buildApplication, run, lazy loaders, route aliases, default commandsCommandContext, custom context, testing, exit-code handling@stricli/auto-completetools
WordPress CLI operations for database management, plugins, themes, users, content, and site configuration. Use for migrations, bulk updates, user audits, content imports, or any wp-cli commands.
tools
Designs complex generic types, refactors `any` to strict alternatives, creates type guards and utility types, resolves TypeScript compiler errors, and explains type-level concepts. Use when the user asks about TypeScript (TS) types, generics, type inference, type guards, removing `any` types, strict typing, type errors, `infer`, `extends`, conditional types, mapped types, template literal types, branded/opaque types, `satisfies`, `unknown`, function overloads, declaration merging, strict mode, or utility types like `Partial`, `Record`, `ReturnType`, `Awaited`, and `NoInfer`.
tools
Create, update, and review GitHub PRs. Commands: create [-v] [--draft], update [-v], review <number|url>. Generates structured PR bodies with conditional sections (Testing, Deployment, Screenshots). Requires gh CLI.
tools
Fetch and analyze GitHub Actions logs via gh CLI. Diagnoses CI failures, detects flaky tests, profiles slow steps, and suggests fixes. Use when CI is broken, builds are failing, or you need to understand workflow run history.