diff --git a/README.md b/README.md index 742864c..b0dfcf6 100644 --- a/README.md +++ b/README.md @@ -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=" -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": "", "msg": ""}' -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": ""}' -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": "", "commit": ""}' -H "Authorization: <.ENV_SECRET_TOKEN>" +```