blocklet
The blocklet
command is the primary utility for managing the lifecycle of individual blocklets. It provides a suite of subcommands for initializing, developing, bundling, deploying, and distributing your blocklet projects.
Usage#
blocklet [options] [command]
Global Options#
Option | Description |
---|---|
| Output the version number. |
| Automatically answer "yes" to all prompts. Default is |
| Display help information for a command. |
Commands#
create [name]
#
Bootstrap a new blocklet project from various starter templates.
Option | Description |
---|---|
| Specify a DID for the new blocklet. |
| Only create a blocklet DID without creating a project. |
init
#
Create an empty blocklet project, including the essential blocklet.yml
file.
Option | Description |
---|---|
| Specify a DID for the blocklet. |
| Initialize the project without asking any questions. Default is |
| Provide a custom moniker for DID creation. Use commas to separate multiple values. |
| A connect URL to help generate the DID. |
dev
#
Run the blocklet in a local development environment with features like live-reloading.
Options
Option | Description |
---|---|
| Open a browser window after the blocklet starts. Default is |
| Develop the blocklet as a component mounted to a specific app. |
| Specify the mount point when running as a component. |
| Set a default store URL for component dependencies. |
| Automatically start all components defined in the blocklet. Default is |
Subcommands
dev install
: Install the blocklet in development mode.dev start
: Start the installed development blocklet. Supports--e2e
option for end-to-end testing mode.dev remove
: Remove the development mode blocklet.dev studio
: Start the Blocklet Studio.dev reset
: Reset the blocklet's data.dev faucet
: Fund your app with test tokens. Supports--host
and--token
options.
bundle
#
Package your blocklet and its assets into a distributable bundle.
Option | Description |
---|---|
| Bundle using zip mode (default). |
| Bundle using simple mode. |
| Bundle with all dependencies included. |
| Set the depth of dependencies to include (default: 9). |
| Create a source map (compact mode only). |
| Create a source map without including source content (compact mode only). |
| Enable or disable minification in compact mode (default: enabled). |
| Specify external dependencies to exclude from the bundle (comma-separated). |
| Create a release tarball and metadata. |
| Create an archive |
| Indicate that the blocklet is part of a monorepo. |
| Include or exclude |
| Set a default store URL for component dependencies. |
deploy <folder>
#
Deploy a blocklet from a local directory to a running Blocklet Server instance.
Option | Description |
---|---|
| The admin dashboard URL of the target Blocklet Server. |
| The access key for the target server. |
| The access secret for the target server. |
| The app DID to mount the blocklet to (if it's a component). |
| The mount point for the component. |
| Deploy only the files that have changed since the last version. |
version [newVersion]
#
View or update the blocklet's version number in blocklet.yml
.
Option | Description |
---|---|
| Create a git commit after updating the version. |
| Force the version bump. |
upload [metafile]
#
Upload a bundled blocklet to a blocklet store.
Option | Description |
---|---|
| The configuration profile to use (default: |
| The access token for the blocklet store. |
connect <store-url>
#
Configure the CLI to connect and authenticate with a specific blocklet store.
Option | Description |
---|---|
| The configuration profile to use (default: |
add <component>
#
Add a new component dependency to your blocklet.yml
file.
Option | Description |
---|---|
| The configuration profile to use (default: |
| The store from which to fetch the component. |
| A custom title for the component instance. |
| The mount point for the component. |
remove <component>
#
Remove a component dependency from your blocklet.yml
file.
exec <script>
#
Execute a script defined in blocklet.yml
within the blocklet's running context.
Option | Description |
---|---|
| Specify the app context for a component script. |
| The maximum time in seconds for the script to run. |
test
#
Set up and manage a dedicated test environment for your blocklet.
Subcommands
test init
: Initializes a new blocklet for testing. Options include--app-sk
,--owner-sk
,--app-name
.test start
: Starts the blocklet for testing. Requires--app-sk
.test remove
: Deletes the testing blocklet completely. Requires--app-sk
.test reset
: Resets the state of the testing blocklet. Requires--app-sk
.
config
#
Manage the configuration for the Blocklet CLI.
Subcommands
config set [key] [value]
: Set a configuration value.config get [key]
: Get a configuration value.config delete [key]
: Delete a configuration value.config list
: List all configuration values.
meta
#
Print the blocklet metadata from the blocklet.yml
in the current directory.
debug <value>
#
Set a debug environment variable for a blocklet.
Option | Description |
---|---|
| The app context for which to set the debug configuration. |
cleanup
#
Perform cleanup tasks for a blocklet, such as clearing caches or backups.
Option | Description |
---|---|
| The target to clean. Available options: |
| The specific blocklet to clean up. |
document
#
Manage the DID document for a blocklet.
Subcommands
document update <app-id>
: Update the DID document for the specified blocklet.
component [command...]
#
Execute commands from the Component Studio CLI. This acts as a proxy for the Component Studio's own command-line interface.