Skip to content

Commit 481b4b6

Browse files
authored
Update README.md
1 parent a70b337 commit 481b4b6

File tree

1 file changed

+69
-95
lines changed

1 file changed

+69
-95
lines changed

README.md

Lines changed: 69 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,75 @@
1+
[![Image](./docs/frontpage.png "GitIngest main page")](https://gitingest.com/)
2+
13
![License](https://img.shields.io/badge/license-MIT-blue.svg)
4+
25
# GitIngest 🔍
6+
Turn any Git repository into a prompt-friendly text ingest for LLMs.
37

8+
You can also replace `hub` with `ingest` in any github url to access the coresponding digest
49

5-
[![Image](./docs/frontpage.png)](https://gitingest.com/)
10+
[gitingest.com](https://gitingest.com/)
611

7-
[gitingest.com](https://gitingest.com/) - Turn any Git repository into a prompt-friendly text ingest for LLMs.
8-
You can also replace `hub` with `ingest` in any github url to access the coresponding digest
912

1013
## 🚀 Features
1114

12-
- **One-Click Analysis**: Simply paste a Git repository URL and get instant pastable context
15+
- **Easy code context**: Get a text digest from a git repository URL or a directory
1316
- **Smart Formatting**: Optimized output format for LLM prompts
1417
- **Statistics about**: :
1518
- File and directory structure
1619
- Size of the extract
17-
- (soon) Token count
18-
- **Web Interface**: Lightweight responsive UI
20+
- Token count
21+
- **CLI tool**: Run it as a command
22+
- **Python package**: Import it in your code
1923

20-
## 🛠️ Tech Stack
21-
- Tailwind CSS
22-
- FastAPI - Backend framework
23-
- [apianalytics.dev](https://www.apianalytics.dev/) - Usage tracking
2424

25-
## 📦 Running Tests
25+
## 📦 Installation
2626

27-
To run the tests, first install the test dependencies:
28-
```bash
29-
pip install -r requirements.txt
3027
```
31-
32-
Then run the tests with coverage:
33-
```bash
34-
cd src
35-
pytest --cov
28+
pip install gitingest
3629
```
3730

38-
To generate a coverage HTML report:
39-
```bash
40-
pytest --cov --cov-report=html
41-
```
42-
The report will be available in `htmlcov/index.html`
4331

44-
## 📦 Installation
32+
## 💡 Command Line usage
4533

46-
1. Clone the repository:
47-
```bash
48-
git clone https://github.com/cyclotruc/gitingest.git
49-
cd gitingest
50-
```
34+
The `gitingest` command line tool allows you to analyze codebases and create a text dump of their contents.
5135

52-
2. Install dependencies:
5336
```bash
54-
pip install -r requirements.txt
37+
# Basic usage
38+
gitingest /path/to/directory
39+
40+
# From url
41+
gitingest https://github.com/cyclotruc/gitingest
42+
43+
# See more options
44+
gitingest --help
5545
```
5646

57-
3. Run the application:
58-
```bash
59-
cd src
60-
uvicorn main:app --reload
47+
This will write the digest in a text file (default `digest.txt`) in your current working directory.
48+
49+
50+
## 🐛 Python package usage
51+
52+
53+
```python
54+
from gitingest import ingest
55+
56+
summary, tree, content = ingest("path/to/directory")
57+
58+
#or from URL
59+
summary, tree, content = ingest("https://github.com/cyclotruc/gitingest")
6160
```
6261

62+
By default, this won't write a file but can be enabled with the `output` argument
6363

64-
The application will be available at `http://localhost:8000`
6564

66-
### Docker
65+
## 🛠️ Using
66+
- Tailwind CSS - Frontend
67+
- [FastAPI](https://github.com/fastapi/fastapi) - Backend framework
68+
- [tiktoken](https://github.com/openai/tiktoken) - Token estimation
69+
- [apianalytics.dev](https://www.apianalytics.dev/) - Simple Analytics
6770

71+
72+
## 🌐 Self-host
6873
1. Build the image:
6974
```
7075
docker build -t gitingest .
@@ -75,82 +80,51 @@ docker build -t gitingest .
7580
docker run -d --name gitingest -p 8000:8000 gitingest
7681
```
7782
The application will be available at `http://localhost:8000`
83+
Ensure environment variables are set before running the application or deploying it via Docker.
7884

79-
### 🌐 Environment Configuration
80-
81-
You can configure the application using the following environment variables:
82-
83-
- **`ALLOWED_HOSTS`**: Specify allowed hostnames for the application. Default: `"gitingest.com,*.gitingest.com,gitdigest.dev,localhost"`.
84-
85-
Example:
85+
## ✔️ Contributing
8686

87-
```bash
88-
ALLOWED_HOSTS="gitingest.local,localhost"
89-
```
87+
Contributions are welcome!
9088

91-
Ensure these variables are set before running the application or deploying it via Docker.
89+
Gitingest aims to be friendly for first time contributors, with a simple python and html codebase. If you need any help while working with the code, reach out to us on [discord](https://discord.com/invite/zerRaGK9EC)
9290

93-
## ✔️ Contributions are welcome!
94-
Create a pull request or open an Issue about anything you'd like to see in gitingest
91+
### Ways to contribute
9592

96-
## 🔒 WIP
97-
- Feedback/suggestions: Please open a github Issue or mail me: romain@coderamp.io
98-
- Repository cloning is limited to public GitHub repositories only
99-
- Too big repos will probably timeout (if longer than 20 secondes to clone)
93+
1. Provide your feedback and ideas on discord
94+
2. Open an Issue on github to report a bug
95+
2. Create a Pull request
96+
- Fork the repository
97+
- Make your changes and test them locally
98+
- Open a pull request for review and feedback
10099

100+
### 🔧 Local dev
101101

102-
## Command Line Global Installation
102+
#### Environment Configuration
103+
- **`ALLOWED_HOSTS`**: Specify allowed hostnames for the application. Default: `"gitingest.com,*.gitingest.com,gitdigest.dev,localhost"`.
104+
You can configure the application using the following environment variables:
103105

104106
```bash
105-
pip install -e .
107+
ALLOWED_HOSTS="gitingest.local,localhost"
106108
```
107109

108-
## Command Line Usage
109-
110-
The `gitingest` command line tool allows you to analyze any directory and create a text dump of its contents.
111-
112-
### Basic Usage
113-
110+
#### Run locally
111+
1. Clone the repository
114112
```bash
115-
gitingest /path/to/directory
113+
git clone https://github.com/cyclotruc/gitingest.git
114+
cd gitingest
116115
```
117116

118-
This will create a text file named after your directory (e.g., `directory.txt`) in your current working directory.
119-
120-
### Specifying Output Location
121-
117+
2. Install dependencies
122118
```bash
123-
gitingest /path/to/directory -o /path/to/output.txt
119+
pip install -r requirements.txt
124120
```
125121

126-
### Options
127-
128-
- `-o, --output`: Specify the output file path (default: `<directory_name>.txt` in current directory)
129-
- `-s, --max-size`: Maximum file size to process in bytes (default: 10MB)
130-
- `-i, --ignore-pattern`: Additional patterns to ignore (can be used multiple times)
131-
132-
### Examples
133-
122+
3. Run the application:
134123
```bash
135-
# Basic usage
136-
gitingest ~/projects/myproject
137-
138-
# Custom output location
139-
gitingest ~/projects/myproject -o ~/Desktop/analysis.txt
140-
141-
# Ignore specific file patterns
142-
gitingest ~/projects/myproject -i "*.csv" -i "*.json"
143-
144-
# Set maximum file size (e.g., 5MB)
145-
gitingest ~/projects/myproject -s 5000000
124+
cd src
125+
uvicorn main:app --reload
146126
```
147127

148-
### Output Format
149-
150-
The generated text file contains:
151-
1. Summary statistics (file count, directory count, content size)
152-
2. Directory tree structure
153-
3. Contents of all text files
128+
The frontend will be available at `localhost:8000`
154129

155-
Files and directories that are commonly ignored (like `.git`, `node_modules`, cache directories, etc.) are automatically excluded. You can add additional patterns to ignore using the `-i` flag.
156130

0 commit comments

Comments
 (0)