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

# Files SDK

> File management methods

## write()

Write a file to the session.

```typescript theme={null}
await client.files.write({
  sessionId: string;
  path: string;
  content: string;
});
```

## read()

Read a file from the session.

```typescript theme={null}
const content = await client.files.read({
  sessionId: string;
  path: string;
});
```

## list()

List all files in the session.

```typescript theme={null}
const files = await client.files.list({
  sessionId: string;
  path?: string;
});
```

## Example

```typescript theme={null}
// Write
await client.files.write({
  sessionId: 'ses_abc123',
  path: 'data.json',
  content: JSON.stringify({ hello: 'world' })
});

// Read
const content = await client.files.read({
  sessionId: 'ses_abc123',
  path: 'data.json'
});

// List
const files = await client.files.list({
  sessionId: 'ses_abc123'
});
```
