### Start SeaGOAT Server Source: https://github.com/kantord/seagoat/blob/main/README.md Starts the SeaGOAT server for a specified repository path. This command is essential for enabling code search functionality. ```bash seagoat-server start /path/to/your/repo ``` -------------------------------- ### SeaGOAT Configuration Example Source: https://github.com/kantord/seagoat/blob/main/README.md Example of a project-specific SeaGOAT configuration file (.seagoat.yml) to customize server port. ```yaml # .seagoat.yml server: port: 31134 # Specify server port ``` -------------------------------- ### SeaGOAT Configuration Example Source: https://github.com/kantord/seagoat/blob/main/docs/configuration.md An example of a SeaGOAT configuration file (.seagoat.yml) demonstrating server settings like port, readMaxCommits, ignorePatterns, and client settings like host. ```yaml # .seagoat.yml server: port: 31134 # A port number to run the server on # Increase number of commits used for computing frecency score # Default is `1000`, set to `null` to read all history readMaxCommits: 5000 # globs to ignore in addition to .gitignore ignorePatterns: - "**/locales/*" # Ignore all files inside 'locales' directories - "**/*.po" # Ignore all gettext translation files client: # Connect the CLI to a remove server host: https://example.com/seagoat-instance/ ``` -------------------------------- ### Install Project Dependencies with Poetry Source: https://github.com/kantord/seagoat/blob/main/docs/developer.md Installs all project dependencies and sets up the virtual environment using Poetry. This command ensures that all necessary libraries are available for development. ```bash poetry install ``` -------------------------------- ### Start SeaGOAT Server Source: https://github.com/kantord/seagoat/blob/main/docs/server.md Starts the SeaGOAT server for a specific repository. Optionally, a custom port can be specified. If no port is provided, a random port is assigned. ```bash seagoat-server start [--port=] ``` -------------------------------- ### Install Development Dependencies Source: https://github.com/kantord/seagoat/blob/main/README.md Installs project dependencies using Poetry, required for development. Assumes Poetry and Python 3.11+ are installed. ```bash poetry install ``` -------------------------------- ### Install SeaGOAT Source: https://github.com/kantord/seagoat/blob/main/README.md Installs the SeaGOAT command-line tool using pipx. Requires Python 3.11+ and ripgrep. ```bash pipx install seagoat ``` -------------------------------- ### Querying Specific Folder Source: https://github.com/kantord/seagoat/blob/main/docs/usage.md Example of how to specify a repository path when running SeaGOAT. ```bash seagoat "myQuery" "/path/to/my/repo" ``` -------------------------------- ### Querying Current Folder Source: https://github.com/kantord/seagoat/blob/main/docs/usage.md Example of how to run SeaGOAT to query the current directory. ```bash seagoat "myQuery" ``` -------------------------------- ### Manual Development Server Test Source: https://github.com/kantord/seagoat/blob/main/README.md Manually starts the development version of the seagoat-server command for testing purposes. ```bash poetry run seagoat-server start ~/path/an/example/repository ``` -------------------------------- ### Install Pre-commit Hooks Source: https://github.com/kantord/seagoat/blob/main/docs/developer.md Installs pre-commit hooks to automatically run checks and fixes on the code before committing. This helps maintain code style and quality. ```bash poetry run pre-commit install ``` -------------------------------- ### Run Project Tests with Pytest Source: https://github.com/kantord/seagoat/blob/main/docs/developer.md Executes all tests in the project using pytest to verify the correct setup of the development environment. Passing all tests indicates a successful setup. ```bash poetry run pytest ``` -------------------------------- ### Example SeaGOAT API Response Source: https://github.com/kantord/seagoat/blob/main/docs/server.md Provides a sample JSON response from the SeaGOAT API, illustrating the format of returned data including file paths, scores, and code blocks with line details. ```json { "results": [ { "path": "tests/conftest.py", "fullPath": "/home/user/repos/SeaGOAT/tests/conftest.py", "score": 0.6, "blocks": [ { "score": 0.21, "lines": [ { "score": 0.21, "line": 100, "lineText": "def very_relevant_function():", "resultTypes": [ "result" ] } ], "lineTypeCount": { "result": 1 } }, { "score": 0.6, "lines": [ { "score": 0.6, "line": 489, "lineText": " contents=(\"hello()\\n\" * (i % 50)),", "resultTypes": [ "result" ] }, { "score": 0.84, "line": 490, "lineText": " return foo * bar", "resultTypes": [ "result" ] } ], "lineTypeCount": { "result": 1 } } ] }, { "path": "tests/test_cli.py", "fullPath": "/home/user/repos/SeaGOAT/tests/test_cli.py", "score": 0.87, "blocks": [... etc ... ] }, ... etc ... ], "version": "0.26.0" } ``` -------------------------------- ### Run IPython in Virtual Environment Source: https://github.com/kantord/seagoat/blob/main/docs/developer.md Starts an IPython interactive session within the project's virtual environment, allowing for interactive development and testing. ```bash poetry run ipython ``` -------------------------------- ### Set Equal Context Lines Before and After Source: https://github.com/kantord/seagoat/blob/main/docs/usage.md Example of using the `-C` or `--context` option to set the same number of context lines both before and after each matching result. ```bash seagoat "myQuery" --context=5 ``` -------------------------------- ### Set Context Lines After Results Source: https://github.com/kantord/seagoat/blob/main/docs/usage.md Example of using the `-A` or `--context-below` option to include a specified number of lines of context after each matching result. ```bash seagoat "myQuery" --context-below=5 ``` -------------------------------- ### Set Context Lines Before Results Source: https://github.com/kantord/seagoat/blob/main/docs/usage.md Example of using the `-B` or `--context-above` option to include a specified number of lines of context before each matching result. ```bash seagoat "myQuery" --context-above=5 ``` -------------------------------- ### Disable Syntax Highlighting Source: https://github.com/kantord/seagoat/blob/main/docs/usage.md Example of using the `--no-color` option to disable syntax highlighting, often used in pipelines. ```bash seagoat "myQuery" --no-color ``` -------------------------------- ### Limit Number of Result Lines Source: https://github.com/kantord/seagoat/blob/main/docs/usage.md Example of using the `--max-results` option to limit the number of result lines displayed, focusing on the most relevant results. ```bash seagoat "myQuery" --max-results=5 ``` -------------------------------- ### ChromaDB Embedding Function Configuration Source: https://github.com/kantord/seagoat/blob/main/docs/configuration.md Example of configuring ChromaDB's embedding function within SeaGOAT, specifying the model name and arguments, such as preferred providers for TensorRT. ```yaml server: ... chroma: embedding_function: name: "ONNXMiniLM_L6_V2" arguments: preferred_providers: ["TensorrtExecutionProvider"] ``` -------------------------------- ### Run All Pre-commit Checks Manually Source: https://github.com/kantord/seagoat/blob/main/docs/developer.md Manually runs all pre-commit checks and fixes across all files in the repository. This is useful if pre-commit hooks are not installed or if you want to check all files. ```bash poetry run pre-commit run --all-files ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/kantord/seagoat/blob/main/docs/developer.md Clones the SeaGOAT repository from GitHub and changes the current directory to the cloned repository. This is the initial step for setting up the development environment. ```bash git clone git@github.com:kantord/SeaGOAT.git cd SeaGOAT ``` -------------------------------- ### Basic SeaGOAT Command Source: https://github.com/kantord/seagoat/blob/main/docs/usage.md The fundamental command structure for using SeaGOAT. It takes a query and an optional repository path. ```bash seagoat [repo_path] [OPTIONS] ``` -------------------------------- ### Run Local seagoat-server Source: https://github.com/kantord/seagoat/blob/main/docs/developer.md Executes the local version of the 'seagoat-server' command within the project's virtual environment. ```bash poetry run seagoat-server ``` -------------------------------- ### Query Code Lines via API Source: https://github.com/kantord/seagoat/blob/main/docs/server.md Demonstrates how to send a POST request to the SeaGOAT server to query code lines. Includes the endpoint, headers, and a sample JSON payload. ```bash curl -X POST 'http://localhost:34743/lines/query' \ -H 'Content-Type: application/json' \ -d '{ "queryText": "your_query_here", "limitClue": "500", "contextAbove": 3, "contextBelow": 3 }' ``` -------------------------------- ### Run Local gt/seagoat Command Source: https://github.com/kantord/seagoat/blob/main/docs/developer.md Executes the local version of the 'gt' or 'seagoat' command-line tool within the project's virtual environment. ```bash poetry run gt ``` -------------------------------- ### SeaGOAT Server Info Command Source: https://github.com/kantord/seagoat/blob/main/README.md The `seagoat-server server-info` command provides information about where SeaGOAT stores its database and cache files on your system. This is useful for managing SeaGOAT's data. ```bash seagoat-server server-info ``` -------------------------------- ### Run SeaGOAT Tests Source: https://github.com/kantord/seagoat/blob/main/README.md Commands for running tests in the SeaGOAT project using pytest. Supports watch mode, testing changed files, and testing all files. ```bash poetry run ptw ``` ```bash poetry run pytest . --testmon ``` ```bash poetry run pytest . ``` -------------------------------- ### Test All Files Source: https://github.com/kantord/seagoat/blob/main/docs/developer.md Runs pytest on all files in the project. ```bash poetry run pytest . ``` -------------------------------- ### Using Regular Expressions with AI Queries Source: https://github.com/kantord/seagoat/blob/main/docs/usage.md Demonstrates SeaGOAT's capability to combine regular expressions with AI-driven semantic queries for more precise code searches. ```bash seagoat "function db_.* that initializes database" ``` -------------------------------- ### Run All Files with Pre-commit Source: https://github.com/kantord/seagoat/blob/main/docs/developer.md Runs pre-commit checks on all files in the repository. This is an alternative to using pre-commit hooks for manual checks. ```bash pre-commit run --all-files ``` -------------------------------- ### Query Code Files Source: https://github.com/kantord/seagoat/blob/main/docs/server.md This API endpoint allows you to search for code files based on a query. It takes a JSON payload with the query text and a limit clue, and returns a list of matching file paths. ```APIDOC POST /files/query Request Body: { "queryText": "string", "limitClue": "string" } Parameters: - queryText: The text of your query. - limitClue: Indicates how many results you plan to display. This is not a hard limit and may result in more or fewer results than specified. Response Body: { "results": [ { "fullPath": "string", "path": "string" } ], "version": "string" } Example Request: curl -X POST 'http://localhost:34743/files/query' \ -H 'Content-Type: application/json' \ -d '{ \ "queryText": "your_query_here", \ "limitClue": "500" \ }' Example Response: { "results": [ { "fullPath": "tests/conftest.py", "path": "tests/conftest.py" }, { "fullPath": "tests/test_cli.py", "path": "tests/test_cli.py" } ], "version": "0.43.0" } ``` -------------------------------- ### Search Repository Source: https://github.com/kantord/seagoat/blob/main/README.md Queries the SeaGOAT indexed repository using natural language or regular expressions. The 'gt' command is an alias for 'seagoat'. ```bash gt "Where are the numbers rounded" ``` ```bash gt "function calc_.* that deals with taxes" ``` -------------------------------- ### Retrieve SeaGOAT Server Information Source: https://github.com/kantord/seagoat/blob/main/docs/server.md Retrieves detailed information about all active SeaGOAT servers in JSON format. This includes server status, host, port, and cache locations. ```bash seagoat-server server-info ``` ```json { "version": "0.5.3", "globalCache": "/home/myuser/.cache/seagoat", "globalConfigFile": "/home/myuser/.config/seagoat/config.yml", "servers": { "/path/to/repository/1": { "cacheLocation": { "chroma": "/home/myuser/.cache/seagoat/bfe8133b9e871ea1c8498a0" }, "isRunning": true, "host": "127.0.0.1", "port": "8080", "address": "http://127.0.0.1:8080" }, "/path/to/repository/2": { "cacheLocation": { "chroma": "/home/myuser/.cache/seagoat/fbee39c83bd47a75e2f839" }, "isRunning": false, "host": "127.0.0.1", "port": "8081", "address": "http://127.0.0.1:8081" } } } ``` -------------------------------- ### Stop SeaGOAT Server Source: https://github.com/kantord/seagoat/blob/main/README.md Stops the currently running SeaGOAT server for a given repository path. ```bash seagoat-server stop /path/to/your/repo ``` -------------------------------- ### Watch Mode for Automated Testing Source: https://github.com/kantord/seagoat/blob/main/docs/developer.md Automatically runs all tests whenever file changes are detected. This is useful for rapid development and testing. ```bash poetry run ptw ``` -------------------------------- ### SeaGOAT API Request Payload Structure Source: https://github.com/kantord/seagoat/blob/main/docs/server.md Defines the structure of the JSON payload required for querying code lines. Explains each parameter and its purpose. ```APIDOC Payload Structure: queryText: The actual text of your query. limitClue: Indicates how many results you are planning to display. Not a hard limit, but a low value might result in insufficient results. contextAbove: Number of context lines to include above each result line. contextBelow: Number of context lines to include below each result line. ``` -------------------------------- ### SeaGOAT API Response Structure Source: https://github.com/kantord/seagoat/blob/main/docs/server.md Details the structure of the JSON response received from the SeaGOAT server after a code line query. Explains the top-level fields and the nested structure of results, blocks, and lines. ```APIDOC Response Structure: version: The version of SeaGOAT being used. results: An array containing the query results. Each result object contains: path: The relative path of the file within the repository. fullPath: The absolute path to the file on the filesystem. score: A relevance score for the result (smaller is better). blocks: An array of relevant code blocks from this file. Each block object contains: score: A relevance score for the code block. lines: An array of line objects. lineTypeCount: An object containing counts of different line types within the block. Each line object contains: score: Relevance score for this line. line: The line number in the file. lineText: The actual text content of the line. resultTypes: An array indicating the type of result ('result', 'context', 'bridge'). ``` -------------------------------- ### SeaGOAT Configuration for Ignoring Files Source: https://github.com/kantord/seagoat/blob/main/README.md You can configure SeaGOAT to ignore additional files or directories beyond those specified in your `.gitignore` file by using the `ignorePatterns` attribute in the server configuration. This allows for more granular control over which files are processed. ```yaml server: ignorePatterns: - "*.log" - "build/" ``` -------------------------------- ### Update Snapshots Source: https://github.com/kantord/seagoat/blob/main/docs/developer.md Updates snapshots for snapshot testing. This command is used when test outputs have changed and need to be re-recorded. ```bash poetry run pytest --snapshot-update ``` -------------------------------- ### Test Changed Files Source: https://github.com/kantord/seagoat/blob/main/docs/developer.md Runs pytest on files that have been changed, utilizing the --testmon flag for efficient testing. ```bash poetry run pytest . --testmon ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.