Skip to main content

write()

Write a file to the session.
await client.files.write({
  sessionId: string;
  path: string;
  content: string;
});

read()

Read a file from the session.
const content = await client.files.read({
  sessionId: string;
  path: string;
});

list()

List all files in the session.
const files = await client.files.list({
  sessionId: string;
  path?: string;
});

Example

// 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'
});