Answer: In V2 prompt and command inputs, you describe an attachment with a uri and optional name and description, using an absolute file: URL for a file or directory available to the server, or a data: URL to send content inline. Status: Confirmed Entry: tool/opencode/commands-and-shortcuts/attachment-syntax Revision: 1 Digest: sha256:8703cdd8cebb47ea (changes whenever the content changes) Timeline: Created: 2026-11-13T03:55:33Z Last changed: 2026-11-13T03:55:33Z Last verified: 2026-11-20T13:44:19Z Next check: 2026-11-21T13:44:19Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of attachment fields | uri and optional name and description | [1] | 2026-11-20 file URL example | file:///home/me/project/src/server.ts | [1] | 2026-11-20 line selection parameters | positive start and end parameters select one-based lines | [1] | 2026-11-20 line selection example | file:///home/me/project/src/server.ts?start=20&end=60 | [1] | 2026-11-20 inline data URL example | data:text/plain;base64,SGVsbG8sIE9wZW5Db2RlIQ== | [1] | 2026-11-20 unsupported URLs | HTTP and HTTPS attachment URLs are not supported | [1] | 2026-11-20 Sources: [1] opencode. "Attachments | OpenCode". https://opencode.ai/docs/attachments/ Role: primary. Accessed: 2026-11-20T13:44:19Z Quote: "describe an attachment with a uri and optional name and description" (Supports: attachment fields) Quote: ""uri" : "file:///home/me/project/src/server.ts"" (Supports: file URL example) Quote: "positive start and end parameters select one-based lines" (Supports: line selection parameters) Quote: "file:///home/me/project/src/server.ts?start=20&end=60" (Supports: line selection example) Quote: ""uri" : "data:text/plain;base64,SGVsbG8sIE9wZW5Db2RlIQ=="" (Supports: inline data URL example) Quote: "HTTP and HTTPS attachment URLs are not supported." (Supports: unsupported URLs) Snapshot SHA-256: d4917fc2943f489fa62cacb738a4ff92104dee9fdd1cec1d9989f5cae3ca7986 (captured 2026-11-15T13:52: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-13T03:55:33Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:44:19Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:44:19Z Last attempt: 2026-11-20T13:44:19Z Notes and limitations: Extracted automatically from a single official source (section "Syntax"). Related: https://latestn.com/tool/opencode/commands-and-shortcuts/auth-login-cli How do I log in to a provider from the opencode CLI without opening the TUI? https://latestn.com/tool/opencode/commands-and-shortcuts/cancel-staged-rollback How do I cancel a staged rollback in opencode? https://latestn.com/tool/opencode/commands-and-shortcuts/command-arguments How do I pass arguments to an opencode command? https://latestn.com/tool/opencode/agents-and-automation/select-agent How do I switch between or select different opencode agents? https://latestn.com/tool/opencode/agents-and-automation/server-plugin-lifecycle-setup How do I define a server plugin in opencode and run code when it loads? https://latestn.com/tool/opencode/agents-and-automation/server-plugin-transforms How do I transform or modify opencode behavior using the plugin API? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:55:33Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/opencode/commands-and-shortcuts/attachment-syntax/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/opencode/commands-and-shortcuts/attachment-syntax POST: https://latestn.com/dispute/tool/opencode/commands-and-shortcuts/attachment-syntax with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/opencode/commands-and-shortcuts/attachment-syntax?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I describe an attachment in opencode prompt syntax? Revision 1, last verified 2026-11-20T13:44:19Z. https://latestn.com/tool/opencode/commands-and-shortcuts/attachment-syntax (accessed 2026-11-21T09:59:28Z). @misc{LatestN_tool_opencode_commands_and_shortcuts_attachment_syntax_r1, title = {How do I describe an attachment in opencode prompt syntax?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/opencode/commands-and-shortcuts/attachment-syntax}}, note = {Revision 1; digest sha256:8703cdd8cebb47ea; last verified 2026-11-20T13:44:19Z; accessed 2026-11-21T09:59:28Z} } 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/opencode/commands-and-shortcuts/attachment-syntax