You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/python-sdk/context/github_action_indexer/README.md
+65-17Lines changed: 65 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,11 +10,44 @@ This example demonstrates:
10
10
- Automatic fallback to full re-index when needed
11
11
- GitHub Actions integration
12
12
13
-
## Quick Start
13
+
## Prerequisites
14
14
15
-
### Local Usage
15
+
### Getting Your API Credentials
16
16
17
-
The simplest way to get started is to index and search a repository locally:
17
+
1.**Authenticate to get your credentials if you have not already:**
18
+
```bash
19
+
auggie login
20
+
```
21
+
This opens a browser for authentication and stores your credentials at `~/.augment/session.json`.
22
+
23
+
2.**Extract the values for environment variables:**
24
+
```bash
25
+
# View your session file to get the values
26
+
cat ~/.augment/session.json
27
+
```
28
+
-`AUGMENT_API_TOKEN`: Use the `accessToken` value from the session file
29
+
-`AUGMENT_API_URL`: Use the `baseUrl` value from the session file
30
+
31
+
### GitHub Token
32
+
33
+
For the `GITHUB_TOKEN`, you need a GitHub Personal Access Token with `repo` scope (for private repos) or `public_repo` scope (for public repos only). [Create one here](https://github.com/settings/tokens).
34
+
35
+
## Two Ways to Use This Example
36
+
37
+
There are two ways to use this indexer:
38
+
39
+
| Mode | Description | Best For |
40
+
|------|-------------|----------|
41
+
|**Local Testing**| Run from this examples directory to index any GitHub repo | Trying out the indexer, testing on existing repos |
42
+
|**GitHub Actions**| Copy the code into your own repo for automatic indexing | Production use, CI/CD integration |
43
+
44
+
---
45
+
46
+
## Option 1: Local Testing (Quick Start)
47
+
48
+
Test the indexer on any GitHub repository without copying any files. This downloads the repo via the GitHub API and indexes it.
49
+
50
+
### Example: Index the facebook/react Repository
18
51
19
52
```bash
20
53
# Navigate to the context examples directory
@@ -23,32 +56,47 @@ cd examples/python-sdk/context
To automatically index your repository on every push:
93
+
For automatic indexing of your repository on every push, copy this code into your own repository.
46
94
47
95
1.**Copy the indexer code** to your repository root. The workflow expects the following structure:
48
96
```
49
97
your-repo/
50
98
├── .github/workflows/index.yml
51
-
├── src/
99
+
├── augment_indexer/
52
100
│ └── main.py (and other indexer source files)
53
101
└── requirements.txt
54
102
```
@@ -128,7 +176,7 @@ Key environment variables:
128
176
129
177
The index state is stored as a JSON file on the file system by default (`.augment-index-state/{branch}/state.json`). In GitHub Actions, the state is persisted between runs using GitHub Actions cache for efficient incremental updates.
130
178
131
-
The indexer can be adapted to use other storage backends like Redis, S3, or databases. The state save/load operations in `src/index_manager.py` can be modified to work with any storage system that can persist JSON data.
179
+
The indexer can be adapted to use other storage backends like Redis, S3, or databases. The state save/load operations in `augment_indexer/index_manager.py` can be modified to work with any storage system that can persist JSON data.
0 commit comments