Skip to content

Python UI to easily copy the context of your code projects as a JSON object. Built to import context easily into ChatGPT.

Notifications You must be signed in to change notification settings

mrmendoza-dev/code-context-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Context Manager

A modern PySide6 application for easily copying the context of your code projects as a JSON object. Built to import context easily to ChatGPT and other AI tools.

✨ Features

  • Modern PySide6 UI: Clean, responsive interface with GitHub-inspired themes
  • Light & Dark Themes: Automatic theme switching with GitHub color schemes
  • Tabbed File Viewing: View multiple files simultaneously in organized tabs
  • Smart File Filtering: Automatically exclude common development files and directories
  • Real-time Statistics: Live word count, character count, and line count tracking
  • Progress Indicators: Visual feedback for AI tool limits
  • Keyboard Shortcuts: Quick access to common actions
  • Settings Persistence: Remembers your preferences and window state

🎨 Themes

  • Light Theme: Clean GitHub-inspired light interface
  • Dark Theme: Modern GitHub Dark theme (default)
  • Automatic Switching: Toggle between themes with a single click

🚀 Usage

  1. Choose Folder: Click "Choose Folder" to select your project directory
  2. Browse Files: Navigate through the file tree on the left
  3. Select Files: Click on files to view their content in the right panel
  4. Copy Context: Use "Copy to Clipboard" to get JSON-formatted file data
  5. Paste to AI: Paste the copied JSON into ChatGPT or other AI tools

📊 Output Format

The app generates structured JSON output perfect for AI context:

[
  {
    "fileName": "main",
    "fileType": ".py",
    "filePath": "src/main.py",
    "content": "# Your file content here..."
  }
]

🏗️ Architecture

The app follows modern PySide6 patterns:

src/
├── core/           # Core functionality
│   └── theme_manager.py
├── ui/             # UI components
│   ├── main_window.py
│   ├── directory_tree_widget.py
│   ├── content_viewer_widget.py
│   └── toolbar_widget.py
└── main.py         # Application entry point

🛠️ Installation

  1. Clone the repository:

    git clone <repository-url>
    cd code-context-python
  2. Create virtual environment:

    python3 -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Run the application:

    python main.py

📋 Requirements

  • Python 3.8+
  • PySide6 6.6+

🎯 AI Tool Limits

The app tracks recommended limits for AI tools:

  • Words: 1,100 maximum
  • Characters: 12,000 maximum

Visual indicators show when you're approaching or exceeding these limits.

⌨️ Keyboard Shortcuts

  • Ctrl+O: Open folder
  • Ctrl+C: Copy to clipboard
  • Ctrl+Q: Quit application

🔧 Configuration

The app automatically saves:

  • Window geometry and position
  • Selected theme preference
  • Application settings

🤝 Contributing

This is a refactored version of the original Tkinter application, now using modern PySide6 architecture with:

  • Proper separation of concerns
  • Signal/slot architecture
  • Theme management system
  • Professional UI components

📱 Screenshots

Interface

Note: Screenshot shows the original interface. The new PySide6 version features a modern, tabbed interface with theme support.

📄 License

Open source - feel free to use and modify for your projects!

About

Python UI to easily copy the context of your code projects as a JSON object. Built to import context easily into ChatGPT.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages