Skip to main content

readFile

client.environments.readFile(id: string, data: ReadEnvironmentFileRequest): Promise<unknown>

Reads a file from within an environment.

Retrieves the contents of a specific file from the environment's filesystem. Useful for inspecting files without SSH access.

Parameters

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the environment
dataReadEnvironmentFileRequestYesThe file read request specifying the file path

Returns

Promise<unknown> — A promise that resolves to the file contents

Example

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

const result = await client.environments.readFile('id', /* ReadEnvironmentFileRequest */);
console.log(result);