|
5 | 5 | ### The Problem |
6 | 6 |
|
7 | 7 | When working with AI prompts, it is often necessary to provide code context to the model to generate useful responses. This can be a time-consuming task, especially when working with large codebases. |
8 | | -CCprompt is a tool designed to extract code context for AI prompts based on provided function or class names. It supports both Python and JavaScript/TypeScript codebases. |
| 8 | +CCprompt is a tool designed to extract code context for AI prompts based on provided function or class names. It supports both Python codebases. |
9 | 9 | Providing such context can help AI models generate more accurate and relevant responses. |
10 | 10 |
|
11 | 11 | ## Features |
12 | 12 |
|
13 | | -- Supports Python languages, JavaScript/TypeScript support coming soon. |
14 | | -- Extracts functions or classes and their inheritance chains. |
15 | | -- Configurable via a JSON configuration file or command-line arguments. |
16 | | -- Excludes virtual environment directories if needed. |
17 | | -- zero dependencies if you are using it for python. |
| 13 | +- Supports Python codebase. |
| 14 | +- Extracts functions or classes and their inheritance chains |
| 15 | +- Configurable via a JSON configuration file or command-line arguments |
| 16 | +- Excludes virtual environment directories if needed |
| 17 | +- Zero runtime dependencies for Python-only usage |
| 18 | +- Optional JavaScript support via esprima |
18 | 19 |
|
19 | 20 | ## Installation |
20 | 21 |
|
| 22 | +### Using uv (recommended) |
| 23 | + |
| 24 | +```bash |
| 25 | +uv add ccprompt |
| 26 | +``` |
| 27 | + |
| 28 | +### Using pip |
| 29 | + |
21 | 30 | ```bash |
22 | 31 | pip install ccprompt |
23 | 32 | ``` |
24 | 33 |
|
| 34 | +### Development Setup |
| 35 | + |
| 36 | +```bash |
| 37 | +git clone https://github.com/Samk13/ccprompt.git |
| 38 | +cd ccprompt |
| 39 | +uv sync |
| 40 | +uv run ccprompt --help |
| 41 | +``` |
| 42 | + |
25 | 43 | ## Usage |
26 | 44 |
|
27 | 45 | ### first time usage |
@@ -61,25 +79,55 @@ ccprompt --help |
61 | 79 |
|
62 | 80 | ## Development |
63 | 81 |
|
64 | | -```bash |
65 | | -pip install -e .["dev"] |
66 | | -``` |
67 | | - |
68 | | -## Commands |
| 82 | +### Quick Start |
69 | 83 |
|
70 | 84 | ```bash |
71 | | -# installs development dependencies specified in setup.py |
72 | | -make install |
| 85 | +# Install dependencies |
| 86 | +uv sync |
73 | 87 |
|
74 | | -# Runs tests |
| 88 | +# Run tests |
75 | 89 | make test |
76 | 90 |
|
77 | | -# Check linting issues |
| 91 | +# Check code style |
78 | 92 | make lint-check |
79 | 93 |
|
80 | | -# Runs linting and fixes issues |
81 | | -make lint-fix |
| 94 | +# See all available commands |
| 95 | +make help |
| 96 | +``` |
82 | 97 |
|
83 | | -# Formats code using Ruff |
84 | | -make format |
| 98 | +### Available Make Commands |
| 99 | + |
| 100 | +```bash |
| 101 | +# Dependencies and Setup |
| 102 | +make sync # Install dependencies with uv |
| 103 | +make install # Alias for sync |
| 104 | +make clean # Remove build artifacts and cache |
| 105 | + |
| 106 | +# Development |
| 107 | +make run # Run ccprompt with debug logging |
| 108 | +make test # Run test suite with pytest |
| 109 | +make build # Build distribution packages |
| 110 | + |
| 111 | +# Code Quality |
| 112 | +make lint-check # Check code style with ruff |
| 113 | +make lint-fix # Fix code style issues with ruff |
| 114 | +make format # Format and fix code with ruff |
| 115 | + |
| 116 | +# Utilities |
| 117 | +make change-log # Show changes since last tag |
| 118 | +make help # Show all available commands |
85 | 119 | ``` |
| 120 | + |
| 121 | +## Requirements |
| 122 | + |
| 123 | +- Python >=3.12 |
| 124 | +- [uv](https://docs.astral.sh/uv/) (recommended) or pip |
| 125 | + |
| 126 | +## Project Structure |
| 127 | + |
| 128 | +This project uses modern Python packaging with: |
| 129 | +- **`pyproject.toml`** - Project configuration and dependencies |
| 130 | +- **`uv`** - Fast Python package manager |
| 131 | +- **`pytest`** - Testing framework |
| 132 | +- **`ruff`** - Code formatting and linting |
| 133 | +- **`hatchling`** - Build backend |
0 commit comments