๐Ÿ› ๏ธ

Form Bio CLI SDK

Form Bio CLI/SDK

formbio is a high-level command line tool for managing Form Bio workflows and projects.

โš ๏ธ
The Form Bio CLI SDK is under active development and subject to change.

Installing and Updating the formbio CLI tool

To install the latest version of the formbio CLI tool or update your existing installation with the latest you can run the following depending on your operating system.

Windows


# Install via PowerShell 
iwr https://cli.formbio.com/public/latest/install/windows | iex

MacOS

# Install via command line
curl -sSL https://cli.formbio.com/public/latest/install/macos | bash

sudo mkdir -p /usr/local/bin/

# Make it available on your $PATH (only need to do this the first time you install)
sudo ln -s $HOME/.local/bin/formbio /usr/local/bin/formbio

Linux

# Install via command line
curl -sSL https://cli.formbio.com/public/latest/install/linux | bash

# Make it available on your $PATH (only need to do this the first time you install)
sudo ln -s $HOME/.local/bin/formbio /usr/local/bin/formbio

Commands

โ€ฃ
formbio --help
โ€ฃ
formbio auth --help
โ€ฃ
formbio storage --help
โ€ฃ
formbio workflow run --help

Authentication

Login

โ€ฃ
formbio auth login --help

Example usage:

# logs the user in 
formbio auth login
โ€ฃ
Output
# logs the user in when they are already authenticated
formbio auth login
โ€ฃ
Output

Logout

โ€ฃ
formbio auth logout --help

Example usage:

# logs the user out
formbio auth logout
โ€ฃ
Output

Whoami

โ€ฃ
formbio auth whoami --help

Example usage:

# list currently authenticated user
formbio auth whoami
โ€ฃ
Output

Data Upload and Download

List

โ€ฃ
formbio storage ls --help

Example usage:

# list files in top level of project space
formbio storage ls \
   formbio://my-organization/my-project/
โ€ฃ
Output
# list files recursively in the "logs" directory
formbio storage ls -r \
   formbio://my-organization/my-project/logs/
โ€ฃ
Output

Upload / Download

โ€ฃ
formbio storage cp --help

Example usage:

# download a single file from the project into mylocaldir
formbio storage cp \
  formbio://my-organization/my-project/logs/my_file.txt \
  mylocaldir/
โ€ฃ
Output
# upload a single file to the project root
formbio storage cp \
  mylocaldir/my_file.txt \
  formbio://my-organization/my-project/
โ€ฃ
Output
# upload a local directory to a project subdirectory
formbio storage cp -r \
  mylocaldir \
  formbio://my-organization/my-project/subdir/
โ€ฃ
Output
# resume a partially completed upload
formbio storage cp -c \
  one_gig_file.txt \
  formbio://my-organization/my-project/large-files-dir/
โ€ฃ
Output
# downloads files that match the wildcard
# workaround for wildcard support which will come soon:
# formbio storage cp formbio://path/*.txt .
formbio storage ls \
  formbio://my-organization/my-project/logs | grep txt |rev| cut -f 1 -d ' ' | rev | awk '{print "formbio storage cp",$1,"."}' |sh
โ€ฃ
Output

Create Directory

# use the -p (--parents) flag to create several nested directories at once
formbio storage mkdir \
    -p \
    formbio://my-organization/my-project/existing_dir/new_dir/also_new
โ€ฃ
Output

Run Workflows on Form Bio

Launch workflow run

โ€ฃ
formbio workflow run --help

Example command:

# For a given Form Bio Org / Project e.g. Org=form-bio-solutions / Project=rna-seq 
# https://form.bio/organizations/form-bio-solutions/projects/rna-seq/home/
# for JSON output, use the --response-format=JSON flag
$ formbio workflow run \
    --env prod \
    --org form-bio-solutions \
    --project rna-seq \
    --repo nf-rnaseq \
    --workflow expressiondetective \
    --version v1.0.0  \
    --run-name 'runRNASEq' \
    -- \
    --design=formbio://form-bio-solutions/rna-seq/SRP045500.design.txt \
    --input=formbio://form-bio-solutions/rna-seq/pipeline-outputs/getncbi/2023-05-06T00_24_44Z_90a32859-6a83-4fec-882d-38df4147a4aa/output/ \
    --genomeid=GRCh38 \
    --genoannotver=latest \
    --version=rnaseq_v1.0.0 \
    --trim=true \
    --cancer=false \
    --aligner=star \
    --repoDir=/seqprg \
    --markdups=skip \
    --stranded=U \
    --readorigin=F \
    --sourceType=cts \
    --orientation=I \
    --genomes_bucket=gs://bioinfo-workflow-references/genomes \
    --taxid=9606

Creating the workflow...
Your run output is available at: 
https://form.bio/organizations/form-bio-solutions/projects/rna-seqUsage:
  formbio workflow run --org org --project project --repo repo --version version --runName runName  -- [--paramName <param-value>] [--paramName2 <param-value>] [flags]

Get workflow run

โ€ฃ
formbio workflow-run get --help

Example command:

# for JSON output, use the --response-format=JSON flag
$ formbio workflow-run get 9dc2d02a-b8eb-438c-9bb7-2f61fdf5066e

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
| ID         | 9dc2d02a-b8eb-438c-9bb7-2f61fdf5066e |
| Name       | runRNASEq                            |
| Repository | expressiondetective                  |
| User       | A. N. Nother                         |
| Status     | FAILED                               |
| Created    | 2024-02-29 21:10:56                  |
| Updated    | 2024-02-29 21:15:11                  |
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

# Web links for this workflow run

To view workflow run:
https://formbio.com/organizations/form-bio-solutions/projects/rna-seq/workflow-runs/9dc2d02a-b8eb-438c-9bb7-2f61fdf5066e/

To view workflow run output files in data manager:
(may not work immediately)
https://formbio.com/organizations/form-bio-solutions/projects/rna-seq/vault/?path=pipeline-outputs%2Fexpressiondetective%2F2024-02-29T21_10_56Z_9dc2d02a-b8eb-438c-9bb7-2f61fdf5066e


# CLI commands for this workflow run

To get details about this workflow run:
formbio workflow-run get a9bc9dae-742b-496b-a4b4-4ee4daf9c95b

To list the workflow output directories and files:
(may not work immediately)
formbio storage ls formbio://form-bio-solutions/rna-seq/pipeline-outputs/developerdecoy/2024-02-29T21_10_56Z_a9bc9dae-742b-496b-a4b4-4ee4daf9c95b/

Legal Notices

The formbio CLI tool uses the following Open Source software libraries.

  1. github.com/gosimple/slug@1.12.0
  2. https://github.com/hashicorp/errwrap/tree/v1.1.0
  3. https://github.com/hashicorp/go-multierror/tree/v1.1.1
  4. github.com/hashicorp/hcl/json/parser@1.0.0

โ† Previous

Add link here

Next โ†’

Add link here