> ## Documentation Index
> Fetch the complete documentation index at: https://filepacks.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Pack

> Create a deterministic .fpk artifact from a directory of regular files.

## What it does

`pack` walks an input directory, hashes each file, builds a `format_version: 1` manifest, and writes a deterministic `.fpk` archive.

Use it whenever a workflow finishes producing files and you want one portable artifact instead of a loose directory.

## Usage

```bash theme={null}
filepacks pack <input> --output <file>
```

## When to use it

* after an agent run writes output files
* after an eval or CI job produces reports
* before handing generated files to another reviewer or tool
* before capturing a baseline for later comparison

## Arguments

* `<input>`: input directory to package
* `--output <file>`: required output path for the `.fpk` artifact; it must end in `.fpk`

`pack` is the only public CLI command with a flag today, and `--output` is required.

## Minimal example

```bash theme={null}
npx filepacks pack ./run-output --output ./run-output.fpk
```

## Expected output shape

Example:

```text theme={null}
Pack
input=/absolute/path/to/input
output=/absolute/path/to/artifact.fpk
name=input
digest=sha256:...
files=2
bytes=12
```

The artifact name defaults to the input directory basename in the CLI.

## Common mistakes

* passing a file instead of a directory
* forgetting `--output`
* using an output path without the `.fpk` extension
* trying to package symlinks or other non-regular files
* assuming the CLI supports `--name` (it does not)

## Related commands

* `inspect` to read the artifact summary you just created
* `verify` before sharing or storing the artifact
* `compare` to check the artifact against a baseline

## Core API

`@filepacks/core pack()` accepts:

```ts theme={null}
await pack({
  input: '/tmp/input',
  output: '/tmp/example.fpk',
  name: 'example',
})
```

Unlike the CLI, the core API supports an optional `name` field.
