Skip to main content

Generate LLM-ready context files from your codebase — interactively.

Project description

codecontext

Generate LLM-ready context files from your codebase — interactively.

pip install codecontext

Usage

Interactive wizard (recommended)

cc

Launches a Vite-style interactive prompt:

╭──────────────────────────────────────────╮
│  codecontext  v1.0.0                     │
│  Generate LLM-ready context from your    │
│  codebase                                │
╰──────────────────────────────────────────╯

◆ Where is your project?
  ● Current directory (.)
  ○ Specify a folder path
  ○ Select a ZIP file

◆ Which file categories to include?
  ✔ Essential files (README, requirements, Dockerfile…)
  ✔ Source code (.py, .js, .ts, .go, .rs…)
  ✔ Config & text files (.json, .yml, .md, .toml…)
  ✗ Rare languages (.lua, .dart, .scala, .hs…)
  ✗ Other text files (unclassified extensions)

◆ How should .gitignore be handled?
  ● Respect .gitignore (recommended)
  ○ Include everything

◆ Token budget?
  ● Claude 3.5 (800k)
  ○ GPT-4 Turbo (128k)
  ○ Gemini 1.5 Pro (1M)
  ○ Custom

◆ Output file name: my_project_context.txt

✔ Done in 3.2s
  Output      /path/to/my_project_context.txt
  Tokens      ████████████░░░░░░░░░░░░░░░░░░  142,847 / 800,000  (17.9%)
  Full files  89
  Summary     23
  Metadata    12
  Omitted     0

Non-interactive mode

# Run on current directory
cc run

# Run on a specific path
cc run ./my-project

# Custom output and budget
cc run ./my-project -o context.txt --budget 128000

# Include files that are in .gitignore
cc run ./my-project --no-gitignore

Other commands

cc --version     # Show version
cc info          # System info and dependency check
cc --help        # Help

How it works

codecontext intelligently processes your project:

Priority Files
Essential README.md, package.json, Dockerfile, requirements.txt, …
Code .py, .js, .ts, .go, .rs, .java, …
Config .json, .yml, .toml, .env.example, …
General Less common languages and text files

When the output would exceed your token budget, it automatically:

  1. Summarises lower-priority files (extracts function signatures, first N lines)
  2. Omits the lowest-priority content with a note in its place

Requirements

  • Python 3.9+
  • tiktoken (token counting)
  • pathspec (.gitignore parsing)
  • questionary (interactive prompts)
  • rich (terminal UI)
  • typer (CLI framework)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repoview-1.0.0.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

repoview-1.0.0-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file repoview-1.0.0.tar.gz.

File metadata

  • Download URL: repoview-1.0.0.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for repoview-1.0.0.tar.gz
Algorithm Hash digest
SHA256 051dcaeaabdc6153c5336243eb662148a7b5e47b49cdb5ca29debc9718973301
MD5 41f32a2b7d22d08539c3e66fa6f6b185
BLAKE2b-256 c356e3ae6e256472ead7d72de1c5c1105b7e5016566506b29c9d23dfd4d3da52

See more details on using hashes here.

File details

Details for the file repoview-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: repoview-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for repoview-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d35eb1fc1c411d6384ccdfe14464a36f4aa4f478d140da351ccfdad0e150599f
MD5 c6fc8f043ab1fba5b6778dd3ae222cb4
BLAKE2b-256 611650d1f03967726cd6c60a9628390e2b86f70a7ba132171e7012c0788c4e75

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page