For AI agents: the complete documentation index is available at https://docs.gage.io/llms.txt, the full documentation bundle is available at https://docs.gage.io/llms-full.txt, and this page is available as Markdown at https://docs.gage.io/commands/attachment.md.

gage attachment

The gage attachment command manages attachments. An attachment is a set of files added from a directory for scanners to read, such as a Claude Code config directory. It may be named, and it may target one or more stored objects such as sessions. Datasets hold attachments the way they hold sessions.

gage attachment <COMMAND>

Commands that take attachments accept a name, an ID, or a unique ID prefix.

attachment add

Add an attachment from a directory.

gage attachment add [OPTIONS] [INCLUDE]...

Files are selected by path globs relative to the root, as in a shell. settings.json is the one file at the root, **/settings.json is every file by that name, * and ? do not cross /, and {a,b} and [a-z] are supported. Excludes use the same form, and a directory an exclude matches is not entered. At least one include is required; **/* selects every file. An attachment holds at most 10 MiB and 1000 files.

OptionDescription
-r, --root <DIR>Directory to select files from (default: current directory). Stored paths are relative to it.
-e, --exclude <PATTERN>Files to exclude (glob; repeatable)
-s, --scanner <SCANNER>Attach the files a scanner’s scan reads (name or path; repeatable). Requires --dataset.
-d, --dataset <DATASET>Store the attachment and add it to a dataset in one step
-t, --target <OBJECT>Target object such as a session or note (ID or prefix; repeatable)
-n, --name <NAME>Attachment name. Scanners select attachments by name. A name is letters, digits, -, _, and ..
-k, --key <KEY>Attachment key. A later add under the same key updates this attachment.
-y, --yesSkip confirmation prompt

Adding again under the same key updates the attachment, with any new targets added to it. A named add without --key is keyed by its name, root, and patterns. An unnamed add without --key always creates a new attachment.

--scanner prepares an existing dataset for a scan: each scanner attaches the files its tasks read. A scan runs these attach tasks itself on a dataset it creates, but not on a dataset given with gage scan --dataset.

To add an attachment already in the store to a dataset, use gage dataset link.

attachment list

List attachments.

gage attachment list [OPTIONS]
OptionDescription
-d, --dataset <DATASET>List attachments in a dataset, in dataset order
-m, --moreShow more items. Repeat to show more per use.
-a, --allShow all items
-n, --limit <LIMIT>Limit the number of items shown (default: 20)
--full-idShow the full attachment ID

attachment show

Show an attachment and its files.

gage attachment show <ATTACHMENT>

attachment delete

Delete attachments from the store.

gage attachment delete [OPTIONS] <ATTACHMENTS>...

Each attachment is removed from every dataset that holds it and marked removed in the store. To take an attachment out of one dataset and keep it in the store, use gage dataset unlink.

OptionDescription
-y, --yesSkip confirmation prompt