Skip to main content

getTree

client.editorApi.getTree(workspaceId: string, projectName: string): Promise<EditorTreeNode>

Retrieves the hierarchical file tree for a workspace project.

Returns a nested tree structure representing all files and directories within the specified project. Useful for rendering file explorers or programmatically traversing project contents.

Parameters​

ParameterTypeRequiredDescription
workspaceIdstringYesThe unique identifier of the workspace containing the project
projectNamestringYesThe name of the project whose file tree to retrieve

Returns​

Promise<EditorTreeNode> — A promise that resolves to the root with nested children

Example​

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

const client = new CodeBoltClient();

const result = await client.editorApi.getTree('workspaceId', 'projectName');
console.log(result);