Copilot CLI: Automation, Programmatic Mode, Scripts, and GitHub Actions/Describe large files in a shell loop
Use Copilot inside a `while` loop.
Section: Script recipes
Describe large files in a shell loop
bash
bash
while IFS= read -r -d "" file; do
description=$(copilot -p "Describe this file briefly: $file" -s 2>/dev/null)
echo "$file => $description"
done < <(find . -type f -size +10M -print0)Explanation
This is adapted from the official automation quickstart and is a good pattern for repo reporting.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Script recipes
Draft release notes from Git history
Combine git and Copilot for release automation.
Review generated SQL migrations
Use Copilot as a quick reviewer in a script.
Produce an onboarding report automatically
Generate repo setup instructions in Markdown.
Pipe prompt text and redirect the answer
Generate output for downstream steps.
Run a prompt with automatic tools
Let Copilot use tools during a non-interactive run.