Conversation
- Move package.json version parsing to CLI_VERSION constant in config/constants.ts - Add PACKAGE_JSON_SCHEMA to schemas/cli-schemas.ts for reusable validation - Remove duplicate package.json parsing logic from json-formatter.ts - Add CLI_DESCRIPTION constant with setup instructions and configuration examples - Update json-formatter.ts to use CLI_VERSION from constants instead of local parsing - Centralize version management and CLI metadata for easier maintenance
…scription - Remove unused --debug-json option from main command - Fix quote escaping in --config option help text - Import CLI_VERSION and CLI_DESCRIPTION from constants module - Add comprehensive help text with usage examples - Display help automatically when no arguments provided - Consolidate version and description configuration in one place - Improve user experience with clearer command documentation
📝 WalkthroughWalkthroughCentralized CLI version/description constants; removed the Changes
Sequence Diagram(s)(omitted — changes do not introduce a new multi-component control flow) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/schemas/cli-schemas.ts (1)
8-8: Consider removingdebugJsonfrom schema after CLI option removal.The
--debug-jsonCLI option was removed, but thedebugJsonfield remains in the schema. While thedefault(false)prevents breakage, keeping unused fields creates maintenance confusion.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
src/cli/commands.tssrc/config/constants.tssrc/index.tssrc/output/json-formatter.tssrc/schemas/cli-schemas.ts
🧰 Additional context used
📓 Path-based instructions (2)
src/**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
src/**/*.ts: Use TypeScript ESM with explicit imports and narrow types
Use 2-space indentation; avoid trailing whitespace
Maintain strict TypeScript with noany; useunknown+ schema validation for external data
Use custom error types with proper inheritance; catch blocks useunknowntype
Files:
src/index.tssrc/cli/commands.tssrc/schemas/cli-schemas.tssrc/config/constants.tssrc/output/json-formatter.ts
src/output/**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
IDs should be shown as
PromptId.CriterionIdin output
Files:
src/output/json-formatter.ts
🧠 Learnings (1)
📚 Learning: 2025-12-28T19:43:51.189Z
Learnt from: CR
Repo: TRocket-Labs/vectorlint PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-28T19:43:51.189Z
Learning: Applies to src/boundaries/**/*.ts : Use Zod schemas for boundary validation of all external data (files, CLI, env, APIs) at system boundaries
Applied to files:
src/schemas/cli-schemas.ts
🧬 Code graph analysis (4)
src/index.ts (1)
src/config/constants.ts (2)
CLI_VERSION(9-9)CLI_DESCRIPTION(17-28)
src/cli/commands.ts (1)
src/config/constants.ts (1)
DEFAULT_CONFIG_FILENAME(12-12)
src/config/constants.ts (1)
src/schemas/cli-schemas.ts (1)
PACKAGE_JSON_SCHEMA(20-22)
src/output/json-formatter.ts (1)
src/config/constants.ts (1)
CLI_VERSION(9-9)
🔇 Additional comments (12)
src/cli/commands.ts (2)
30-30: LGTM! Improved consistency using constant.The config option now correctly references
DEFAULT_CONFIG_FILENAMEfor consistent messaging.
77-77: ThedebugJsonfield and its corresponding CLI option are actively used and correctly implemented. The field is defined in the CLI schema (src/schemas/cli-schemas.tsline 8) with a default value offalse, properly typed as part ofCliOptions, and actively consumed by all providers (AnthropicProvider, OpenAIProvider, GeminiProvider, and AzureOpenAIProvider) for JSON response logging. The code at line 77 correctly passes this field to the provider. No changes are needed.Likely an incorrect or invalid review comment.
src/schemas/cli-schemas.ts (1)
20-22: LGTM! Schema correctly validates package.json structure.The schema appropriately validates the package.json structure for version extraction used by
CLI_VERSION.src/config/constants.ts (3)
9-9: LGTM! Version derivation with validation.Using
PACKAGE_JSON_SCHEMA.parse()ensures the version is validated at module load time, providing fail-fast behavior for invalid package.json structure.
17-28: LGTM! Clear and helpful CLI description.The description provides good onboarding information. The template literal references
GLOBAL_CONFIG_DIRandGLOBAL_CONFIG_FILEdefined earlier in the file, which works correctly since template literals are evaluated at runtime.
1-2: The imports are correctly configured.resolveJsonModuleis enabled in tsconfig.json, package.json exists at the expected path, andPACKAGE_JSON_SCHEMAis properly exported from the schemas module viasrc/schemas/index.ts.src/index.ts (3)
11-11: LGTM! Centralized CLI metadata.Importing
CLI_VERSIONandCLI_DESCRIPTIONfrom constants establishes a single source of truth for CLI metadata, improving maintainability.
68-73: LGTM! Improved CLI help output.The enhanced help configuration provides:
- Version sourced from package.json
- Clear tagline and practical usage examples
- Comprehensive description with getting started instructions
These changes significantly improve user experience.
81-85: LGTM! Smart no-argument handling.The logic correctly detects when no arguments are provided (
process.argv.length === 2) and automatically displays help using a synthetic argv. This provides a better user experience than showing an error.src/output/json-formatter.ts (3)
2-2: LGTM! Consistent versioning approach.Importing
CLI_VERSIONeliminates duplicate package.json parsing and ensures consistent version information across the codebase.
81-81: LGTM! Centralized version in metadata.Using
CLI_VERSIONfor the metadata version ensures consistency with the CLI version displayed in help output.
6-10: No action required—allScoreComponentfields are properly populated.The five new numeric fields are explicitly initialized at all creation sites in
src/cli/orchestrator.tswith appropriate values (default0,4, or10; or calculated values). No undefined values are present in the JSON output.
- Remove debugJson configuration option from all provider interfaces (Anthropic, Azure OpenAI, Gemini, OpenAI) - Remove debugJson property initialization and assignments from provider constructors - Remove debugJson conditional logging blocks that output full JSON responses - Remove debugJson from ProviderOptions interface and provider factory configuration - Remove debugJson from CLI schemas and command registration - Simplify debug output by relying on existing debug and showPrompt options - Update all provider tests to reflect removal of debugJson parameter - Reduces configuration complexity and consolidates debug output handling
* refactor(config): Extract CLI version and description to constants - Move package.json version parsing to CLI_VERSION constant in config/constants.ts - Add PACKAGE_JSON_SCHEMA to schemas/cli-schemas.ts for reusable validation - Remove duplicate package.json parsing logic from json-formatter.ts - Add CLI_DESCRIPTION constant with setup instructions and configuration examples - Update json-formatter.ts to use CLI_VERSION from constants instead of local parsing - Centralize version management and CLI metadata for easier maintenance * refactor(cli): Improve CLI help text and use constants for version/description - Remove unused --debug-json option from main command - Fix quote escaping in --config option help text - Import CLI_VERSION and CLI_DESCRIPTION from constants module - Add comprehensive help text with usage examples - Display help automatically when no arguments provided - Consolidate version and description configuration in one place - Improve user experience with clearer command documentation * refactor(providers): Remove debugJson option from all providers - Remove debugJson configuration option from all provider interfaces (Anthropic, Azure OpenAI, Gemini, OpenAI) - Remove debugJson property initialization and assignments from provider constructors - Remove debugJson conditional logging blocks that output full JSON responses - Remove debugJson from ProviderOptions interface and provider factory configuration - Remove debugJson from CLI schemas and command registration - Simplify debug output by relying on existing debug and showPrompt options - Update all provider tests to reflect removal of debugJson parameter - Reduces configuration complexity and consolidates debug output handling * refactor(cli): Rename evals option to rules for consistency * chore: Clean up unwanted whitespaces * chore: Update vectorlint description
This PR overhauls the CLI help output to match the clean, structured style, while also refactoring how versioning and descriptions are handled in the codebase.
Key Changes:
Enhanced Help Output: The vectorlint --help output now features a clear layout with a tagline, an extended description, and a "Getting Started" section. The options and commands lists remain dynamic to ensure they stay in sync with the code.
Summary by CodeRabbit
New Features
Bug Fixes
Changes
Tests
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.