API reference

API reference

Commands and every supported option

Flags can appear before or after positional arguments. Put operation-specific flags after the command. -- ends option parsing for paths beginning with -. The global options below are also included in each command's option list.

create

glesha create SET PATH... [options]

Register a backup set and its source paths locally. This creates no archive and makes no cloud requests.

OptionMeaning
--L STRINGdebug, info, warn, error or silent (default "info")
--catalog-to STRINGcatalog remote or local
--chunked[=false]bounded-spool encrypted chunks; false selects one archive
--spool-max SIZEchunk spool limit; default 128MiB, supports 128M and 1.1G
--color STRINGyes, no or auto; always/never aliases accepted (default "auto")
--compression STRINGxz, gzip or bzip2
--compression-level INTcompression level 1..9
--config STRINGTOML configuration file
--env STRINGexplicit credential environment file
--hshow help
--helpshow help
--incremental-storage-class STRINGAWS incremental storage class
--jsonversioned JSON output
--log-level STRINGdebug, info, warn, error or silent (default "info")
--prefix STRINGglesha or encb
--storage-class STRINGAWS storage class
--to VALUEremote names; comma-separated or repeated
--version, -version, -vShow version and build revision.

Examples:

glesha create docs ~/Documents --to b2
glesha create photos ~/Pictures --to aws,b2 --compression gzip

configure

glesha configure SET [options]

Change a set's saved settings or map imported roots. Previously bound source paths cannot be replaced.

OptionMeaning
--L STRINGdebug, info, warn, error or silent (default "info")
--baseline STRINGexplicit snapshot baseline
--catalog-to STRINGcatalog remote or local
--chunked[=false]bounded-spool encrypted chunks; false selects one archive
--spool-max SIZEchunk spool limit; default 128MiB, supports 128M and 1.1G
--color STRINGyes, no or auto; always/never aliases accepted (default "auto")
--compression STRINGxz, gzip or bzip2
--compression-level INTcompression level 1..9
--config STRINGTOML configuration file
--env STRINGexplicit credential environment file
--hshow help
--helpshow help
--incremental-storage-class STRINGAWS incremental storage class
--jsonversioned JSON output
--log-level STRINGdebug, info, warn, error or silent (default "info")
--prefix STRINGglesha or encb
--root VALUEarchive root NAME=source PATH
--storage-class STRINGAWS storage class
--to VALUEremote names; comma-separated or repeated
--version, -version, -vShow version and build revision.

Examples:

glesha configure docs --compression gzip
glesha configure imported --root Documents=~/Documents --to b2 --catalog-to b2

run

glesha run SET [--full|--incremental] [options]

Create and upload a full backup, or an explicit incremental. Repeating a pending run resumes recorded work. Automatically named local archives are removed after all uploads and catalog publication succeed. Use --keep-archive to retain them. Explicit --output files are retained; failures keep archives for retry.

OptionMeaning
--L STRINGdebug, info, warn, error or silent (default "info")
--archive-mode STRINGauto, memory or stream
--assume-yesapprove user-data removal confirmations
--catalog-passphrase-file STRINGseparate catalog passphrase file
--chunked[=false]bounded-spool encrypted chunks; false selects one archive
--spool-max SIZEchunk spool limit; default 128MiB, supports 128M and 1.1G
--color STRINGyes, no or auto; always/never aliases accepted (default "auto")
--compression STRINGxz, gzip or bzip2
--compression-level INTcompression level 1..9
--config STRINGTOML configuration file
--env STRINGexplicit credential environment file
--fullexplicit full snapshot
--hshow help
--hash-workers INThash workers
--helpshow help
--incrementalrequire a baseline on one remote
--jsonversioned JSON output
--keep-archiveretain the local archive after a successful backup
--log-level STRINGdebug, info, warn, error or silent (default "info")
--memory-max STRINGmanaged memory budget
--output STRINGnew output file
--passphrase-file STRINGpassphrase file; '-' reads stdin
--prefix STRINGglesha or encb
--storage-class STRINGAWS storage class
--to VALUEremote names; comma-separated or repeated
--transfer-workers INTmaximum concurrent transfer workers
-j N, --jobs Nuse up to N transfer workers; effective limits may reduce the count
--version, -version, -vShow version and build revision.

Examples:

glesha run docs
glesha run docs --incremental
glesha run docs --keep-archive
glesha run docs --incremental --assume-yes --passphrase-file /secure/archive-password --catalog-passphrase-file /secure/catalog-password --env /secure/cloud.env

retry

glesha retry SET [options]

Resume a pending backup, move, catalog publication or storage-class change. Completed uploads are reused. The original cleanup policy is preserved; --keep-archive retains the file after success. Explicitly relocated archives stay local.

OptionMeaning
--L STRINGdebug, info, warn, error or silent (default "info")
--archive STRINGrelocated completed archive
--catalog-passphrase-file STRINGseparate catalog passphrase file
--color STRINGyes, no or auto; always/never aliases accepted (default "auto")
--config STRINGTOML configuration file
--env STRINGexplicit credential environment file
--hshow help
--helpshow help
--keep-archiveretain the local archive after a successful backup
--log-level STRINGdebug, info, warn, error or silent (default "info")
--version, -version, -vShow version and build revision.

Examples:

glesha retry docs
glesha retry docs --archive /new/location/backup.tar.xz.gpg

list

glesha list [--remote --from REMOTE...] [options]

Show known sets. Remote discovery registers published set descriptions without downloading backup payloads.

OptionMeaning
--L STRINGdebug, info, warn, error or silent (default "info")
--catalog-passphrase-file STRINGseparate catalog passphrase file
--color STRINGyes, no or auto; always/never aliases accepted (default "auto")
--config STRINGTOML configuration file
--env STRINGexplicit credential environment file
--from VALUEordered source remotes; comma-separated or repeated
--hshow help
--helpshow help
--jsonversioned JSON output
--log-level STRINGdebug, info, warn, error or silent (default "info")
--remotediscover remote set descriptors
--version, -version, -vShow version and build revision.

Examples:

glesha list
glesha list --remote --from b2 --env /secure/cloud.env

status

glesha status [SET] [options]

Show an ASCII table of catalog availability, committed snapshots, stored archive copies, remote metadata size, last upload and estimated annual storage cost in USD. status SET adds sources, snapshot identity, local database size, provider copies and separate archive/metadata estimates.

OptionMeaning
--L STRINGdebug, info, warn, error or silent (default "info")
--color STRINGyes, no or auto; always/never aliases accepted (default "auto")
--config STRINGTOML configuration file
--env STRINGexplicit credential environment file
--from VALUEordered source remotes; comma-separated or repeated
--hshow help
--helpshow help
--jsonversioned JSON output
--log-level STRINGdebug, info, warn, error or silent (default "info")
--refreshcheck live metadata without requesting retrieval
--version, -version, -vShow version and build revision.

Examples:

glesha status
glesha status docs --refresh --env /secure/cloud.env

Plain status uses local records and cached measurements, without cloud requests. A local catalog is missing, local, or cached (previously synchronized or published). Cached does not promise that the remote has no newer revisions. --refresh checks recorded archive metadata and lists current metadata objects; it does not download or pull catalogs or request cold restoration.

Local SQLite bytes and compressed/encrypted remote metadata bytes are distinct. New publications record their metadata sizes; older records remain unknown until refreshed. Remote measurements count current visible objects, including discovery records, and exclude hidden or older versions. A publication after a listing may invalidate full coverage until the next refresh, rather than double-counting pending proposals.

The last upload includes recorded payload uploads and catalog publication writes. Older records without upload timestamps show - in human output. Import dates are not used as upload dates. A remote metadata measurement may provide its latest write date.

USD/year estimates include recorded archive copies across providers plus known remote metadata. They assume unchanged storage for twelve months, using the embedded pricing table, dated 2026-10-01. Unknown sizes or rates mark the estimate partial (*). Estimates exclude API requests, retrievals, egress, temporary restored copies, taxes, discounts, free tiers, pending/untracked objects and untracked object versions. They do not predict future backup growth. Intelligent-Tiering assumes Frequent Access unless archive access is observed. JSON retains its version 2 envelope and original fields; additional byte counts remain integers and USD estimates are numeric.

history

glesha history SET [options]

Show completed snapshots, newest first, including transfer and storage status.

OptionMeaning
--L STRINGdebug, info, warn, error or silent (default "info")
--color STRINGyes, no or auto; always/never aliases accepted (default "auto")
--config STRINGTOML configuration file
--env STRINGexplicit credential environment file
--hshow help
--helpshow help
--jsonversioned JSON output
--log-level STRINGdebug, info, warn, error or silent (default "info")
--refreshcheck live metadata without requesting retrieval
--version, -version, -vShow version and build revision.

Examples:

glesha history docs
glesha history docs --refresh --json

browse

glesha browse SET [options]

Browse a snapshot's file metadata in the local catalog. This makes no cloud requests and downloads no file content.

OptionMeaning
--L STRINGdebug, info, warn, error or silent (default "info")
--color STRINGyes, no or auto; always/never aliases accepted (default "auto")
--config STRINGTOML configuration file
--env STRINGexplicit credential environment file
--hshow help
--helpshow help
--jsonversioned JSON output
--log-level STRINGdebug, info, warn, error or silent (default "info")
--path STRINGcatalog path
--recursiveinclude descendants
--snapshot STRINGsnapshot ID or latest (default "latest")
--version, -version, -vShow version and build revision.

Examples:

glesha browse docs
glesha browse docs --path Documents --recursive
glesha browse docs --snapshot SNAPSHOT_ID --recursive --json

restore

glesha restore SET --into DIR [options]

Reconstruct a full snapshot in a new destination. Cold retrieval requires separate, explicit consent.

OptionMeaning
--L STRINGdebug, info, warn, error or silent (default "info")
--archive-passphrase-file VALUEsnapshot ID=passphrase file
--catalog-passphrase-file STRINGseparate catalog passphrase file
--color STRINGyes, no or auto; always/never aliases accepted (default "auto")
--config STRINGTOML configuration file
--days INTreadable-copy availability days
--env STRINGexplicit credential environment file
--from VALUEordered source remotes; comma-separated or repeated
--hshow help
--hash-workers INThash workers
--helpshow help
--into STRINGnew destination directory
--log-level STRINGdebug, info, warn, error or silent (default "info")
--memory-max STRINGmanaged memory budget
--passphrase-file STRINGpassphrase file; '-' reads stdin
--request-retrievalexplicitly authorize retrieval charges
--retrieval STRINGbulk, standard or expedited (default "bulk")
--snapshot STRINGsnapshot ID or latest (default "latest")
--transfer-workers INTmaximum concurrent transfer workers
-j N, --jobs Nuse up to N transfer workers; effective limits may reduce the count
--version, -version, -vShow version and build revision.

Examples:

glesha restore docs --into ~/recovered
glesha restore docs --snapshot SNAPSHOT_ID --into ~/recovered --from b2,aws
glesha restore docs --into ~/recovered --request-retrieval --retrieval bulk

import

glesha import SET (--file FILE | --from REMOTE --key KEY) [options]

Catalog an existing full archive without changing its encrypted bytes or uploading a replacement payload.

OptionMeaning
--L STRINGdebug, info, warn, error or silent (default "info")
--baseline STRINGexplicit snapshot baseline
--catalog-passphrase-file STRINGseparate catalog passphrase file
--color STRINGyes, no or auto; always/never aliases accepted (default "auto")
--config STRINGTOML configuration file
--date STRINGknown backup date in RFC3339
--days INTreadable-copy availability days
--deep-verifyverify associated object bytes
--env STRINGexplicit credential environment file
--file STRINGlocal archive
--from VALUEordered source remotes; comma-separated or repeated
--hshow help
--hash-workers INThash workers
--helpshow help
--jsonversioned JSON output
--key STRINGexact remote object key
--log-level STRINGdebug, info, warn, error or silent (default "info")
--memory-max STRINGmanaged memory budget
--passphrase-file STRINGpassphrase file; '-' reads stdin
--request-retrievalexplicitly authorize retrieval charges
--retrieval STRINGbulk, standard or expedited (default "bulk")
--root VALUEarchive root NAME=source PATH
--transfer-workers INTmaximum concurrent transfer workers
-j N, --jobs Nuse up to N transfer workers; effective limits may reduce the count
--version, -version, -vShow version and build revision.

Examples:

glesha import old-docs --file encb-old.tar.gz.gpg
glesha import old-docs --from b2 --key backups/encb-old.tar.gz.gpg
glesha import old-docs --file encb-old.tar.gz.gpg --from b2 --key backups/encb-old.tar.gz.gpg --deep-verify

move

glesha move SET --to REMOTE [options]

Copy and verify the complete set history before switching providers. Existing source copies are retained.

OptionMeaning
--L STRINGdebug, info, warn, error or silent (default "info")
--assume-yesapprove user-data removal confirmations
--catalog-passphrase-file STRINGseparate catalog passphrase file
--color STRINGyes, no or auto; always/never aliases accepted (default "auto")
--config STRINGTOML configuration file
--days INTreadable-copy availability days
--env STRINGexplicit credential environment file
--hshow help
--hash-workers INThash workers
--helpshow help
--jsonversioned JSON output
--log-level STRINGdebug, info, warn, error or silent (default "info")
--memory-max STRINGmanaged memory budget
--request-retrievalexplicitly authorize retrieval charges
--retrieval STRINGbulk, standard or expedited (default "bulk")
--to VALUEremote names; comma-separated or repeated
--transfer-workers INTmaximum concurrent transfer workers
-j N, --jobs Nuse up to N transfer workers; effective limits may reduce the count
--version, -version, -vShow version and build revision.

Examples:

glesha move docs --to b2
glesha move docs --to other-remote --request-retrieval --retrieval bulk

archive

glesha archive PATH... [options]

Create a standalone encrypted tar archive. No set name or cloud provider is needed.

OptionMeaning
--L STRINGdebug, info, warn, error or silent (default "info")
--archive-mode STRINGauto, memory or stream
--color STRINGyes, no or auto; always/never aliases accepted (default "auto")
--compression STRINGxz, gzip or bzip2
--compression-level INTcompression level 1..9
--config STRINGTOML configuration file
--env STRINGexplicit credential environment file
--hshow help
--hash-workers INThash workers
--helpshow help
--log-level STRINGdebug, info, warn, error or silent (default "info")
--memory-max STRINGmanaged memory budget
--output STRINGnew output file
--passphrase-file STRINGpassphrase file; '-' reads stdin
--prefix STRINGglesha or encb
--storage-class STRINGAWS storage class
--transfer-workers INTmaximum concurrent transfer workers
-j N, --jobs Nuse up to N transfer workers; effective limits may reduce the count
--version, -version, -vShow version and build revision.

Examples:

glesha archive ~/Documents
glesha archive ~/Documents ~/Pictures --compression gzip --output personal.tar.gz.gpg
glesha archive ~/Documents --archive-mode stream --memory-max 128MiB --passphrase-file /secure/archive-password

decrypt

glesha decrypt FILE [options]

Validate an encrypted archive and write its compressed tar to a new output file.

OptionMeaning
--L STRINGdebug, info, warn, error or silent (default "info")
--color STRINGyes, no or auto; always/never aliases accepted (default "auto")
--config STRINGTOML configuration file
--env STRINGexplicit credential environment file
--hshow help
--helpshow help
--log-level STRINGdebug, info, warn, error or silent (default "info")
--memory-max STRINGmanaged memory budget
--output STRINGnew output file
--passphrase-file STRINGpassphrase file; '-' reads stdin
--version, -version, -vShow version and build revision.

Examples:

glesha decrypt personal.tar.xz.gpg
glesha decrypt encb-old.tar.gz.gpg --output recovered.tar.gz --passphrase-file /secure/archive-password

extract

glesha extract FILE --into DIR [options]

Validate and extract an encrypted or plaintext compressed tar into a new directory.

OptionMeaning
--L STRINGdebug, info, warn, error or silent (default "info")
--color STRINGyes, no or auto; always/never aliases accepted (default "auto")
--config STRINGTOML configuration file
--env STRINGexplicit credential environment file
--hshow help
--helpshow help
--into STRINGnew destination directory
--log-level STRINGdebug, info, warn, error or silent (default "info")
--memory-max STRINGmanaged memory budget
--passphrase-file STRINGpassphrase file; '-' reads stdin
--version, -version, -vShow version and build revision.

Examples:

glesha extract personal.tar.xz.gpg --into ~/recovered
glesha extract recovered.tar.gz --into ~/recovered

upload

glesha upload FILE --to REMOTE... [options]

Upload an existing file. Replacing an existing object key requires --force.

OptionMeaning
--L STRINGdebug, info, warn, error or silent (default "info")
--color STRINGyes, no or auto; always/never aliases accepted (default "auto")
--config STRINGTOML configuration file
--env STRINGexplicit credential environment file
--forceexplicitly replace an existing remote key
--hshow help
--hash-workers INThash workers
--helpshow help
--key STRINGremote key (default filename)
--log-level STRINGdebug, info, warn, error or silent (default "info")
--memory-max STRINGmanaged memory budget
--storage-class STRINGAWS storage class
--to VALUEremote names; comma-separated or repeated
--transfer-workers INTmaximum concurrent transfer workers
-j N, --jobs Nuse up to N transfer workers; effective limits may reduce the count
--version, -version, -vShow version and build revision.

Examples:

glesha upload personal.tar.xz.gpg --to b2
glesha upload personal.tar.xz.gpg --to aws,b2 --key backups/personal.tar.xz.gpg

download

glesha download KEY --from REMOTE... [options]

Download encrypted bytes from explicitly selected providers, trying them in the supplied order.

OptionMeaning
--L STRINGdebug, info, warn, error or silent (default "info")
--color STRINGyes, no or auto; always/never aliases accepted (default "auto")
--config STRINGTOML configuration file
--env STRINGexplicit credential environment file
--from VALUEordered source remotes; comma-separated or repeated
--hshow help
--hash-workers INThash workers
--helpshow help
--log-level STRINGdebug, info, warn, error or silent (default "info")
--memory-max STRINGmanaged memory budget
--output STRINGnew output file
--transfer-workers INTmaximum concurrent transfer workers
-j N, --jobs Nuse up to N transfer workers; effective limits may reduce the count
--version, -version, -vShow version and build revision.

Examples:

glesha download backups/personal.tar.xz.gpg --from b2,aws
glesha download backups/personal.tar.xz.gpg --from b2 --output personal.tar.xz.gpg

catalog

glesha catalog pull|push|reconcile|abandon SET [options]

Synchronize metadata explicitly. Pull preserves the old local catalog; reconcile preserves conflicting histories; abandon preserves pending data.

OptionMeaning
--L STRINGdebug, info, warn, error or silent (default "info")
--catalog-passphrase-file STRINGseparate catalog passphrase file
--color STRINGyes, no or auto; always/never aliases accepted (default "auto")
--config STRINGTOML configuration file
--env STRINGexplicit credential environment file
--hshow help
--helpshow help
--log-level STRINGdebug, info, warn, error or silent (default "info")
--version, -version, -vShow version and build revision.

Examples:

glesha catalog pull docs
glesha catalog push old-docs
glesha catalog reconcile docs
glesha catalog abandon docs

storage-class

glesha storage-class SET --snapshot ID --class CLASS [options]

Change an AWS object's storage class with server-side copy. Archive identity and older versions are retained.

OptionMeaning
--L STRINGdebug, info, warn, error or silent (default "info")
--catalog-passphrase-file STRINGseparate catalog passphrase file
--class STRINGAWS storage class
--color STRINGyes, no or auto; always/never aliases accepted (default "auto")
--config STRINGTOML configuration file
--env STRINGexplicit credential environment file
--hshow help
--helpshow help
--log-level STRINGdebug, info, warn, error or silent (default "info")
--snapshot STRINGsnapshot ID or latest (default "latest")
--storage-class STRINGAWS storage class
--version, -version, -vShow version and build revision.

Examples:

glesha storage-class docs --snapshot SNAPSHOT_ID --class DEEP_ARCHIVE

check

glesha check --to REMOTE... [options]

Test every selected provider using a small owned temporary object. Print separate safety, write, metadata, verified read and cleanup results, followed by a summary. OK means verified, FAILED includes the error, and SKIPPED makes no access claim. A failed provider does not stop the remaining checks.

Buckets with default Object Lock retention are not uploaded to during checks. If cleanup fails, the remaining key/version is printed; existing objects are never replaced or deleted. status continues to describe backups rather than creating test objects.

OptionMeaning
--jsonVersioned per-provider results and final summary.
--L STRINGdebug, info, warn, error or silent (default "info")
--color STRINGyes, no or auto; always/never aliases accepted (default "auto")
--config STRINGTOML configuration file
--env STRINGexplicit credential environment file
--hshow help
--hash-workers INThash workers
--helpshow help
--log-level STRINGdebug, info, warn, error or silent (default "info")
--memory-max STRINGmanaged memory budget
--to VALUEremote names; comma-separated or repeated
--transfer-workers INTmaximum concurrent transfer workers
-j N, --jobs Nuse up to N transfer workers; effective limits may reduce the count
--version, -version, -vShow version and build revision.

Examples:

glesha check --to b2 --env /secure/cloud.env
glesha check --to aws,b2 --env /secure/cloud.env
glesha check --to b2 --json --env /secure/cloud.env

help

glesha help
glesha help run
glesha help catalog pull

Shows help without reading configuration or credentials. Accepts the global options; --help/-h show help and --version shows the executable version.

version

glesha version
glesha -v
glesha -version
glesha --version

All forms print glesha VERSION (GIT_SHA) and exit successfully. Development builds print glesha dev (unknown) unless version/revision values are embedded at build time. Configuration and credential files are not loaded. The version subcommand accepts the global options; glesha version --help or glesha help version lists them. Extra positional arguments are rejected. See man/glesha-version.1.

Exit status

CodeMeaning
0Success
1Operation failed
2Invalid usage or missing selection
3Pending work or cold retrieval
4Conflicting remote history

Bounded disk space

glesha run docs --chunked --spool-max 128M creates independently encrypted chunks instead of one archive. 128M and 1.1G use decimal units; 128MiB uses binary units. The default spool limit is 128MiB. create and configure can save these settings; run --chunked=false selects a single archive.

Chunked runs reject --output and --keep-archive. Completed chunks are uploaded and removed locally before continuing. Retrying re-reads the source and checks completed chunks, then uploads remaining work; changed sources cause an error. Repeat run SET with the original archive passphrase to resume unfinished chunks. retry SET can finish publication once all payload chunks and the descriptor are ready. A chunk contains a fragment of the tar stream. For manual recovery, decrypt the manifest, decrypt and decompress its chunks in order, then concatenate the uncompressed fragments before extracting the tar stream.

The encrypted manifest.json.gpg records chunk order, sizes and checksums. Keep it with the chunks for recovery. Single-file and chunked snapshots can share a history. move, storage-class, raw archive and raw archive import currently accept single-file snapshots only. Failed runs can leave uncommitted remote chunks; glesha does not delete these automatically.