Used to check for browser translation.
用于检测浏览器翻译。
ブラウザの翻訳を検出する
Command Reference

dev


The blocklet dev command is the cornerstone of the local development workflow. It starts a development environment for your blocklet by installing it into a running Blocklet Server instance, enabling features like hot-reloading and easy debugging. The command streams logs directly to your terminal and automatically cleans up the development instance when you stop the process.

This command significantly simplifies development by managing the entire lifecycle of a temporary blocklet instance. Before using this command, ensure you have a Blocklet Server running. For more details, see our Getting Started guide.

How It Works#

The blocklet dev command automates the install-run-debug-cleanup cycle. The following diagram illustrates the typical sequence of events when you run the command:

Blocklet ServerCLIUserBlocklet ServerCLIUserIf not, install itblocklet devConnect via WebSocketCheck if Blocklet is installedStart Blocklet processConfirm Blocklet startedStream logs to consoleDisplay access URLPress Ctrl+C to stopRemove temporary Blocklet instanceConfirm removalProcess exits

Usage#

blocklet dev [options]

Options#

Option

Description

--app-did <did>

Specifies the DID of the parent application to install the current blocklet into as a component. Essential for developing components. Can also be set via the BLOCKLET_DEV_APP_DID environment variable.

--mount-point <path>

The path where the component will be mounted within the parent application (e.g., /my-component). Can also be set via the BLOCKLET_DEV_MOUNT_POINT environment variable.

--open

Automatically opens the blocklet's URL in your default web browser after it starts successfully.

--store-url <url>

Specifies a Blocklet Store URL to resolve component dependencies from. Overrides the default store.

--start-all-components

When developing a component, this flag ensures all other components within the parent application are also started.

--e2e

Runs the blocklet in end-to-end testing mode.

Scenarios#

Developing a Standalone Blocklet#

For a blocklet that is not a component of another application, simply run the command in the project's root directory.

# Navigate to your blocklet project
cd /path/to/my-blocklet

# Start the development session
blocklet dev --open

Developing a Component Blocklet#

When developing a blocklet that acts as a component for a parent application, you must specify the parent's DID and a mount point.

# Start a development session for a component
blocklet dev --app-did zNKj... --mount-point /my-component --open

This command will install your blocklet at the /my-component path within the application identified by zNKj....

Subcommands#

blocklet dev also includes several subcommands for more granular control over the development lifecycle.

install#

Installs the blocklet in development mode on the Blocklet Server but does not start it. This is useful for pre-setting up an environment.

blocklet dev install

remove#

Removes a blocklet that was previously installed in development mode.

blocklet dev remove

reset#

Resets the data for a blocklet in development. If the blocklet is not installed, it will be installed temporarily, reset, and then removed.

blocklet dev reset

faucet#

Claims test tokens from a faucet for the blocklet's wallet, which is useful for testing features that require tokens. The blocklet must be installed first.

blocklet dev faucet --token <token_symbol_or_address>

studio#

Opens the Blocklet Studio for the application. If the application is not installed, it will be installed first.

blocklet dev studio


After developing and testing your blocklet, the next step is to package it for distribution. To learn more, proceed to the bundle command documentation.