# fs.archive.create

Bundle files and folders into one tar.gz archive

# fs.archive.create

```
fs.archive.create --from FILE… [--format tar.gz] [--store TEXT] [--folder TEXT] [--filename TEXT] [--path TEXT] [--on-conflict error|skip|overwrite] → archive
```

Bundle files and folders into one tar.gz archive. `--from` names each source — a FileRef, an upload, or a store key (a file or a whole folder) — repeated, or once as a `{{ [list] }}`; at most 64. Writes under `--folder` (default `archives`) as `--filename` (default: the first source's name; `.tar.gz` is added when missing) or at an exact `--path`; an archive that exists is an error unless `--on-conflict` says otherwise. Adds `archive` — the durable FileRef of the archive (`ref`, `store`, `size`, …, `origin: fs.archive.create`) — and keeps the rest of the payload.

## Flags

- `--from` (required): A file or folder to bundle: a FileRef, an upload or a store key (repeat, or one {{ [list] }}).
- `--format`: The archive format: tar.gz (default, the only one).
- `--store`: The project store to write to: `local`, or the id of an `s3` credential. Saved explicitly when the pipeline is registered (default: the project's default store at that moment)
- `--folder`: Destination folder (default: archives).
- `--filename`: Archive name; .tar.gz is added when missing (default: the first source's name).
- `--path`: Exact destination key; overrides --folder and --filename.
- `--on-conflict`: When the target already exists: overwrite, skip or error (default: error)

## Examples

### Bundle an export folder

```
| fs.archive.create --from exports/2026-09 --filename export
```

Input:

```json
{
  "month": "2026-09"
}
```

It answers:

```json
{
  "month": "2026-09",
  "archive": {
    "__zf_type": "file_ref",
    "backend": "zebfs",
    "store": "local",
    "ref": "archives/export.tar.gz",
    "filename": "export.tar.gz",
    "mime": "application/gzip",
    "kind": "archive",
    "size": 40211,
    "sha256": "sha256:…",
    "lifecycle": "durable",
    "origin": "fs.archive.create",
    "trust": "generated"
  }
}
```

### Bundle two stored files

```
| fs.archive.create --from "{{ input.report }}" --from "{{ input.file }}" --filename export.tar.gz
```

Each --from is a FileRef (read from the store it names) or a store key in --store; `--from "{{ [input.report, input.file] }}"` is the same.
