Skip to main content

fs

@codebolt/codeboltjs


Variable: fs

const fs: {
createFile: (fileName: string, source: string, filePath: string) => Promise<CreateFileResponse>;
createFolder: (folderName: string, folderPath: string) => Promise<CreateFolderResponse>;
deleteFile: (filename: string, filePath: string) => Promise<DeleteFileResponse>;
deleteFolder: (foldername: string, folderpath: string) => Promise<DeleteFolderResponse>;
editFileWithDiff: (targetFile: string, codeEdit: string, diffIdentifier: string, prompt: string, applyModel?: string) => Promise<EditFileAndApplyDiffResponse>;
fileSearch: (query: string) => Promise<FileSearchResponse>;
grepSearch: (path: string, query: string, includePattern?: string, excludePattern?: string, caseSensitive: boolean) => Promise<GrepSearchResponse>;
listCodeDefinitionNames: (path: string) => Promise<ListCodeDefinitionsResponse>;
listDirectory: (params: {
detailed?: boolean;
ignore?: string[];
limit?: number;
notifyUser?: boolean;
path: string;
show_hidden?: boolean;
}) => Promise<ListDirectoryResponse>;
listFile: (folderPath: string, isRecursive: boolean) => Promise<FileListResponse>;
readFile: (filePath: string) => Promise<ReadFileResponse>;
readManyFiles: (params: {
exclude?: string[];
include?: string[];
include_metadata?: boolean;
max_files?: number;
max_total_size?: number;
notifyUser?: boolean;
paths: string[];
recursive?: boolean;
separator_format?: string;
use_default_excludes?: boolean;
}) => Promise<ReadManyFilesResponse>;
searchFiles: (path: string, regex: string, filePattern: string) => Promise<SearchFilesResponse>;
updateFile: (filename: string, filePath: string, newContent: string) => Promise<UpdateFileResponse>;
writeToFile: (relPath: string, newContent: string) => Promise<any>;
};

Defined in: packages/codeboltjs/src/modules/fs.ts:12

Type Declaration

NameTypeDescriptionDefined in
createFile()(fileName: string, source: string, filePath: string) => Promise<CreateFileResponse>Function createFile Description Creates a new file.packages/codeboltjs/src/modules/fs.ts:21
createFolder()(folderName: string, folderPath: string) => Promise<CreateFolderResponse>Function createFolder Description Creates a new folder.packages/codeboltjs/src/modules/fs.ts:55
deleteFile()(filename: string, filePath: string) => Promise<DeleteFileResponse>Function deleteFile Description Deletes a file.packages/codeboltjs/src/modules/fs.ts:120
deleteFolder()(foldername: string, folderpath: string) => Promise<DeleteFolderResponse>Function deleteFolder Description Deletes a folder.packages/codeboltjs/src/modules/fs.ts:140
editFileWithDiff()(targetFile: string, codeEdit: string, diffIdentifier: string, prompt: string, applyModel?: string) => Promise<EditFileAndApplyDiffResponse>Function editFileWithDiff Description Edits a file by applying a diff.packages/codeboltjs/src/modules/fs.ts:303
fileSearch()(query: string) => Promise<FileSearchResponse>Function fileSearch Description Performs a fuzzy search for files.packages/codeboltjs/src/modules/fs.ts:280
grepSearch()(path: string, query: string, includePattern?: string, excludePattern?: string, caseSensitive: boolean) => Promise<GrepSearchResponse>Function grepSearch Description Performs a grep search in files.packages/codeboltjs/src/modules/fs.ts:255
listCodeDefinitionNames()(path: string) => Promise<ListCodeDefinitionsResponse>Function listCodeDefinitionNames Description Lists all code definition names in a given path.packages/codeboltjs/src/modules/fs.ts:179
listDirectory()(params: { detailed?: boolean; ignore?: string[]; limit?: number; notifyUser?: boolean; path: string; show_hidden?: boolean; }) => Promise<ListDirectoryResponse>Function listDirectory Description Lists directory contents using advanced directory listing tool.packages/codeboltjs/src/modules/fs.ts:370
listFile()(folderPath: string, isRecursive: boolean) => Promise<FileListResponse>Function listFile Description Lists all files.packages/codeboltjs/src/modules/fs.ts:158
readFile()(filePath: string) => Promise<ReadFileResponse>Function readFile Description Reads the content of a file.packages/codeboltjs/src/modules/fs.ts:80
readManyFiles()(params: { exclude?: string[]; include?: string[]; include_metadata?: boolean; max_files?: number; max_total_size?: number; notifyUser?: boolean; paths: string[]; recursive?: boolean; separator_format?: string; use_default_excludes?: boolean; }) => Promise<ReadManyFilesResponse>Function readManyFiles Description Reads multiple files based on paths, patterns, or glob expressions.packages/codeboltjs/src/modules/fs.ts:337
searchFiles()(path: string, regex: string, filePattern: string) => Promise<SearchFilesResponse>Function searchFiles Description Searches files in a given path using a regex pattern.packages/codeboltjs/src/modules/fs.ts:200
updateFile()(filename: string, filePath: string, newContent: string) => Promise<UpdateFileResponse>Function updateFile Description Updates the content of a file.packages/codeboltjs/src/modules/fs.ts:100
writeToFile()(relPath: string, newContent: string) => Promise<any>Function writeToFile Description Writes content to a file.packages/codeboltjs/src/modules/fs.ts:221