Skip to Content
CLIexport

flexkit export

Exports the full dataset of a project — every entity, every asset and its binary file — into a .tar.gz bundle that flexkit import can restore into the same or another project.

Synopsis

flexkit export [dest.tar.gz] [options]

Bundle layout

flexkit-export-<projectId>-<date>.tar.gz
├── data.ndjson      # one entity per line, in the import file format
├── assets.ndjson    # asset metadata (_id, sha256, tags, _file, ...)
└── files/           # asset binaries, named <assetId>.<ext>
  • data.ndjson lines use the same format flexkit import accepts: scalar values inline, asset references as {"_asset": "file://files/<id>.<ext>"} (arrays ordered by sortOrder), and entity relationships as {"_ref": "<entityId>"}.
  • assets.ndjson preserves each asset’s _id, metadata, sha256 and tag names, so a re-import keeps ids stable and reattaches tags.
  • Localized attributes export every scope defined in the project’s scopes config. Values that only exist in the default scope stay plain ("name": "Chair"); values with additional scopes are wrapped ("name": {"_scopes": {"default": "Chair", "gb": "Armchair"}}).

Behavior

  • Reads the entity types from your local config’s schema and pages through each type with GraphQL queries.
  • Downloads every asset file once (deduplicated by asset _id).
  • Without --type, all project assets are bundled — including ones not referenced by any entity. With --type, only assets referenced by the exported entities are bundled.
  • The default destination is flexkit-export-<projectId>-<date>.tar.gz in the current directory.

Round trip

Importing an export into an empty project reproduces the dataset:

  • Entity _ids are preserved, so _ref relationships reconnect in the import’s second pass.
  • Asset _ids are preserved via assets.ndjson, and content deduplication avoids storing duplicate file contents; repeated requests may still consume resources.
flexkit export
flexkit import flexkit-export-my-project-2026-07-20.tar.gz --project other-project

Options

  • --project <ID>: Select the project when the local config defines several.
  • --type <ENTITY>: Only export the given entity type(s), comma-separated (e.g. --type product,brand).
  • --concurrency <N>: Parallel file downloads (default 5).
  • --overwrite: Replace the destination file if it already exists.

Examples

# Export everything
flexkit export
 
# Export a subset of entity types
flexkit export products.tar.gz --type product,brand
 
# Refresh an earlier export file
flexkit export backup.tar.gz --overwrite
Last updated on

© 2026