cli

A command-line application entry-point template for TypeScript projects using Commander, a library for defining terminal commands.

In plain words
What is it for?
Use it when building or rewriting a command-line tool. It covers the main entry file and the expected structure for individual command modules.
Why use it?
It provides a consistent structure for starting the program, registering commands, handling errors, and exposing the package version.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/flagler-county-bocc/mcp-forge/cli
Clone the repo
git clone --depth 1 https://github.com/Flagler-County-BoCC/mcp-forge

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 657 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00657
Opus 5 $0.00000 $0.00329
Sonnet 5 $0.00000 $0.00131
Haiku 4.5 $0.00000 $0.00066

Measured yesterday against content hash 7aa977cb8fff, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cli scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/entrypoints/cli.md · 79 lines

How it starts

The opening of the file, as written. The whole thing — 79 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Entrypoint — cli

This file is consumed by Step 8 of the rewrite process. Apply when AUDIT_MANIFEST.projectType === "cli".

src/index.ts — CLI Entry

#!/usr/bin/env node
import { program } from 'commander';
import { register<Command>Command } from './commands/<command-name>/<command-name>.command.js';

program
  .name('<projectName>')
  .description('<one-line description from package.json>')
  .version(process.env['npm_package_version'] ?? '0.0.0');

// Register each command from AUDIT_MANIFEST.cliCommands
register<Command>Command(program);

program.parseAsync(process.argv).catch((err: unknown) => {
  console.error(err instanceof Error ? err.message : String(err));
  process.exit(1);
});

The shebang #!/usr/bin/env node must be the literal first line of the compiled dist/index.js.

src/commands//.command.ts

import type { Command } from 'commander';
import { validate } from '../../lib/validate.js';
import { <Command>OptionsSchema } from './<command-name>.options.js';
import { <command>Service } from '../../lib/container.js';
import { logger } from '../../lib/logger.js';

export function register<Command>Command(program: Command): void {
  program
    .command('<command-name>')
    .description('<description>')
    .option('--<flag>', '<description>')
    .argument('<arg>', '<description>')
    .action(async (arg: unknown, opts: unknown) => {
      const options = validate(<Command>OptionsSchema, { arg, ...opts });
      try {
        const result = await <command>Service.<method>(options);
        console.log(JSON.stringify(result, null, 2));
      } catch (error) {
        logger.error({ err: error }, 'Command failed');
        process.exit(1);
      }
    });
}

Rules:

  1. One file per command; one register<X>Command function per file.
  2. console.log is only permitted in command handler .action() callbacks — nowhere else in src/.
  3. Exit codes: 0 = success, 1 = error, 2 = misuse (bad arguments — Commander handles this).
  4. Never process.exit() outside of command .action() handlers and the top-level catch.
  5. Validate all CLI arguments and options with validate().

Read the full file on GitHub · 79 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 79 lines · 0 tokens per session scan A 7aa977cb8fff

Subscribe to this mod's changes

cli is a command published in the GitHub repository Flagler-County-BoCC/mcp-forge (1 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 657 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.