Quickstart
Last updated
Last updated
This guide will walk you through running DeepLint for the first time and understanding its output.
Before running DeepLint, ensure you have:
(optional, default configuration works for most cases)
A Git repository with some changes (either staged or unstaged)
After installing and configuring DeepLint, you can run it with a simple command:
When run without arguments, DeepLint will:
Look for staged changes in your Git repository
Build context for analysis
Display information about the context (number of files, tokens, etc.)
DeepLint can analyze your code using powerful Large Language Models (LLMs) like OpenAI's GPT-4o. This enables advanced linting, code review, and suggestions powered by AI.
OpenAI API Key: You need an OpenAI API key to use LLM-powered analysis.
Set it as an environment variable:
Or add it to your config file under llm.apiKey
.
Model: By default, DeepLint uses gpt-4o
. You can change this with the --model
flag or in your config.
To run DeepLint with LLM-powered analysis, use the check
command:
This will:
Build context from your code changes
Send the context to the LLM for analysis
Display lint results, explanations, and suggestions
You can control the LLM analysis with these options:
--provider
(default: openai)
--model
(default: gpt-4o)
--api-key
(your OpenAI API key)
--instructions
(extra prompt instructions)
--json
(output as JSON)
--unstaged
(include unstaged changes)
DeepLint supports several command line options to customize its behavior:
For a complete list of options, run:
When you run DeepLint, you'll see output similar to this:
Let's break down what this means:
Running DeepLint on staged changes: DeepLint is analyzing the changes you've staged with git add
.
Building context for analysis: DeepLint is gathering information about your codebase.
Context built with X changed files and Y related files: DeepLint has identified the files you've changed and other files that are related to those changes.
Context building statistics: Information about the context that was built, including the number of files, tokens, and build time.
Ready for LLM analysis: The context is ready for analysis by the LLM.
If you want to see what information DeepLint is gathering for analysis, you can use the --dump
option:
This will save the context to a file, which you can examine to understand what information DeepLint is gathering. The context includes:
Repository information (name, root, structure)
Changes (files, diffs, summary)
Related files (dependencies, content, structure)
Metadata (token counts, generation time)
If you run DeepLint without any staged changes, you'll see an error message:
To fix this, either:
Stage some changes with git add
, or
Use the --unstaged
flag to analyze unstaged changes:
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:
If your codebase is large, you might see a warning about token limits:
This means that DeepLint had to truncate or exclude some files to stay within the token limit. To address this, you can:
Reduce the number of files being analyzed by making smaller, more focused changes.
Adjust the token limits in your configuration file:
If you're having issues with DeepLint, you can run it in debug mode to get more information:
This will show detailed information about the context building process, including:
For more detailed output without the technical details of debug mode, you can use verbose mode:
This will show additional information about what DeepLint is doing, such as:
When you run DeepLint, it goes through several steps to build context for analysis:
Git Integration: DeepLint checks for staged or unstaged changes in your Git repository
Repository Scanning: DeepLint scans your repository to understand its structure
Dependency Analysis: DeepLint analyzes dependencies between files
Code Structure Analysis: DeepLint extracts information about the structure of your code
Context Assembly: DeepLint assembles all this information into a structured context
Token Management: DeepLint manages the context size to fit within token limits
Now that you've run DeepLint for the first time, you can:
Developer Note: The context building process is highly optimized to provide the most relevant information while staying within token limits. It's designed to work with a wide range of codebases and can be customized to fit your specific needs.
Get one at
See the for full details.
For more information about verbose mode, see the guide.
For more detailed information about the context building process, see the documentation.
Learn more about to automate DeepLint in your workflow
Explore the to customize DeepLint for your project
Learn about the to get the most out of DeepLint
Previous: | Next: