Skip to main content
// List files from default branch
const files = await repo.listFiles();
console.log(files.paths); // Array of file paths

// List files from specific branch or commit
const branchFiles = await repo.listFiles({
  ref: "feature-branch", // branch name or commit SHA
});
console.log(`Files in ${branchFiles.ref}:`, branchFiles.paths);

// List files from the ephemeral namespace
const ephemeralFiles = await repo.listFiles({
  ref: "feature/demo-work",
  ephemeral: true,
});
console.log(`Ephemeral files:`, ephemeralFiles.paths);

Options

ParameterTypeDescription
refOptionalBranch name or commit SHA. Defaults to the default branch.
ephemeralOptionalWhen true, resolves the ref under the ephemeral namespace.

Response

FieldTypeDescription
pathsArrayList of file paths in the repository
refStringThe resolved ref that was listed