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

# Get Directory Tree

> Generates a tree representation of a directory structure.



## OpenAPI

````yaml api-reference/openapi.json post /api/filesystem/tree
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: http://localhost:4242/{computer_name}
    description: Local development server
    variables:
      computer_name:
        default: your-computer-name
        description: Computer name
security: []
paths:
  /api/filesystem/tree:
    post:
      tags:
        - filesystem
      summary: Get Directory Tree
      description: Generates a tree representation of a directory structure.
      operationId: getDirectoryTree
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TreeParams'
        required: true
      responses:
        '200':
          description: Successfully generated directory tree
          content:
            application/json:
              schema:
                type: object
                title: Response Getdirectorytree
              example:
                name: project
                type: directory
                children:
                  - name: src
                    type: directory
                    children:
                      - name: main.py
                        type: file
        '403':
          description: Permission denied
        '404':
          description: Directory not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
components:
  schemas:
    TreeParams:
      properties:
        path:
          type: string
          title: Path
          description: Root directory path
          example: /home/user/project
        max_depth:
          type: integer
          minimum: 1
          title: Max Depth
          description: Maximum depth to traverse
          default: 3
          example: 3
        include_hidden:
          type: boolean
          title: Include Hidden
          description: Whether to include hidden files/directories
          default: false
          example: false
        pattern:
          anyOf:
            - type: string
            - type: 'null'
          title: Pattern
          description: Glob pattern to filter results
          example: '*.py'
      type: object
      required:
        - path
      title: TreeParams
      example:
        include_hidden: false
        max_depth: 3
        path: /home/user/project
        pattern: '*.py'
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````