> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baseten.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Fuzzy search for files and directories

> Ranks the files and directories under a path by how well their relative path fuzzy-matches `query` (fzf algorithm: the query's characters must appear in order, not necessarily next to each other), best match first.
Fuzzy search is for "jump to file" lookups from a partial name. The `patterns` parameter is currently ignored by this endpoint; use find for exact glob filtering.



## OpenAPI

````yaml /reference/sandbox-api/openapi.json get /filesystem-search/{path}
openapi: 3.0.0
info:
  description: API for manipulating filesystem, processes and network.
  title: Sandbox API
  contact: {}
  version: 0.0.1
servers:
  - url: https://{sandbox_host}
    description: >-
      Host from the sandbox's returned url, without the scheme or trailing
      slash.
    variables:
      sandbox_host:
        default: sandbox.example.com
security:
  - BearerAuth: []
paths:
  /filesystem-search/{path}:
    get:
      tags:
        - filesystem
      summary: Fuzzy search for files and directories
      description: >-
        Ranks the files and directories under a path by how well their relative
        path fuzzy-matches `query` (fzf algorithm: the query's characters must
        appear in order, not necessarily next to each other), best match first.

        Fuzzy search is for "jump to file" lookups from a partial name. The
        `patterns` parameter is currently ignored by this endpoint; use find for
        exact glob filtering.
      parameters:
        - description: Path to search in (e.g., /home/user/projects)
          name: path
          in: path
          required: true
          schema:
            type: string
        - description: >-
            Fuzzy pattern matched against each relative path (e.g., mngo for
            src/main.go). When omitted, the search path itself is used as the
            pattern.
          name: query
          in: query
          schema:
            type: string
        - description: 'Maximum number of results to return (default: 20)'
          name: maxResults
          in: query
          schema:
            type: integer
        - description: >-
            Accepted for compatibility but currently ignored; use
            filesystem-find for glob filtering
          name: patterns
          in: query
          schema:
            type: string
        - description: >-
            Comma-separated directory names to skip (default:
            node_modules,vendor,.git,dist,build,target,__pycache__,.venv,.next,coverage).
            Use empty string to skip no directories.
          name: excludeDirs
          in: query
          schema:
            type: string
        - description: 'Exclude hidden files and directories (default: true)'
          name: excludeHidden
          in: query
          schema:
            type: boolean
      responses:
        '200':
          description: Fuzzy search results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FuzzySearchResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    FuzzySearchResponse:
      type: object
      required:
        - matches
        - total
      properties:
        matches:
          type: array
          items:
            $ref: '#/components/schemas/FuzzySearchMatch'
        total:
          type: integer
          example: 5
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          example: Error message
    FuzzySearchMatch:
      type: object
      required:
        - path
        - score
        - type
      properties:
        path:
          type: string
          example: src/main.go
        score:
          type: integer
          example: 100
        type:
          description: '"file" or "directory"'
          type: string
          example: file
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Sandbox access token created through POST /v1/token.

````