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-floorLive from GitHub
This content is fetched directly from README.md on GitHub and cached for 1 hour.
⭐ 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 requirement | What it asks | Rule |
|---|---|---|
| F3 | every command declares a description | require-command-description |
| F3, H2 | every command declares an example, and every example is one line | require-command-example |
| O3 | command code writes through the output layer, never console.* | no-console-in-command |
| P1 | every prompt is backed by a flag; a flag value skips the prompt | no-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
- To check out the guide, visit eslint.interlace.tools. 📚
npm install eslint-plugin-cli-floor --save-dev⚙️ Configuration Presets
| Preset | Description |
|---|---|
recommended | Description, example and console — the three rules whose evidence is a declaration. |
strict | Every 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
See the ESLint Version Support Policy for the full matrix.
Rules
Legend
| Icon | Description |
|---|---|
| 💼 | 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. |
| Rule | CWE | OWASP | CVSS | Description | 🧠 | 💼 | ⚠️ | 🔧 | 💡 | 🚫 |
|---|---|---|---|---|---|---|---|---|---|---|
| no-console-in-command | Disallow console.* inside a CLI command handler; write through the output layer | 🟢 | ||||||||
| no-prompt-without-flag | Require every interactive prompt in a CLI command to be skippable with a flag | 🟢 | ||||||||
| require-command-description | Require every CLI command to declare a description | 🟢 | ||||||||
| require-command-example | Require 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.
🔗 Related ESLint Plugins
Part of the Interlace ESLint ecosystem — AI-native rules with LLM-optimized error messages:
Security
Code quality
| Plugin | Downloads | Description |
|---|---|---|
eslint-plugin-conventions | Team-specific habits and styles. | |
eslint-plugin-import-next | Fast cycle + import-graph analysis. | |
eslint-plugin-maintainability | Cognitive load and clean-code patterns. | |
eslint-plugin-modernization | ESNext migration + syntax evolution. | |
eslint-plugin-modularity | Structural integrity and DDD patterns. | |
eslint-plugin-operability | Production readiness and resource health. | |
eslint-plugin-react-a11y | React accessibility / WCAG. | |
eslint-plugin-react-features | React best practices and optimization. | |
eslint-plugin-reliability | Runtime 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.