CLI Reference
This document provides a comprehensive reference for the DeepLint command-line interface (CLI), including all available commands, options, and usage examples.
Command Structure
DeepLint commands follow this general structure:
If no command is specified, DeepLint runs the default command, which analyzes staged changes in the current Git repository.
Global Options
These options can be used with any command:
--help
, -h
Show help information
-
deeplint --help
--version
, -v
Show version information
-
deeplint --version
--debug
Enable debug output
false
deeplint --debug
--verbose
Enable verbose output
false
deeplint --verbose
--config
Specify a custom config file
-
deeplint --config=custom.config.js
--json
Output results in JSON format
false
deeplint --json
Commands
Default Command
The default command runs when no command is specified. It analyzes staged changes in the current Git repository.
Options
--context
Context depth (light or deep)
light
deeplint --context=deep
--unstaged
Include unstaged changes
false
deeplint --unstaged
--dump
Dump context to a file
-
deeplint --dump=context.json
--instructions
Custom instructions for analysis
-
deeplint --instructions="Focus on security issues"
Examples
Init Command
The init
command initializes DeepLint in a repository, creating a configuration file.
Options
--force
, -f
Overwrite existing configuration
false
deeplint init --force
--yaml
Use YAML format for configuration
false
deeplint init --yaml
--js
Use JavaScript format for configuration
true
deeplint init --js
Examples
Help Command
The help
command displays help information for DeepLint or a specific command.
Examples
Check Command
The check
command analyzes your codebase using LLM-powered analysis, providing advanced linting, code review, and suggestions using AI.
If no files are specified, DeepLint analyzes staged changes by default.
You can specify files or directories to analyze specific targets.
Options
--provider
LLM provider to use
"openai"
--model
LLM model to use
process.env.OPENAI_MODEL
or "gpt-4o"
--api-key
API key for the LLM provider
process.env.OPENAI_API_KEY
--instructions
Additional instructions for the LLM
none
--json
Output results in JSON format
false
--context
Context depth for analysis (light
or deep
)
"light"
--unstaged
Include unstaged changes in the analysis
false
--debug
Enable debug output
false
--verbose
Enable verbose output
false
Examples
Planned Commands
The following commands are planned for future releases:
Config Command (Planned)
The config
command will allow viewing and modifying configuration values.
Actions (Planned)
get
: Get a configuration valueset
: Set a configuration valuelist
: List all configuration values
Examples (Planned)
Environment Variables
DeepLint supports the following environment variables:
DEEPLINT_CONFIG_PATH
Path to the configuration file
DEEPLINT_CONFIG_PATH=/path/to/config.js
DEEPLINT_DEBUG
Enable debug output
DEEPLINT_DEBUG=true
DEEPLINT_VERBOSE
Enable verbose output
DEEPLINT_VERBOSE=true
OPENAI_API_KEY
OpenAI API key for LLM integration
OPENAI_API_KEY=sk-...
OPENAI_MODEL
Default model for OpenAI
OPENAI_MODEL=gpt-4o
Exit Codes
DeepLint uses the following exit codes:
0
Success - No issues found
1
Error - Command failed to execute
2
Issues - Issues were found during analysis
Configuration
DeepLint can be configured using a configuration file. By default, DeepLint looks for the following files in the current directory:
deeplint.config.js
.deeplintrc.js
.deeplintrc.json
.deeplintrc.yml
.deeplintrc.yaml
You can also specify a custom configuration file using the --config
option.
LLM options can be set via CLI flags, environment variables, or config file. Precedence is:
CLI arguments
Environment variables
Config file (
llm
section)Built-in defaults
Examples
Basic Usage
Advanced Usage
Troubleshooting
Common Issues
No Staged Changes
If you run DeepLint without any staged changes, you'll see an error message:
To fix this, either:
Stage some changes with
git add
, orUse the
--unstaged
flag to analyze unstaged changes:
Not a Git Repository
If you run DeepLint outside of a Git repository, you'll see an error message:
To fix this, either:
Navigate to a Git repository, or
Initialize a Git repository in your current directory:
Configuration Not Found
If DeepLint can't find a configuration file, it will use default values. To create a configuration file:
Related Documentation
Last updated