Commands
This guide explains how to use the DeepLint default command to analyze your code.
Overview
The default command is the main command in DeepLint that runs when you don't specify a command name. It analyzes your code by:
Building context from your codebase
Analyzing the context for issues using LLM
Displaying the results with detailed feedback
This is the command you'll use most frequently when working with DeepLint.
Basic Usage
To run the default command, simply use the deeplint
command without specifying a command name:
This will analyze the staged changes in your Git repository and display the results.
Command Options
The default command supports the following options:
Context Options
--unstaged
The --unstaged
option includes unstaged changes in the analysis:
By default, DeepLint only analyzes staged changes. This option allows you to analyze unstaged changes as well.
LLM Options
--provider=<provider>
The --provider
option allows you to specify the LLM provider to use:
Currently, only openai
is supported.
--model=<model>
The --model
option allows you to specify the LLM model to use:
Default is gpt-4o
or the value of the OPENAI_MODEL
environment variable.
--api-key=<key>
The --api-key
option allows you to specify the API key for the LLM provider:
If not provided, DeepLint will use the OPENAI_API_KEY
environment variable.
--temperature=<temp>
The --temperature
option allows you to specify the temperature for the LLM (0-1):
Higher values make the output more random, lower values make it more deterministic.
--max-tokens=<num>
The --max-tokens
option allows you to specify the maximum number of tokens for the LLM response:
--instructions=<text>
The --instructions
option allows you to provide additional instructions for the LLM:
Output Options
--debug
The --debug
option enables debug output:
This displays detailed technical information about the command execution, including:
Configuration values
Context building details
Token usage
Error details
--dump=<file>
The --dump
option allows you to dump the context to a file:
This is useful for debugging and for understanding what information DeepLint is using for analysis.
--verbose, -v
The --verbose
option enables verbose output:
This displays additional information about what DeepLint is doing, such as:
Configuration loading and validation
Context building steps
Analysis progress
--json
The --json
option outputs the results in JSON format:
This is useful for integrating DeepLint with other tools or for parsing the results programmatically.
Command Aliases
The default command has the following aliases:
Full-Word Aliases:
run
: Run DeepLint on staged changescheck
: Analyze code for issues (for backward compatibility)lint
: Analyze code for issues (for backward compatibility)analyze
: Analyze code for issues (for backward compatibility)
Short Aliases:
r
: Run DeepLint on staged changesc
: Analyze code for issues (for backward compatibility)
You can use any of these aliases instead of the default command:
Examples
Here are some examples of using the default command:
Analyzes staged changes with default options.
Understanding the Output
The default command output includes:
Analysis Summary
A summary of the analysis results, including:
Number of files analyzed
Number of issues found by severity (error, warning, info, hint)
Number of affected files
Example:
Issue Details
Details about each issue found, including:
Issue severity (error, warning, info, hint)
Issue location (file, line, column)
Issue message
Code snippet (if available)
Explanation
Suggestion (if available)
Example:
Troubleshooting
No Staged Changes
If there are no staged changes, the default command will display a warning:
To analyze unstaged changes, use the --unstaged
option:
Missing API Key
If the OpenAI API key is missing, the command will display an error:
Make sure to set the OPENAI_API_KEY
environment variable or use the --api-key
option.
Token Limit Exceeded
If the context is too large for the token limit, the command will display a warning:
To reduce the token usage, you can:
Reduce the number of files being analyzed
Increase the token limit in the configuration
Reduce the token limit per file in the configuration
Next Steps
Now that you understand how to use the default command, you can:
For more information about DeepLint's commands, use the help command:
Last updated