Skip to main content

CodeLens

Ask questions about your codebase and get answers with file and line references.

CodeLens searches your code and documentation, follows connections between functions, and gives the relevant context to an OpenAI model. Its search index stays in your project's .codelens folder. No database server or Docker is needed.

You need an OpenAI API key and internet access. Indexing sends eligible code and documentation to OpenAI; questions also use the API and can incur charges.

Get started

Have uv installed, your OpenAI API key, and a project folder on your computer.

1. Install CodeLens

Open a terminal in the CodeLens source folder, where pyproject.toml lives:

uv tool install --python 3.14 .
uv tool update-shell

Close and reopen your terminal, then check the installation:

codelens --help

uv manages an isolated installation and can download Python 3.14 if needed. Once setup is complete, codelens works from any folder without activating an environment. See the installation guide for getting the source, installing uv, or using pip instead.

Python 3.14 is the simplest setup. Python 3.15 is also verified, but its parser dependency needs a compiler; Windows requires C++ Build Tools and a Windows SDK. See Python compatibility.

2. Set up your API key

codelens init

Enter your OpenAI API key and follow the prompts to choose an embedding model and an answer model. Keep the suggested models if you are unsure. You only need to do this once. The key goes in your OS credential store; no .env file is needed.

3. Index your project and ask a question

Change to the project you want to understand. Replace the example path with your project folder, such as C:/Projects/my-app on Windows:

cd "/path/to/my-app"
codelens embed .
codelens ask "How does authentication work?"

Wait for the first index to finish, then read the answer and its source references. After editing your code, just ask another question: CodeLens checks for changes and updates the index automatically, reusing unchanged embeddings.

For a guided example, see Setup and first run.

Everyday commands

Run these inside your indexed project:

What you want Command
Ask a question codelens ask "Explain the main entry point"
Inspect the evidence used for an answer codelens ask "How does checkout work?" --show-context
Search without generating an answer codelens retrieve "Where is the access token checked?"
Update the index yourself codelens embed .
Check the project codelens status
Check your local setup codelens doctor

retrieve still uses OpenAI to embed the question. It skips the final answer call.

To work from another folder, list your registered projects and choose one by name or ID:

codelens projects list
codelens ask "Explain the main entry point" --project my-app

The default project name is its folder name. Use the ID shown by projects list if two projects have the same name. See the command reference for more options and codelens COMMAND --help for help with a command.

Your data

  • Each project's .codelens folder contains its graph, embeddings, and compressed source snapshots. CodeLens adds this folder to the project's .gitignore.
  • Settings and the project list live in ~/.codelens; the API key is stored separately in the OS credential store.
  • Back up the entire project .codelens folder while CodeLens is stopped. Uninstalling the package leaves your indexes and settings in place.

See local storage and maintenance for backups, source snapshots, and reclaiming unused index space.

Need help?

  • codelens is not found: run uv tool update-shell, then reopen your terminal or restart your IDE terminal host.
  • API key or credential-store error: run codelens doctor, then codelens init. Headless Linux may need an OS keyring configured first.
  • An answer misses something: run codelens retrieve with a specific question and inspect the evidence. Static code analysis and generated answers can be incomplete.

More help: Troubleshooting · Install, upgrade, and uninstall · Configuration.

Learn more

Found a problem? Open an issue.

Metadata

Release files for codelens-rag 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codelens-rag 0.2.0
File Size Uploaded Provenance
codelens_rag-0.2.0.tar.gz 274.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for codelens-rag 0.2.0
File Interpreter ABI Platform
codelens_rag-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 446.6 kB

Release files / codelens_rag-0.2.0.tar.gz

Download URL codelens_rag-0.2.0.tar.gz
Size 274.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cc0e78fc852c6bf5874de6ed10291e96f934f5618437ccc4e571e2440354d18b
BLAKE2b-256 checksum
How to use checksums
cfe204f17aa158802387308c2eefca221180699c57f0f8a297a1d64e89195adc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / codelens_rag-0.2.0-py3-none-any.whl

Download URL codelens_rag-0.2.0-py3-none-any.whl
Size 172.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b2f740ce0848cc3413b438405b979a25ceceb3302e9aa908032b2429208fbbca
BLAKE2b-256 checksum
How to use checksums
e37829b1397419cb8cf4eafdbd44db0457ce155c316153b57ddf767e35f12afe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for codelens-rag 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page