Workspace Files and Git Functions
Campfire workspace functions operate on the currently open folder workspace. They are specific to Campfire's folder-first experience.
Use these functions when CodeBot needs to understand the workspace root, list workspace contents, create a plain file in a folder workspace, or use Git through Campfire's workspace Git manager.
Workspace Info
getCurrentWorkspaceInforeturns information about the currently open Campfire workspace.listWorkspaceFolderlists files and folders inside the current workspace.folderPathcan be omitted for the workspace root, or passed as an absolute path inside the workspace or a workspace-relative path. The result separatesfilesandfolders, supports optional recursive traversal, and caps result counts.
Use getCurrentWorkspaceInfo before assuming where the workspace lives or what state Campfire has already discovered. Use listWorkspaceFolder for folder-style discovery instead of shelling out to ls when CodeBot only needs the workspace contents.
Workspace File Creation
createFileInWorkspaceFoldercreates a new text file, preferably inside the current workspace.filePathcan be absolute or workspace-relative, andcodeis the full file contents.
Use this for folder workspaces that are not project-based. It creates a local text file but does not add the file to an IDE project. If the target path points outside the current workspace, Campfire asks the user for approval before writing there.
Git
initGitRepositoryinitializes Git in the current workspace. It requires an explicit initialbranchName, runs Git initialization through Campfire, and adds Campfire's local CodeBot cache, approvals, and workspace settings files to.gitignore.runGitCommandruns Git arguments in the current workspace through Campfire's Git manager. It accepts Git arguments such asstatus -sborlog --oneline -5, not arbitrary shell commands.
Use initGitRepository only after the user agrees to add Git to a workspace that does not already have a repository.
Use runGitCommand for Git-specific operations in an existing workspace repository. The command is routed through the Git manager, requires approval, reloads source control state after commands that may change the workspace, and is tagged as version-control work.
When To Use Which Tool
Use listWorkspaceFolder for workspace discovery.
Use createFileInWorkspaceFolder for new standalone files in folder workspaces.
Use initGitRepository when Campfire should turn the current folder into a Git repository.
Use runGitCommand when the user asks for a Git operation and the workspace already has Git.
Use the shared file-editing functions for existing-file reads and edits. Use the shared terminal function only when the task is not a Git-manager operation.