Add a site type or a destination kind.
Site types and destination kinds are JSON next to the program. Copy a shipped example, keep the fields core already understands, and prove capture or URL mapping with a test. Do not give an extension arbitrary shell.
Where the files go
Put addon JSON in an addons/ directory next to the module or the binary. Put destination JSON in destinations/ the same way. The same id replaces a shipped definition. A new id adds one. Ids are lowercase letters, digits, and hyphens.
WordPress ships as internal/addon/wordpress.json. Destination kinds ship under internal/destination/ (sftp, disk, s3, b2, gdrive). The primary local restic repository is not an extension.
Site type (addon)
Start from wordpress.json. An addon names:
detect— marker files, search depth, and directories to skip while looking for a rootexcludes— paths left out of the file capturedatabase(optional) — how to read connection fields from a config file, and which dump methods to tryversions(optional) — how to read an app version and component headersdumps— named dump methods the database block can call
Dump engines the program understands are argv (a fixed argument list, with placeholders such as {root} and {output}) and mysqldump. Remote dumps use remote_argv when the site is read over SFTP. The password is never a field on the site contract: it stays in the config file the addon names, or under var/secrets/ when saved there.
A directory that matches no addon is files only. On an existing site, set_adapter re-reads the tree; --adapter files forces files only.
Destination kind
Start from an existing kind that matches the shape you need (SFTP for host/user/path, S3 or B2 for bucket and keys, disk for a local path, gdrive for rclone). A kind names:
labelandnote— what people and agents seefields— inputs with apattern(hostname,username,abs_path,bucket,endpoint,drive_path,rel_path) and optionalsetupflag mappingcredentials(optional) — which env names hold access and secret keys; values are stored undervar/secrets/and are not printed backurl— restic URL template; optional empty-path / empty-prefix variantsrequire_tools(optional) — helper binaries that must exist (for examplerclone)hooks(optional) — only the named checks core already knows:disk_safety,mkdir_before_copy,rclone_remote
Do not invent a new Go hook unless JSON cannot express a hard safety or URL requirement. New hooks need a core change and a review.
Prove it
- Copy a shipped JSON file and change only what you must.
- Load it from
addons/ordestinations/next to a built binary. - Run a real capture and check / scratch restore for a site type, or save and enable the destination and confirm the URL and credential mapping.
- If setup needs a new flag name, update the shared agent catalog so CLI and MCP stay aligned. Architecture notes live in
AGENTS.mdat the repo root.
An extension that “succeeds” while silently skipping files or the database is a failed design. Prefer a smaller JSON surface over a plugin that can run anything.