-
Notifications
You must be signed in to change notification settings - Fork 45
Add API documentation for graph retrieval, query, and commit history endpoints #585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: staging
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -214,3 +214,38 @@ Have questions or feedback? Reach out via: | |
| If you find this repository helpful, please consider giving it a star! | ||
|
|
||
| Knowledge Graph, Code Analysis, Code Visualization, Dead Code Analysis, Graph Database | ||
|
|
||
| ## API Reference | ||
|
|
||
| ### Retrieve a graph | ||
|
|
||
| Fetch graph entities from a repository: | ||
|
|
||
| ```bash | ||
| curl -X GET "http://127.0.0.1:5000/graph_entities?repo=<REPO_NAME>" -H "Authorization: <.ENV_SECRET_TOKEN>" | ||
| ``` | ||
|
|
||
| Example: | ||
| ```bash | ||
| curl -X GET "http://127.0.0.1:5000/graph_entities?repo=GraphRAG-SDK" -H "Authorization: OpenSesame" | ||
| ``` | ||
|
|
||
| ### Send Query | ||
|
|
||
| Query your code graph using natural language: | ||
|
|
||
| ```bash | ||
| curl -X POST http://127.0.0.1:5000/chat -H "Content-Type: application/json" -d '{"repo": "<REPO_NAME>", "msg": "<YOUR_QUESTION>"}' -H "Authorization: <.ENV_SECRET_TOKEN>" | ||
| ``` | ||
|
|
||
| ### History change | ||
|
|
||
| List all commits: | ||
| ```bash | ||
| curl -X POST http://127.0.0.1:5000/list_commits -H "Content-Type: application/json" -d '{"repo": "<REPO_NAME>"}' -H "Authorization: <.ENV_SECRET_TOKEN>" | ||
| ``` | ||
|
|
||
| Switch to a specific commit: | ||
| ```bash | ||
| curl -X POST http://127.0.0.1:5000/switch_commit -H "Content-Type: application/json" -d '{"repo": "<REPO_NAME>", "commit": "<COMMIT_HASH>"}' -H "Authorization: <.ENV_SECRET_TOKEN>" | ||
|
Comment on lines
+224
to
+250
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use the documented env var name consistently in the curl snippets.
Suggested doc update-curl -X GET "http://127.0.0.1:5000/graph_entities?repo=<REPO_NAME>" -H "Authorization: <.ENV_SECRET_TOKEN>"
+curl -X GET "http://127.0.0.1:5000/graph_entities?repo=<REPO_NAME>" -H "Authorization: ${SECRET_TOKEN}"-curl -X POST http://127.0.0.1:5000/chat -H "Content-Type: application/json" -d '{"repo": "<REPO_NAME>", "msg": "<YOUR_QUESTION>"}' -H "Authorization: <.ENV_SECRET_TOKEN>"
+curl -X POST http://127.0.0.1:5000/chat -H "Content-Type: application/json" -d '{"repo": "<REPO_NAME>", "msg": "<YOUR_QUESTION>"}' -H "Authorization: ${SECRET_TOKEN}"-curl -X POST http://127.0.0.1:5000/list_commits -H "Content-Type: application/json" -d '{"repo": "<REPO_NAME>"}' -H "Authorization: <.ENV_SECRET_TOKEN>"
+curl -X POST http://127.0.0.1:5000/list_commits -H "Content-Type: application/json" -d '{"repo": "<REPO_NAME>"}' -H "Authorization: ${SECRET_TOKEN}"-curl -X POST http://127.0.0.1:5000/switch_commit -H "Content-Type: application/json" -d '{"repo": "<REPO_NAME>", "commit": "<COMMIT_HASH>"}' -H "Authorization: ${SECRET_TOKEN}"
+curl -X POST http://127.0.0.1:5000/switch_commit -H "Content-Type: application/json" -d '{"repo": "<REPO_NAME>", "commit": "<COMMIT_HASH>"}' -H "Authorization: ${SECRET_TOKEN}"🧰 Tools🪛 Gitleaks (8.30.0)[high] 225-230: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource. (curl-auth-header) 🤖 Prompt for AI Agents |
||
| ``` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid documenting a literal auth token in the example.
Using
Authorization: OpenSesameencourages copying a shared static token pattern into local setups and will keep triggering secret scanners on the README. Prefer the same placeholder or shell variable form you use elsewhere instead.Suggested doc update
🧰 Tools
🪛 Gitleaks (8.30.0)
[high] 225-230: Discovered a potential authorization token provided in a curl command header, which could compromise the curl accessed resource.
(curl-auth-header)
🤖 Prompt for AI Agents