import { useEffect } from 'react'; import { Link } from 'react-router-dom'; import { CHROME_STORE, REPO, VSCODE_MARKETPLACE } from '../links'; function scrollToSection(id: string) { document.getElementById(id)?.scrollIntoView({ behavior: 'smooth', block: 'start' }); } export function DocsPage() { useEffect(() => { const fromPath = window.location.href.match(/docs[#/]+([\w-]+)/i)?.[1]; const target = fromPath && fromPath !== 'docs' ? fromPath : undefined; if (target) { window.setTimeout(() => scrollToSection(target), 80); } }, []); const nav = [ ['overview', 'Overview'], ['chrome', 'Chrome'], ['vscode', 'VS Code'], ['cli', 'CLI'], ['shared', 'Shared core'], ['install', 'Install'], ['privacy', 'Privacy'], ] as const; return (

Documentation

LexAI is an open-source, bring-your-own-LLM assistant. This page covers every package and its features. Contributor setup lives on the{' '} Contribute page.

Overview

Three clients share one provider/prompt core. There is no LexAI backend — you supply an API key for OpenAI, Anthropic, Groq, or OpenRouter.

  • Chrome — writing help on any webpage
  • VS Code / Cursor — writing actions + workspace-aware Code Assist
  • CLI — Prompt Builder for the terminal

Chrome extension

Manifest V3. Select text on any page, run an action, Replace or Copy. API key encrypted locally with tweetnacl secretbox.

Setup

Options page → choose provider (OpenAI, Anthropic, Groq, or OpenRouter) and paste your API key. There are no environment variables.

Features

  • Fix Grammar, Rephrase, Shorten, Expand, Explain, Make Prompt
  • Writing styles: Formal, Casual, Academic, Creative, Concise
  • Floating toolbar, right-click context menu, popup editor
  • Prompt Builder — patterns, persona, output format
  • Providers: OpenAI · Anthropic · Groq · OpenRouter
  • Works in text boxes, email composers, forms, and contenteditable pages
Chrome Web Store Package README

VS Code / Cursor extension

Editor twin of LexAI. Select text or code → action or Code Assist → Accept / Regenerate / Discard. Key lives in VS Code Secret Storage.

Published listing:{' '} JuanKibin.lexai-vscode

Setup

Command Palette → LexAI: Open Settings → provider, model, and API key. The key is stored in VS Code Secret Storage. There are no environment variables.

Code Assist

  • Freeform instruction in an inline prompt above the selection
  • Workspace context: surrounding code, imports, and symbol definitions from other files
  • Entry points: CodeLens, context menu, Command Palette, Activity Bar sidebar

Writing actions

  • Fix Grammar · Rephrase · Shorten · Expand · Explain · Make Prompt
  • Writing styles + Prompt Builder option chips in the suggestion zone
  • Suggestion UI: zone (default), side panel, or both
  • Status bar: ready / processing / not configured
  • Sidebar workspace panel for paste → run → Copy
VS Code Marketplace Package README

CLI — Prompt Builder

Improves a rough idea into a paste-ready engineered prompt before you send it to another agent.

Setup

Environment variables (PowerShell shown; bash uses export NAME=value):

{`$env:LEXAI_API_KEY = "sk-..."              # required
$env:LEXAI_PROVIDER = "openai"              # optional: openai | anthropic | groq | openrouter
$env:LEXAI_MODEL = "gpt-4o"                 # optional`}

Optional defaults file (never put the API key here): ~/.lexai/config.json

{`{
  "provider": "openai",
  "model": "gpt-4o",
  "pattern": "role",
  "persona": "Expert Developer",
  "format": "Markdown",
  "style": "Concise"
}`}

Precedence: flags → config file → env → defaults. The key is always{' '} LEXAI_API_KEY.

Features

  • Command: lexai prompt
  • Input from args, stdin, or -f/--file
  • Flags: pattern, persona, format, style, provider, model
  • Also --list (patterns, personas, formats, styles) and{' '} --help
  • Engineered prompt on stdout (pipe-safe); progress and errors on stderr

Examples

{`lexai prompt "add rate limiting to the express auth routes"

echo "debug flaky playwright on CI" | lexai prompt --pattern role

lexai prompt -f draft.txt --format Markdown --model gpt-4o`}
Package README

Shared core

  • Location: src/lib (providers, actions,{' '} types)
  • Chrome-only modules: crypto (key encryption), messaging helpers
  • VS Code and CLI must not import Chrome-only modules

Install

Published builds:

From source (Node.js 22+):

{`git clone https://git.juankibin.space/kibin/LexAI.git
cd LexAI
npm run install:all

# Chrome
npm run chrome:dev          # or chrome:build → load packages/chrome/.output/chrome-mv3

# VS Code
npm run vscode:build        # or install from Marketplace

# CLI
npm run cli:build
export LEXAI_API_KEY=sk-...          # required
export LEXAI_PROVIDER=openai         # optional: openai | anthropic | groq | openrouter
export LEXAI_MODEL=gpt-4o            # optional
node packages/cli/out/cli.js prompt "your rough idea"

# Website
npm run website:dev`}

Privacy

  • No LexAI backend, account, or subscription
  • No LexAI telemetry
  • Chrome: encrypted key in chrome.storage.local
  • VS Code: Secret Storage
  • CLI: LEXAI_API_KEY required; optional LEXAI_PROVIDER and{' '} LEXAI_MODEL. Never store the key in ~/.lexai/config.json
  • Text is sent only to the LLM provider you configure
); }