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

ref
string
Branch name or commit SHA. Defaults to the default branch.
ephemeral
string
When true, resolves the ref under the ephemeral namespace.

Response

paths
array
List of file paths in the repository
ref
string
The resolved ref that was listed