-
Notifications
You must be signed in to change notification settings - Fork 1
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
User Interface Requirement #10
Labels
Comments
@farhoud This is neat! I like it 🙌🏻 |
@amrhssn do we need to change the Response to: Response{
"status": "success",
"results": [
{
"project": "path or name?"
"file": "utils.py",
"line": 10,
"code": "def factorial(n):"
},
{
"project": "path or name?"
"file": "math_helpers.py",
"line": 5,
"code": "def compute_factorial(number):"
}
]
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Stories
user can index a project by providing a project path and main function to lattice
user can search for code in human language
Lattice HTTP API Documentation
Base URL
we can also use http over linux socket
Endpoints
1. Index Project
Index a project by providing the project path and main function.
Endpoint
Request Body
Example Request
Response
2. Search Code
Search for code in human language.
Endpoint
Query Parameters
query
(required): The search query in human language.Example Request
Response
Detailed Endpoint Descriptions
Index Project Endpoint
Description:
This endpoint allows you to index a project, making it searchable by the Lattice system.
HTTP Method:
POST
URL:
/index
Request Body:
path
(string, required): The path to the project directory you want to index.main
(string, required): The main function or entry point of your project.Example Request:
Example Response:
Search Code Endpoint
Description:
This endpoint allows you to search your indexed codebase using human language.
HTTP Method:
GET
URL:
/search
Query Parameters:
query
(string, required): The search query in human language describing what you are looking for.Example Request:
curl -X GET "http://api.lattice.com/search?query=function+that+parses+JSON+data"
Example Response:
Error Handling
Common Errors
400 Bad Request
404 Not Found
500 Internal Server Error
Conclusion
This HTTP API allows you to index projects and search for code using human language, facilitating easy navigation and management of your codebase. Follow the endpoint guidelines and examples to integrate these capabilities into your applications.
Lattice CLI Documentation
Overview
The Lattice CLI allows you to index your projects and search for code using human language. This makes it easier to manage and navigate through your codebase, especially for larger projects.
Commands
1.
index
Index a project by providing the project path and main function to Lattice.
Usage
Arguments
--path
(required): The path to the project directory you want to index.--main
(required): The main function or entry point of your project.Example
2.
search
Search for code in human language.
Usage
lattice search --query "<search_query>"
Arguments
--query
(required): The search query in human language describing what you are looking for.Example
lattice search --query "function that calculates factorial"
Detailed Command Descriptions
Index Command
The
index
command allows you to index your project, making it searchable by the Lattice system. This is useful for setting up your project in Lattice so that you can leverage advanced search capabilities.Steps to Use
index
command with the appropriate arguments.Example Explained
/home/user/projects/my_project
.app.py
as the main function or entry point for the project.Search Command
The
search
command enables you to search your indexed codebase using human language. This makes it easier to find specific functions, classes, or code snippets without having to remember exact code syntax or file locations.Steps to Use
index
command.search
command with your query.Example Explained
lattice search --query "function that parses JSON data"
Troubleshooting
Common Issues
Project Not Indexed
index
command before attempting to use thesearch
command.No Results Found
Getting Help
For additional help, use the
--help
flag with any command to display usage information.Conclusion
The Lattice CLI simplifies the process of navigating and managing your codebase by enabling human language search and efficient project indexing. Follow the usage guidelines and examples to make the most out of these powerful features.
The text was updated successfully, but these errors were encountered: