Answer: You run aider from the command line in a script by passing a --message argument (or --msg/-m) with a natural language instruction, which processes the reply and exits, and you can loop over files in a shell script. Useful scripting options include --stream/--no-stream, --message-file, --yes, --auto-commits, --dirty-commits, --dry-run, and --commit. Status: Confirmed Entry: tool/aider/agents-and-automation/scripting-aider-command-line Revision: 1 Digest: sha256:0311f727b1a717f9 (changes whenever the content changes) Timeline: Created: 2026-11-13T02:56:36Z Last changed: 2026-11-13T02:56:36Z Last verified: 2026-11-20T11:43:34Z Next check: 2026-11-21T11:43:34Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of message option | --message COMMAND, --msg COMMAND, -m COMMAND | [1] | 2026-11-20 message behavior | Specify a single message to send GPT, process reply then exit (disables chat mode) | [1] | 2026-11-20 message-file option | --message-file MESSAGE_FILE, -f MESSAGE_FILE | [1] | 2026-11-20 yes option | --yes | [1] | 2026-11-20 dry-run option | --dry-run, --no-dry-run | [1] | 2026-11-20 commit option | --commit | [1] | 2026-11-20 stream option | --stream, --no-stream | [1] | 2026-11-20 Sources: [1] Aider. "aider.chat/docs/scripting.html". https://aider.chat/docs/scripting.html Role: primary. Accessed: 2026-11-20T11:43:34Z Quote: "--message COMMAND, --msg COMMAND, -m COMMAND" (Supports: message option) Quote: "Specify a single message to send GPT, process reply then exit (disables chat mode)" (Supports: message behavior) Quote: "--message-file MESSAGE_FILE, -f MESSAGE_FILE" (Supports: message-file option) Quote: "--yes Always say yes to every confirmation" (Supports: yes option) Quote: "--dry-run, --no-dry-run Perform a dry run without modifying files (default: False)" (Supports: dry-run option) Quote: "--commit Commit all pending changes with a suitable commit message, then exit" (Supports: commit option) Quote: "--stream, --no-stream Enable/disable streaming responses (default: True)" (Supports: stream option) Published: 2026-04-25T16:45:23Z Snapshot SHA-256: 674663a6c4c155a1d061ad522d970e45b0ce98774d9bb22a624d3bb6e7eb59d6 (captured 2026-11-13T02:56:36Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T02:56:36Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T11:43:34Z. No independent second source is configured for this entry Last successful check: 2026-11-20T11:43:34Z Last attempt: 2026-11-20T11:43:34Z Notes and limitations: Extracted automatically from a single official source (section "Command line"). Related: https://latestn.com/tool/aider/agents-and-automation/scripting-aider-python How do I use aider from Python code? https://latestn.com/tool/aider/commands-and-shortcuts/add-files-to-chat How do I add files to an Aider chat session? https://latestn.com/tool/aider/commands-and-shortcuts/add-files-to-chat-2 How do I add files to the chat in Aider? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T02:56:36Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/aider/agents-and-automation/scripting-aider-command-line/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/aider/agents-and-automation/scripting-aider-command-line POST: https://latestn.com/dispute/tool/aider/agents-and-automation/scripting-aider-command-line with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/aider/agents-and-automation/scripting-aider-command-line?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I run aider from the command line in a script? Revision 1, last verified 2026-11-20T11:43:34Z. https://latestn.com/tool/aider/agents-and-automation/scripting-aider-command-line (accessed 2026-11-21T09:59:06Z). @misc{LatestN_tool_aider_agents_and_automation_scripting_aider_command_line_r1, title = {How do I run aider from the command line in a script?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/aider/agents-and-automation/scripting-aider-command-line}}, note = {Revision 1; digest sha256:0311f727b1a717f9; last verified 2026-11-20T11:43:34Z; accessed 2026-11-21T09:59:06Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/aider/agents-and-automation/scripting-aider-command-line