[RFC] stac-cli #1211
Closed
gadomski
started this conversation in
STAC Software
[RFC] stac-cli
#1211
Replies: 1 comment
-
Closing this discussion as I've shifted my efforts to the (pip-installable) stacrs-cli. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
stac-cli
Summary
Adds a new repository to stac-utils, stac-cli. This repository will be a click-based Comand Line Interface (CLI), named
stac
, for working with STAC. The command-line interface in pystac-client will be deprecated, with the plan to remove it once stac-cli reaches an acceptable level of maturity. The command-line interface in stactools will be reworked to use a plugin interface built into stac-cli.Motivation
Currently there are two CLIs in the Python+STAC ecosystem:
stac-client
, which performs searches and other queries against STAC APIsstac
, which includes some built-in functionality for moving, copying, and otherwise modifing STAC items, as well as a plugin interface used by stactools-packages to add their own subcommandsHaving two different command-line interfaces in the ecosystem is confusing for users; for example, it's reasonable to assume that you can do
stac search https://my-great-stac-api.com/
, but you can't; you need to usestac-client search
. Additionally, in an effort to keep the dependency profile of pystac-client light, its CLI is not built with click, meaning that its implementation is more complex and less featured than a click-based implementation would be. By moving the CLI to a standalone stac-cli repository, we will make pystac-client smaller and more focused on its core task. Any by porting some stactools subcommands to stac-cli, we will provide more command-line functionality to users without requiring them to install the entire stactools dependency stack.Guide-level explanation
stac-utils/stac-cli will be a standard Python library, with a similar layout to the existing stac-utils Python packages. It will depend on pystac, pystac-client, and click. The CLI will be accessible via
stac
, e.g.:Subcommands
The following subcommands currently exist for pystac-client and will be ported to stac-cli:
The following subcommands currently exist for stactools:
Some of these stactools commands depend on heavy or complicated third-party libraries (e.g. rasterio); these will stay in stactools. Many of the simpler commands can be implemented purely via pystac and pystac-client, and these will be ported to stac-cli and removed from stactools.
Plugin interface
stactools currently has a plugin interface that allows outside packages to add subcommands to the
stac
CLI entrypoint. This plugin interface will be ported from stactools to stac-cli, and stactools will be reworked to provide any of its remaining subcommands via this plugin interface. This interface will be designed to be backwards compatible, so existing stactools-packages continue to work without any changes.Drawbacks
stac-client
entrypoint will have to update their workflows to usestac
Rationale and alternatives
stac
orstac-client
for command-line operations, and the maintenance burden of pystac-client will remain higher than it otherwise would be. Additionally, some functionality that could be exposed on the command line without stactools (e.g.stac describe
) will be inaccessible.Prior art
Unresolved questions
pip install stac-cli
will get a working installation.Future possibilities
We could enable/add
async
support for stac-cli, which would be extremely helpful forstac search
,stac download
, etc, without necessarily having to pushasync
down into pystac and pystac-clientBeta Was this translation helpful? Give feedback.
All reactions