Skip to main content

FileRead API

File Read API

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

const client = new CodeBoltClient();

Quick Reference

MethodDescription
allFilesRetrieves a listing of all files in the project.
autocompleteGets autocomplete suggestions for file paths.
autocompleteFoldersGets autocomplete suggestions for folder paths only.
autocompleteForSearchGets autocomplete suggestions optimized for search input.
readReads the content of a file.
searchSearches for files matching a query string.

Methods


allFiles

client.fileRead.allFiles(params?: FileSearchParams): Promise<FileSearchResult[]>

Retrieves a listing of all files in the project.

Returns the complete set of files, optionally filtered by the provided search parameters. Useful for building file indexes or bulk operations.

ParameterTypeRequiredDescription
paramsFileSearchParamsNoOptional parameters for filtering the file list

Returns: Promise<FileSearchResult[]> — A promise that resolves to an array of entries

Full reference →


autocomplete

client.fileRead.autocomplete(params?: FileAutocompleteParams): Promise<FileAutocompleteResult[]>

Gets autocomplete suggestions for file paths.

Returns file path completions matching a partial input string. Useful for building file picker UIs with type-ahead functionality.

ParameterTypeRequiredDescription
paramsFileAutocompleteParamsNoOptional parameters including the partial path to complete

Returns: Promise<FileAutocompleteResult[]> — A promise that resolves to an array of suggestions

Full reference →


autocompleteFolders

client.fileRead.autocompleteFolders(params?: FileAutocompleteParams): Promise<FileAutocompleteResult[]>

Gets autocomplete suggestions for folder paths only.

Like but restricted to directories, excluding individual files from the results. Useful for folder picker UIs.

ParameterTypeRequiredDescription
paramsFileAutocompleteParamsNoOptional parameters including the partial folder path to complete

Returns: Promise<FileAutocompleteResult[]> — A promise that resolves to an array of folder suggestions

Full reference →


autocompleteForSearch

client.fileRead.autocompleteForSearch(params?: FileSearchParams): Promise<FileAutocompleteResult[]>

Gets autocomplete suggestions optimized for search input.

Similar to but tailored for search-box contexts where the user is typing a search query rather than a file path.

ParameterTypeRequiredDescription
paramsFileSearchParamsNoOptional search parameters including the partial query

Returns: Promise<FileAutocompleteResult[]> — A promise that resolves to an array of suggestions

Full reference →


read

client.fileRead.read(params?: FileReadParams): Promise<unknown>

Reads the content of a file.

Retrieves the full content of a file at the specified path. Returns the raw file data suitable for display or further processing.

ParameterTypeRequiredDescription
paramsFileReadParamsNoOptional parameters specifying which file to read

Returns: Promise<unknown> — A promise that resolves to the file content

Full reference →


client.fileRead.search(params?: FileSearchParams): Promise<FileSearchResult[]>

Searches for files matching a query string.

Performs a text-based search across file names and paths in the project. Returns matching files with their paths and metadata.

ParameterTypeRequiredDescription
paramsFileSearchParamsNoOptional search parameters including the query string

Returns: Promise<FileSearchResult[]> — A promise that resolves to an array of matches

Full reference →