CLI documentation#

The stac-asset Command-Line Interface (CLI) provides a text-based way of using the library.

stac-asset#

Work with STAC assets.

See each subcommand’s help text for more information:

$ stac-asset download –help $ stac-asset info –help

stac-asset [OPTIONS] COMMAND [ARGS]...

Options

-v, --verbosity <LVL>#

Either CRITICAL, ERROR, WARNING, INFO or DEBUG.

download#

Download STAC assets from an item or item collection.

If href is not provided, or is -, the item or item collection is parsed as JSON from standard input. If the directory is not provided, the current working directory is used.

These three examples are equivalent, and download the assets to the current working directory:

$ stac-asset download item.json

$ stac-asset download item.json .

$ cat item.json | stac-asset download

To only include certain asset keys:

$ stac-asset download -i asset-key-to-include item.json

stac-asset download [OPTIONS] [HREF] [DIRECTORY]

Options

-a, --alternate-assets <alternate_assets>#

Alternate asset hrefs to prefer, if available

-i, --include <include>#

Asset keys to include

-x, --exclude <exclude>#

Asset keys to exclude (can’t be used with include)

-f, --file-name <file_name>#

The output file name

-q, --quiet#

Do not print anything to standard output.

Default:

False

--s3-requester-pays#

If downloading via the s3 client, enable requester pays

Default:

False

--s3-retry-mode <s3_retry_mode>#

If downloading via the s3 client, the retry mode (standard, legacy, and adaptive)

--s3-max-attempts <s3_max_attempts>#

If downloading via the s3 client, the max number of retries

-k, --keep#

If warning on error, keep assets that couldn’t be downloaded with their original hrefs. If false, delete those assets from the item.

Default:

False

--fail-fast#

Fail immediately on download error, instead of waiting until all are complete.

Default:

False

--overwrite#

Overwrite existing files if they exist on the filesystem

Default:

False

Arguments

HREF#

Optional argument

DIRECTORY#

Optional argument

info#

stac-asset info [OPTIONS] [HREF]

Options

-a, --alternate-assets <alternate_assets>#

Alternate asset hrefs to prefer, if available

--s3-requester-pays#

If checking via the s3 client, enable requester pays

Default:

False

--s3-retry-mode <s3_retry_mode>#

If checking via the s3 client, the retry mode (standard, legacy, and adaptive)

--s3-max-attempts <s3_max_attempts>#

If checking via the s3 client, the max number of retries

Arguments

HREF#

Optional argument