// 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
Branch name or commit SHA. Defaults to the default branch.
When true, resolves the ref under the ephemeral namespace.
Response
List of file paths in the repository
The resolved ref that was listed