Deeplint is still in the MVP development phase and not yet available for use.

Installation

This guide will help you install DeepLint and set it up in your project.

This is part of the Getting Started series:

  1. Installation (current page)

Prerequisites

Before installing DeepLint, ensure you have the following prerequisites:

  • Node.js: Version 22.0.0 or higher

  • Package Manager: npm, yarn, or pnpm (pnpm is recommended)

  • Git: For Git hook integration

DeepLint is primarily designed for JavaScript and TypeScript projects, but can be used with other languages as well. It supports both CommonJS (CJS) and ECMAScript Modules (ESM) environments.

Installation Options

Installing DeepLint globally allows you to use it across multiple projects:

# Using npm
npm install -g deeplint-cli

# Using yarn
yarn global add deeplint-cli

# Using pnpm (recommended)
pnpm add -g deeplint-cli

After installation, verify that DeepLint is installed correctly:

deeplint --version

Project Installation

You can also install DeepLint as a development dependency in your project:

# Using npm
npm install --save-dev deeplint-cli

# Using yarn
yarn add --dev deeplint-cli

# Using pnpm (recommended)
pnpm add -D deeplint-cli

When installed locally, you can run DeepLint using npx:

npx deeplint

API Key Setup

DeepLint requires an API key for the LLM provider you want to use. Currently, the following providers are supported:

  • OpenAI (GPT-4)

  • Anthropic (Claude)

  • Google (Gemini)

Setting Up Your API Key

You can set up your API key in several ways:

1. Environment Variable

Add your API key to your environment variables:

# For OpenAI
export OPENAI_API_KEY=your-api-key

# For Anthropic
export ANTHROPIC_API_KEY=your-api-key

# For Google
export GOOGLE_API_KEY=your-api-key

For persistent configuration, add this to your shell profile (.bashrc, .zshrc, etc.).

2. Configuration File

You can also add your API key to the DeepLint configuration file. We'll cover this in the Configuration section.

Troubleshooting Installation

If you encounter issues during installation, check the following:

  • Ensure you have the correct Node.js version (22.0.0+)

  • Check your network connection

  • Verify you have the necessary permissions to install global packages

  • If using pnpm, ensure it's properly configured

For more detailed troubleshooting, run the installation with verbose logging:

pnpm add -g deeplint-cli --verbose

Module Compatibility

DeepLint supports both CommonJS (CJS) and ECMAScript Modules (ESM) environments:

  • The package automatically detects your project's module format

  • For ESM projects, use import syntax:

    import { defineConfig } from "deeplint-cli";
  • For CJS projects, use require syntax:

    const { defineConfig } = require("deeplint-cli");
  • All dependencies are bundled for maximum compatibility, including ESM-only dependencies like chalk

This dual-format support means you can use DeepLint in any JavaScript or TypeScript project, regardless of the module system it uses.

Next Steps

Now that you have DeepLint installed, you can:

  1. Configure DeepLint - Set up your project configuration

  2. Run your first analysis - Learn how to analyze your code

  3. Set up Git integration - Integrate with your Git workflow

Development Setup

If you want to contribute to DeepLint or run it from source, follow these steps:

  1. Clone the Repository

    git clone https://github.com/your-org/deeplint-cli.git
    cd deeplint-cli
  2. Install Dependencies

    pnpm install
  3. Set Up Environment Variables

    Copy the sample environment file and modify as needed:

    cp .env.sample .env

    Edit the .env file to include your OpenAI API key:

    OPENAI_API_KEY=your_api_key_here
  4. Build the Project

    # Build the project with tsup (generates both ESM and CJS outputs)
    pnpm build
  5. Run the Development Server

    pnpm dev

For more detailed information about the development workflow, see the Development Workflow guide.


Next: Configuration →

Last updated