ExplainThisCode fits into the tools you already use. Whether you prefer working inside your editor, running checks in CI, or calling an API from your own app, there is an integration path that works for you. Below are the most common setups with quick-start snippets you can copy and adapt.
Install the official extension from the VS Code Marketplace and get instant insights without leaving your editor. Select a block of code, right-click, and choose “Explain This Code” to see a side-panel summary. The extension respects your workspace settings and syncs results to your account history.
# Install from the command palette
code --install-extension explainthiscode.vscode-explain
# Or search "ExplainThisCode" in the Extensions panelAdd an analysis step to your pull-request workflow. The action posts a summary comment on every PR so reviewers can see what each change does before they read a single line of diff. Set the skill level to match your team and optionally enable Security mode for automatic vulnerability notes.
# .github/workflows/explain.yml
name: Explain PR
on: [pull_request]
jobs:
explain:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: explainthiscode/explain-action@v1
with:
api-key: ${{ secrets.ETC_API_KEY }}
mode: standard
level: intermediateFor GitLab CI, Jenkins, CircleCI, or any other pipeline tool, use the command-line interface. The CLI accepts a file path or piped input and prints the result to stdout, making it easy to redirect into artifacts, Slack messages, or documentation generators.
# Install the CLI
npm install -g @explainthiscode/cli
# Explain a file and save the output
etc explain src/auth/middleware.ts --level senior --mode security > report.mdCall the API directly to embed insights inside your own products. Send a POST request with the source code and receive a structured JSON response that includes the analysis text, complexity score, detected patterns, and suggested improvements.
curl -X POST https://explainthiscode.ai/api/v1/explain \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"code": "function fib(n) { return n <= 1 ? n : fib(n-1) + fib(n-2); }",
"language": "javascript",
"mode": "standard",
"level": "beginner"
}'Check out the full API reference for endpoint details, rate limits, and authentication options. If you run into trouble, visit our help centeror contact us directly.