Skip to content

Commit

Permalink
Minor changes to the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
xdoardo committed May 14, 2024
1 parent 8781dd3 commit bd58dd6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 64 deletions.
13 changes: 7 additions & 6 deletions pages/edge/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ namely the `wasmer app` subcommand.

## Create

Before deploying an app, one must be created: to this end, the wasmer CLI
provides the `wasmer app create` command.
Before deploying an app, one must be created. The Wasmer CLI allows users to
intentionally create an app, but if a user runs `wasmer app deploy` without an
app available, the app creation process will be triggered.

```shell
$ wasmer app create --help
Create a new Edge app

Usage: wasmer-dev app create [OPTIONS]
Usage: wasmer app create [OPTIONS]

Options:
-t, --type <type>
Expand Down Expand Up @@ -95,11 +96,11 @@ whether it is from templates or pre-existing packages - the command will ask
the user if they want to _deploy_ their app.

## Deploy
To deploy an app to the Wasmer Edge, the user can use the `wasmer app deploy` command.
To deploy an app to the Wasmer Edge, the user can use the `wasmer deploy` command.

<Callout type="info">
**Note:** The `wasmer app deploy` command has a _top level alias_, namely
`wasmer deploy`: running any of the two commands will result in the execution
**Note:** The `wasmer deploy` command is a _top level alias_ of
`wasmer app deploy`: running any of the two commands will result in the execution
of the same program.
</Callout>

Expand Down
82 changes: 24 additions & 58 deletions pages/registry/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,67 +27,42 @@ Commands:

## Publishing a package
Once a [package manifest](/registry/manifest) is ready, the user can publish
the package to the registry. In the Wasmer CLI, publishing a package involves
two steps: _pushing_ the package and _tagging_ it - that is, uploading the
package to the selected registry and giving it a name and a version the user
can use to refer to the package.
the package to the registry. In the Wasmer CLI, publishing a package is an easy
operation that involves just one command: `wasmer publish`.

Both these steps come with a dedicated CLI subcommand - `wasmer package push`
and `wasmer package tag`, in order.

### Pushing a package
Let's start checking out the help message of the `push` subcommand:
```
$ wasmer package push --help
Push a package to the registry. The result of this operation is that the hash
of the package can be used to reference the pushed package.
<Callout type="info">
**Note:** The `wasmer publish` command is a _top level alias_ of
`wasmer package publish`: running any of the two commands will result in the execution
of the same program.
</Callout>

Usage: wasmer package push [OPTIONS] [path]
```shell
$ wasmer package publish
Usage: wasmer package publish [OPTIONS] [path]

Arguments:
[path]
Directory containing the `wasmer.toml`, or a custom *.toml manifest
file. Defaults to current working directory. [default: .]
...
Directory containing the `wasmer.toml`, or a custom *.toml manifest file.

Defaults to current working directory.

[default: .]
```

The (non mandatory) argument this command needs is the path to the directory
containing the manifest of the package. By default, the current working is
searched for a `wasmer.toml`. Once a (valid) manifest is found, the package is
built locally and uploaded to the repository. As a result, the hash of the
uploaded package is shown to the user.

<Callout type="info">
**Note:** While the `push` command is not concerned with the name of the
package, every package still needs an owner and, if not available in the
package's manifest and not given via the `--namespace` flag, users will be
prompted to input the name of the owner of the package to push.
</Callout>

### Tagging the package
The next conceptual step in this flow is that of tagging the package, that is,
assigning a name and a version to the package.
```
λ new wasmer package tag --help
Tag an existing package
Usage: wasmer package tag [OPTIONS] <hash> [path]
Arguments:
<hash>
The hash of the package to tag
...
```
The `tag` command has a mandatory argument: the hash of the package to tag.
The command allows users to provide the relevant informations to tag the package
via command flags (`--name`, `--namespace`, `--version`), but these informations can
be synthesized via the manifest or, if the informations are not given and the program
is running interactively, can be provided via prompts:
built locally and uploaded to the repository. The next conceptual step in this
flow is that of tagging the package, that is, assigning a name and a version to
the package. The command allows users to provide the relevant informations to
tag the package via command flags (`--name`, `--namespace`, `--version`), but
these informations can be synthesized via the manifest or, if the informations
are not given and the program is running interactively, can be provided via
prompts:

```shell
$ wasmer package tag sha256:02a439ea59b023ecedaecf31d3e8fc8fb881fcc00e88b1a25080b37a126f3cb9
✔ Found package in the registry (02a439e)
$ wasmer package publish
...
✔ Choose a package name · my-package
✔ Choose a namespace · edoardo
✔ Enter the package version · 0.1.0
Expand All @@ -97,13 +72,4 @@ $ wasmer package tag sha256:02a439ea59b023ecedaecf31d3e8fc8fb881fcc00e88b1a25080
Once the process is completed, the user can refer to the package using the
`namespace/name@version` format.

### The `publish` command
In a nutshell, the `wasmer package publish` command is equivalent to `wasmer
package push` followed by `wasmer package tag`.

<Callout type="info">
**Note:** The `wasmer package publish` command has a _top level alias_, namely
`wasmer publish`: running any of the two commands will result in the execution
of the same program.
</Callout>

0 comments on commit bd58dd6

Please sign in to comment.