@riverscapes/cli
v2.0.62
Published
Riverscapes Warehouse CLI
Readme
Riverscapes CLI (JavaScript)
Overview
This repository contains the Riverscapes CLI, a command-line tool designed to programmatically manage river restoration projects. It provides functionality to upload and download projects from the Riverscapes Data Exchange, validate project files, and interact with the Data Exchange API. The CLI supports detailed logging, user authentication, and flexible options for managing project data.
Installation
To install the Riverscapes CLI globally on your system, use the following command:
npm install -g @riverscapes/cliEnsure you are using the correct node version in the cli. In rs-web-monorepo/packages/cli, run
nvm use Environment Configuration
Before using the CLI, you need to configure the environment to correctly point API calls to the staging site. Create a file named .env.cli.staging in the root of your repository and add the following line:
RS_API_URL=https://api.warehouse.riverscapes.net/stagingThis ensures that the CLI interacts with the staging environment of the Riverscapes Data Exchange.
Usage
The Riverscapes CLI provides a variety of commands for downloading and uploading projects. Below are examples of common use cases:
Developer Note
For detailed logs and debugging information, use the --verbose flag with any command. This will provide more insights into the CLI's operations and help troubleshoot issues effectively.
Downloading Projects
You can download projects from the Riverscapes Data Exchange using different filters such as project ID, type, metadata, tags, or search terms.
Download by Project ID
rscli download ./junk --id "NationalDatasets" --verboseDownload by Project Type
rscli download ./junk --type "NationalDatasets" --verbose
rscli download ./junk --type "RSContext" --verboseDownload by Search Term
rscli download ./junk --search " " --verbose
rscli download ./junk --search "17020016" --verboseDownload by Metadata
rscli download ./junk --meta "huc8=17020016" --verboseDownload by Tags
rscli download ./junk --tags "cybercastor" --verbose
rscli download . --tags "cybercastor" --verboseUploading Projects
After making edits to a project locally, you can upload your changes back to the Riverscapes Data Exchange using the CLI. The upload functionality ensures that your updates are instantly visible on the platform, enabling real-time collaboration.
Example Upload Command
rscli upload ./path-to-project --verbose