Library commands
The Library commands provide a CLI interface for discovering and installing libraries from the Chromia library registry. These commands allow developers to browse available Rell libraries and integrate them into their projects.
library list
List all available libraries in the registry.
Usage:
chr library list [options]Options:
--limit <number>,-l <number>: Maximum number of libraries to display (default: 10)--offset <number>,-o <number>: Number of libraries to skip (default: 0)--sort-by <order>: Sort order (ascordesc, default:desc)
Example:
chr library listlibrary view
View detailed information about a specific library.
Usage:
chr library view <library_id> [options]Arguments:
library_id: ID of the library to view
Example:
chr library view com.chromia.ft4library versions
List all versions of a specific library.
Usage:
chr library versions <library_id> [options]Arguments:
library_id: ID of the library to list versions for
Options:
--limit <number>,-l <number>: Maximum number of versions to display (default: 10)--offset <number>,-o <number>: Number of versions to skip (default: 0)
Example:
chr library versions com.chromia.ft4library install
Install libraries from the registry to your local project.
The library install command reads your chromia.yml file and installs all libraries defined in the libs section. It
supports both library-chain libraries (published to Chromia's library registry) and external Git libraries.
Usage:
chr library install <library_id> [options]Arguments:
library_id(optional): Specific library ID to install. If not provided, all configured libraries inchromia.ymlwill be installed.
Options:
--force,-f: Force installation even if RID verification fails (use with caution)
Configuration
Libraries are configured in your chromia.yml file using the libs section:
Library-chain libraries
Published to Chromia's library registry:
libs:
com.chromia.ft4: # Library from Chromia's library-chain registry
version: 0.0.1Configuration options:
version: Version of the library to install
External Git libraries
Hosted in Git repositories:
libs:
ft4: # External library from Git
registry: https://gitlab.com/chromaway/ft4-lib.git
path: rell/src/lib/ft4
tagOrBranch: v1.2.0r
rid: x"E96915FD7C9A5DD4E183D86F4A5B4BB5083A7CC1EDEB1465EDFFC926E67C93F6"
insecure: falseConfiguration options:
registry: Git repository URLpath: Path within the repository to the librarytagOrBranch: Git tag or branch to userid: Expected RID for verificationinsecure: Skip RID verification (not recommended)
Installation examples
Install all configured libraries:
chr library installInstall a specific library:
chr library install com.chromia.ft4Install a specific version:
chr library install com.chromia.ft4@1.0.0Install latest version:
chr library install com.chromia.ft4Force installation:
chr library install com.chromia.ft4 --forceUsing installed libraries
Once installed, you can import and use libraries in your Rell code. Libraries are imported using their simple name:
import ft4;
// Use library functions
val result = ft4.some_function();Common options
All library commands inherit common options for connecting to the library-chain:
Connection options:
--url <url>: URL to the target node. Only required if library-chain is deployed on a custom network (e.g.,https://custom-network). Defaults to Chromia's mainnet if not provided.--brid <hex>: Blockchain RID of the library-chain. Only required if library-chain is deployed on a custom network.
Examples of common usage patterns:
chr library <command> [options]