> ## Documentation Index
> Fetch the complete documentation index at: https://cognitio-agent.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List PTY sessions

> Get a list of all active pseudo-terminal (PTY) sessions managed by Cognitio.



## OpenAPI

````yaml /openapi.json get /pty
openapi: 3.1.1
info:
  title: cognitio
  description: cognitio api
  version: 1.0.0
servers: []
security: []
paths:
  /pty:
    get:
      summary: List PTY sessions
      description: >-
        Get a list of all active pseudo-terminal (PTY) sessions managed by
        Cognitio.
      operationId: pty.list
      parameters:
        - in: query
          name: directory
          schema:
            type: string
        - in: query
          name: workspace
          schema:
            type: string
      responses:
        '200':
          description: List of sessions
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Pty'
      x-codeSamples:
        - lang: js
          source: |-
            import { createCognitioClient } from "@cognitio/sdk

            const client = createCognitioClient()
            await client.pty.list({
              ...
            })
components:
  schemas:
    Pty:
      type: object
      properties:
        id:
          type: string
          pattern: ^pty.*
        title:
          type: string
        command:
          type: string
        args:
          type: array
          items:
            type: string
        cwd:
          type: string
        status:
          type: string
          enum:
            - running
            - exited
        pid:
          type: number
      required:
        - id
        - title
        - command
        - args
        - cwd
        - status
        - pid

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.