Skip to main content
interlace
Plugin: cli-floor

eslint-plugin-cli-floor

The CLI floor for commander, yargs and burgee programs, held in the source

Agent-ready CLIs

Every command describes itself, shows a one-line example, writes through the output layer, and never asks a question a flag could have answered.

Install

npm install -D eslint-plugin-cli-floor

Live from GitHub

This content is fetched directly from README.md on GitHub and cached for 1 hour.

Live README from GitHubfrom eslint-plugin-cli-floor/README.md, cached for 1 hour.Edit on GitHub

⭐ If this plugin caught a real bug for you, star the repo — it's the signal that keeps these rules maintained.

Description

The CLI floor — commander, yargs and burgee commands with descriptions, one-line examples, no console, and a flag behind every prompt.

It is the lint half of burgee's CLI floor: the requirements whose stated behaviour is a property of a program's source, which a runtime cannot hold for a program that never adopted it. They apply to any CLI built on commander or yargs — burgee or not.

burgee requirementWhat it asksRule
F3every command declares a descriptionrequire-command-description
F3, H2every command declares an example, and every example is one linerequire-command-example
O3command code writes through the output layer, never console.*no-console-in-command
P1every prompt is backed by a flag; a flag value skips the promptno-prompt-without-flag

Scope: every rule reads a command only when its host is proven by import — the receiver of .command() resolves, through ESLint's scope analysis, to commander's Command / program / createCommand, to a yargs() instance, to a parameter typed Command or Argv from those modules, or to the object given to burgee's defineCommand. .command(), .action() and .example() are ordinary method names that routers, job queues and ORMs own too; none of them is ever reported.

What it does not do: follow a handler or a prompt into a helper defined elsewhere, or read a command declared in another file. Where the source cannot be read — a spread, a description in a variable, a command module imported by path — the rule abstains.

  • Why — a linter nobody reads protects nothing. We would rather miss a finding than spend your attention on one that was never real.
  • How — evidence, not names. A rule fires on what the code does, resolved through the AST and ESLint's own scope analysis.
  • What — every finding carries its fix, in prose for a human and as structured JSON for an agent. Security rules add a CWE mapping and, where assigned, a CVSS score.

That trade costs recall, and we measure it: methodology · results · a false positive is a bug.

Getting Started

npm install eslint-plugin-cli-floor --save-dev

⚙️ Configuration Presets

PresetDescription
recommendedDescription, example and console — the three rules whose evidence is a declaration.
strictEvery rule, including no-prompt-without-flag, which waits here until its precision is measured on real CLIs.

Usage

// eslint.config.js
import cliFloor from 'eslint-plugin-cli-floor';

export default [cliFloor.configs.recommended];

Or wire the rules yourself:

import cliFloor from 'eslint-plugin-cli-floor';

export default [
  {
    plugins: { 'cli-floor': cliFloor },
    rules: {
      'cli-floor/no-console-in-command': 'error',
    },
  },
];

oxlint

Every rule in this plugin runs on oxlint as well as ESLint:

{ "jsPlugins": ["eslint-plugin-cli-floor/oxlint"] }

📦 Compatibility

PackageVersion
commandernpm
yargsnpm
burgeenpm
ESLintnpm
Node.jsnode

See the ESLint Version Support Policy for the full matrix.

Rules

Legend

IconDescription
💼Recommended: Included in the recommended preset.
⚠️Warns: Set to warn in recommended preset.
🔧Auto-fixable: Automatically fixable by the --fix CLI option.
💡Suggestions: Providing code suggestions in IDE.
🚫Deprecated: This rule is deprecated.
🟢Type-unaware: AST-only, runs in oxlint JS-plugin tier.
🟡Type-aware (refining): pure-AST primary path; types refine precision.
🟠Type-aware (graceful): requires TS program; silent without it.
RuleCWEOWASPCVSSDescription🧠💼⚠️🔧💡🚫
no-console-in-commandDisallow console.* inside a CLI command handler; write through the output layer🟢
no-prompt-without-flagRequire every interactive prompt in a CLI command to be skippable with a flag🟢
require-command-descriptionRequire every CLI command to declare a description🟢
require-command-exampleRequire every runnable CLI command to declare an example, and every example to be a single line🟢

⭐ Support & follow

If this plugin caught a real bug for you, star the repo — stars are the signal that keeps the Interlace ESLint ecosystem maintained — and follow the writeups on Dev.to for the benchmarks and security research behind these rules.

GitHub stars

Part of the Interlace ESLint ecosystem — AI-native rules with LLM-optimized error messages:

Security

PluginDownloadsDescription
eslint-plugin-anthropic-securitydownloadsAnthropic SDK security.
eslint-plugin-browser-securitydownloadsXSS, DOM security.
eslint-plugin-drizzle-securitydownloadsDrizzle security.
eslint-plugin-express-securitydownloadsExpress middleware hardening.
eslint-plugin-gemini-securitydownloadsGoogle Gemini SDK security.
eslint-plugin-jwt-securitydownloadsToken security.
eslint-plugin-knex-securitydownloadsKnex security.
eslint-plugin-lambda-securitydownloadsAWS Lambda hardening.
eslint-plugin-mcp-sdk-securitydownloadsMCP SDK security.
eslint-plugin-mongodb-securitydownloadsMongoDB injection.
eslint-plugin-mysql-securitydownloadsMySQL security.
eslint-plugin-nestjs-securitydownloadsNestJS framework hardening.
eslint-plugin-node-securitydownloadsServer-side patterns.
eslint-plugin-openai-securitydownloadsOpenAI SDK security.
eslint-plugin-postgresql-securitydownloadsPostgreSQL security.
eslint-plugin-prisma-securitydownloadsPrisma security.
eslint-plugin-secure-codingdownloadsInjection prevention.
eslint-plugin-sequelize-securitydownloadsSequelize ORM security.
eslint-plugin-sqlite-securitydownloadsSQLite security.
eslint-plugin-supabase-securitydownloadsSupabase security.
eslint-plugin-typeorm-securitydownloadsTypeORM security.
eslint-plugin-vercel-ai-securitydownloadsAI SDK security.

Code quality

PluginDownloadsDescription
eslint-plugin-conventionsdownloadsTeam-specific habits and styles.
eslint-plugin-import-nextdownloadsFast cycle + import-graph analysis.
eslint-plugin-maintainabilitydownloadsCognitive load and clean-code patterns.
eslint-plugin-modernizationdownloadsESNext migration + syntax evolution.
eslint-plugin-modularitydownloadsStructural integrity and DDD patterns.
eslint-plugin-operabilitydownloadsProduction readiness and resource health.
eslint-plugin-react-a11ydownloadsReact accessibility / WCAG.
eslint-plugin-react-featuresdownloadsReact best practices and optimization.
eslint-plugin-reliabilitydownloadsRuntime stability and error safety.

📄 License

MIT © Ofri Peretz

View README.md on GitHub →

Building secure JavaScript with Interlace? Star the repo to get new rules and CWE coverage as we ship them — or follow the AI-code-security benchmarks behind them.