Skip to main content

Getting Started with ExplainThis

ExplainThis is an AI-powered code explanation tool that helps you understand any piece of code quickly and effectively. This guide will help you get started with using ExplainThis in your development workflow.

Quick Start

The fastest way to get started with ExplainThis is to use our web interface. Simply:

  1. Visit ExplainThis.ai
  2. Paste your code in the editor
  3. Select your preferred explanation mode
  4. Click "Explain This Code"

Installation

If you prefer to use ExplainThis via API or want to integrate it into your development environment, you can install our official packages:

NPM Package

npm install @explainthis/sdk

Python Package

pip install explainthis

Basic Usage

Here's a simple example of using ExplainThis in your code:

Example
import { ExplainThis } from '@explainthis/sdk';

const explainer = new ExplainThis({
  apiKey: process.env.EXPLAINTHIS_API_KEY
});

const code = `
function fibonacci(n) {
  if (n <= 1) return n;
  return fibonacci(n - 1) + fibonacci(n - 2);
}
`;

const explanation = await explainer.explain(code, {
  mode: 'standard',
  language: 'javascript'
});

console.log(explanation);

Next Steps

Now that you have ExplainThis set up, you might want to explore: