Skip to content

Commit 75fb58f

Browse files
Merge branch 'main' into VsCode-Extension
2 parents c8958cd + 5296628 commit 75fb58f

34 files changed

+1519
-691
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ repos:
4444
- id: black
4545

4646
- repo: https://github.com/asottile/pyupgrade
47-
rev: v3.19.1
47+
rev: v3.20.0
4848
hooks:
4949
- id: pyupgrade
5050
description: "Automatically upgrade syntax for newer versions."
@@ -73,7 +73,7 @@ repos:
7373
- id: djlint-reformat-jinja
7474

7575
- repo: https://github.com/igorshubovych/markdownlint-cli
76-
rev: v0.44.0
76+
rev: v0.45.0
7777
hooks:
7878
- id: markdownlint
7979
description: "Lint markdown files."
@@ -88,7 +88,7 @@ repos:
8888
files: ^src/
8989

9090
- repo: https://github.com/pycqa/pylint
91-
rev: v3.3.6
91+
rev: v3.3.7
9292
hooks:
9393
- id: pylint
9494
name: pylint for source
@@ -99,6 +99,7 @@ repos:
9999
"fastapi[standard]>=0.109.1",
100100
pydantic,
101101
pytest-asyncio,
102+
pytest-mock,
102103
python-dotenv,
103104
slowapi,
104105
starlette>=0.40.0,
@@ -117,6 +118,7 @@ repos:
117118
"fastapi[standard]>=0.109.1",
118119
pydantic,
119120
pytest-asyncio,
121+
pytest-mock,
120122
python-dotenv,
121123
slowapi,
122124
starlette>=0.40.0,

.vscode/launch.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "Python Debugger: Module",
5+
"type": "debugpy",
6+
"request": "launch",
7+
"module": "uvicorn",
8+
"args": ["server.main:app", "--host", "0.0.0.0", "--port", "8000"],
9+
"cwd": "${workspaceFolder}/src"
10+
}
11+
]
12+
}

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ Thanks for your interest in contributing to Gitingest! 🚀 Gitingest aims to be
4848
pytest
4949
```
5050

51-
8. Navigate to src folder
51+
8. Run the local web server
5252

53-
1. Build the Docker image
53+
1. Navigate to src folder
5454

5555
``` bash
5656
cd src

README.md

Lines changed: 67 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,39 @@ You can also replace `hub` with `ingest` in any GitHub URL to access the corresp
3232

3333
## 📚 Requirements
3434

35-
- Python 3.7+
35+
- Python 3.8+
36+
- For private repositories: A GitHub Personal Access Token (PAT). You can generate one at [https://github.com/settings/personal-access-tokens](https://github.com/settings/personal-access-tokens) (Profile → Settings → Developer Settings → Personal Access Tokens → Fine-grained Tokens)
3637

37-
## 📦 Installation
38+
### 📦 Installation
3839

39-
``` bash
40+
Gitingest is available on [PyPI](https://pypi.org/project/gitingest/).
41+
You can install it using `pip`:
42+
43+
```bash
4044
pip install gitingest
4145
```
4246

47+
However, it might be a good idea to use `pipx` to install it.
48+
You can install `pipx` using your preferred package manager.
49+
50+
```bash
51+
brew install pipx
52+
apt install pipx
53+
scoop install pipx
54+
...
55+
```
56+
57+
If you are using pipx for the first time, run:
58+
59+
```bash
60+
pipx ensurepath
61+
```
62+
63+
```bash
64+
# install gitingest
65+
pipx install gitingest
66+
```
67+
4368
## 🧩 Browser Extension Usage
4469

4570
<!-- markdownlint-disable MD033 -->
@@ -57,17 +82,37 @@ Issues and feature requests are welcome to the repo.
5782
The `gitingest` command line tool allows you to analyze codebases and create a text dump of their contents.
5883

5984
```bash
60-
# Basic usage
85+
# Basic usage (writes to digest.txt by default)
6186
gitingest /path/to/directory
6287

6388
# From URL
6489
gitingest https://github.com/cyclotruc/gitingest
6590

66-
# See more options
67-
gitingest --help
91+
# or from specific subdirectory
92+
gitingest https://github.com/cyclotruc/gitingest/tree/main/src/gitingest/utils
6893
```
6994

70-
This will write the digest in a text file (default `digest.txt`) in your current working directory.
95+
For private repositories, use the `--token/-t` option.
96+
97+
```bash
98+
# Get your token from https://github.com/settings/personal-access-tokens
99+
gitingest https://github.com/username/private-repo --token github_pat_...
100+
101+
# Or set it as an environment variable
102+
export GITHUB_TOKEN=github_pat_...
103+
gitingest https://github.com/username/private-repo
104+
```
105+
106+
By default, the digest is written to a text file (`digest.txt`) in your current working directory. You can customize the output in two ways:
107+
108+
- Use `--output/-o <filename>` to write to a specific file.
109+
- Use `--output/-o -` to output directly to `STDOUT` (useful for piping to other tools).
110+
111+
See more options and usage details with:
112+
113+
```bash
114+
gitingest --help
115+
```
71116

72117
## 🐍 Python package usage
73118

@@ -79,6 +124,21 @@ summary, tree, content = ingest("path/to/directory")
79124

80125
# or from URL
81126
summary, tree, content = ingest("https://github.com/cyclotruc/gitingest")
127+
128+
# or from a specific subdirectory
129+
summary, tree, content = ingest("https://github.com/cyclotruc/gitingest/tree/main/src/gitingest/utils")
130+
```
131+
132+
For private repositories, you can pass a token:
133+
134+
```python
135+
# Using token parameter
136+
summary, tree, content = ingest("https://github.com/username/private-repo", token="github_pat_...")
137+
138+
# Or set it as an environment variable
139+
import os
140+
os.environ["GITHUB_TOKEN"] = "github_pat_..."
141+
summary, tree, content = ingest("https://github.com/username/private-repo")
82142
```
83143

84144
By default, this won't write a file but can be enabled with the `output` argument.

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies = [
1111
"python-dotenv",
1212
"slowapi",
1313
"starlette>=0.40.0", # Vulnerable to https://osv.dev/vulnerability/GHSA-f96h-pmfr-66vw
14-
"tiktoken",
14+
"tiktoken>=0.7.0", # Support for o200k_base encoding
1515
"tomli",
1616
"typing_extensions; python_version < '3.10'",
1717
"uvicorn>=0.11.7", # Vulnerable to https://osv.dev/vulnerability/PYSEC-2020-150
@@ -23,7 +23,6 @@ classifiers=[
2323
"Development Status :: 3 - Alpha",
2424
"Intended Audience :: Developers",
2525
"License :: OSI Approved :: MIT License",
26-
"Programming Language :: Python :: 3.7",
2726
"Programming Language :: Python :: 3.8",
2827
"Programming Language :: Python :: 3.9",
2928
"Programming Language :: Python :: 3.10",

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ pre-commit
55
pylint
66
pytest
77
pytest-asyncio
8+
pytest-mock

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ pydantic
44
python-dotenv
55
slowapi
66
starlette>=0.40.0 # Vulnerable to https://osv.dev/vulnerability/GHSA-f96h-pmfr-66vw
7-
tiktoken
7+
tiktoken>=0.7.0 # Support for o200k_base encoding
88
tomli
99
uvicorn>=0.11.7 # Vulnerable to https://osv.dev/vulnerability/PYSEC-2020-150

0 commit comments

Comments
 (0)