Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: polish blocklet cli doc #80

Merged
merged 3 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.1.101 (November 14, 2022)

- docs: polish blocklet cli

## 0.1.100 (November 10, 2022)

- docs: Part send notification document content, add code and screenshots
Expand Down
2 changes: 1 addition & 1 deletion developer/docs/blocklet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repository:
type: git
url: git+https://github.com/blocklet/blocklet-site.git
specVersion: 1.2.7
version: 0.1.100
version: 0.1.101
logo: logo.png
files:
- hooks/post-start.js
Expand Down
61 changes: 38 additions & 23 deletions developer/docs/pages/reference/blocklet-cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ layout: documentation
Blocklet CLI provides `blocklet` command-line tool for controlling and administering Blocklets. Use the following syntax to run `blocklet` commands from your terminal:

```bash
blocklet [options] [command]
$ blocklet [options] [command]
```

You can use the `-h` or `--help` to determine the full list of supported commands.
Expand Down Expand Up @@ -36,19 +36,34 @@ $ blocklet create
Develop blocklet from current directory

```bash
blocklet dev
$ blocklet dev

ℹ Try to dev blocklet from xxxxxxxx

ℹ Node DID from config xxxxxx
ℹ Node config from xxxxxx
✔ Installing [email protected]... Done in 0.31s
✔ Blocklet [email protected] was successfully installed

...

✔ Blocklet [email protected] was successfully started

ℹ You can access with the following URL

- http://xxxxxx-xxxxxxxxxxxxxxxxxxxx.did.abtnet.io
```

Open the browser after blocklet had been started

```bash
blocklet dev --open
$ blocklet dev --open
```

Develop blocklet as a component

```bash
blocklet dev --app-id <blocklet-app-id> --mount-point /xxx
$ blocklet dev --app-id <blocklet-app-id> --mount-point /xxx
```

- `blocklet-app-id` can be viewed in the blocklet details page
Expand All @@ -59,7 +74,7 @@ blocklet dev --app-id <blocklet-app-id> --mount-point /xxx
Execute script in blocklet running context

```bash
blocklet exec <script>
$ blocklet exec <script>
```

## Meta
Expand All @@ -77,7 +92,7 @@ $ blocklet meta
Add component to blocklet.yml

```bash
Usage: blocklet add <name> --store <store> --title <title> --mount-point <mount-point>
$ blocklet add <name> --store <store> --title <title> --mount-point <mount-point>
```

- `name`: the id of the component in the store
Expand All @@ -92,7 +107,7 @@ You can see the command to add a component in the component details page of any
Remove component from blocklet.yml

```bash
blocklet remove <name>
$ blocklet remove <name>
```

## Config Blocklet CLI
Expand All @@ -102,36 +117,36 @@ blocklet remove <name>
Manage the configuration for Blocklet CLI

```bash
blocklet config set [key] [value] # Set config value
blocklet config get [key] # Get config value
blocklet config delete [key] # Delete config value
blocklet config list # List config value
$ blocklet config set [key] [value] # Set config value
$ blocklet config get [key] # Get config value
$ blocklet config delete [key] # Delete config value
$ blocklet config list # List config value
```

你可为配置项设置不同的 profile

```bash
blocklet config set key value # set key in default profile
blocklet config set key value1 --profile profile1 # set key in profile1
blocklet config set key value2 --profile profile2 # set key in profile2
$ blocklet config set key value # set key in default profile
$ blocklet config set key value1 --profile profile1 # set key in profile1
$ blocklet config set key value2 --profile profile2 # set key in profile2

blocklet config get key # get key in default prifle
blocklet config get key --profile profile1 # get key in default prifle1
blocklet config get key --profile profile2 # get key in default prifle2
$ blocklet config get key # get key in default prifle
$ blocklet config get key --profile profile1 # get key in default prifle1
$ blocklet config get key --profile profile2 # get key in default prifle2
```

### Connect

Connect to blocklet store. This command will set store configuration by `blocklet config`

```bash
blocklet connect <store-url>
$ blocklet connect <store-url>
```

Set store configuration to specific profile

```bash
blocklet connect <store-url> --profile <profile>
$ blocklet connect <store-url> --profile <profile>
```

After executing the command, the component information will be removed from `blocklet.yml`.
Expand All @@ -149,7 +164,7 @@ $ blocklet version 1.1.0

### Bundle

Packages the Blocklet.
Packages the Blocklet. See the detail in [Blocklet Bundle](/how-to/bundle)

```bash
$ blocklet bundle
Expand Down Expand Up @@ -196,12 +211,12 @@ Components are not automatically added to the navigation when they are deployed
$ blocklet deploy <blocklet-bundle-folder> --app-id xxx --navigation
```

### Upload
### Upload to Store

Upload the blocklet release to store, see the detail in [publish blocklet](../publish)
Upload the blocklet release to store. See the detail in [Publish Blocklet](../publish)

```bash
blocklet upload [options] [metafile]
$ blocklet upload [options] [metafile]
```

## Help
Expand Down
Loading