> ## 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.

# Find files and directories

> Finds files and directories using the find command.



## OpenAPI

````yaml /reference/sandbox-api/openapi.json get /filesystem-find/{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-find/{path}:
    get:
      tags:
        - filesystem
      summary: Find files and directories
      description: Finds files and directories using the find command.
      parameters:
        - description: Path to search in (e.g., /home/user/projects)
          name: path
          in: path
          required: true
          schema:
            type: string
        - description: Type of search (file or directory)
          name: type
          in: query
          schema:
            type: string
        - description: Comma-separated file patterns to include (e.g., *.go,*.js)
          name: patterns
          in: query
          schema:
            type: string
        - description: >-
            Maximum number of results to return (default: 20). If set to 0, all
            results will be returned.
          name: maxResults
          in: query
          schema:
            type: integer
        - 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: Find results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FindResponse'
        '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:
    FindResponse:
      type: object
      required:
        - matches
        - total
      properties:
        matches:
          type: array
          items:
            $ref: '#/components/schemas/FindMatch'
        total:
          type: integer
          example: 5
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          example: Error message
    FindMatch:
      type: object
      required:
        - path
        - type
      properties:
        path:
          type: string
          example: src/main.go
        type:
          description: '"file" or "directory"'
          type: string
          example: file
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Sandbox access token created through POST /v1/token.

````