From 5d31f5b469b9b6bb1191ce082fa11371560611cb Mon Sep 17 00:00:00 2001 From: William Killerud Date: Mon, 5 Aug 2024 12:26:31 +0200 Subject: [PATCH] docs: cli commands --- docs/dependencies/introduction.md | 2 +- docs/reference/at-eik-cli.md | 78 ++++++++++++++++++++++++++++++- 2 files changed, 78 insertions(+), 2 deletions(-) diff --git a/docs/dependencies/introduction.md b/docs/dependencies/introduction.md index 24f80b8..e83693b 100644 --- a/docs/dependencies/introduction.md +++ b/docs/dependencies/introduction.md @@ -18,7 +18,7 @@ It's worth mentioning at this stage that Eik differentiates between three types - `map` - `package` -You'll see this distinction in `eik.json` and in the URL where your package gets published. Each package type has its own namespace. This is to avoid accidental naming collisions between, say, the `npm` module `lit` and the import map `lit`. +You'll see this distinction in [`eik.json`](/docs/reference/eik-json/) and in the URL where your package gets published. Each package type has its own namespace. This is to avoid accidental naming collisions between, say, the `npm` module `lit` and the import map `lit`. Application code should be published to the `package` namespace. This is also the default, if no other type is configured in `eik.json`. diff --git a/docs/reference/at-eik-cli.md b/docs/reference/at-eik-cli.md index eff9260..d51f9fc 100644 --- a/docs/reference/at-eik-cli.md +++ b/docs/reference/at-eik-cli.md @@ -84,7 +84,7 @@ npx @eik/cli --help ## Available commands -Run `eik` with `--help` to see a description of all available commands in your shell. +Run `eik` with `--help` to see a description of all available commands and their aliases in your shell. ```sh eik --help @@ -96,6 +96,34 @@ You can also get help for each individual command the same way. eik init --help ``` +### alias + +Create or update an [alias for a package, npm package or import map](/docs/dependencies/aliases/) as identified by its name and version. + +A package with the given name and version must already exist on the Eik server. The alias should be the semver major part of the package version. Eg. for a package of version 5.4.3, you should use 5 as the alias. The alias type (npm, map, package) is detected from `eik.json` in the current working directory. + +```sh +eik alias +``` + +Replaces `package-alias`, `map-alias` and `npm-alias` from version `3.0.0` onward. + +### init + +Creates a new default [`eik.json`] and saves it to the current working directory. + +```sh +eik init +``` + +### integrity + +Retrieve file integrity information for package name and version defined in [`eik.json`], then populate `integrity.json` file with this information [for use in subresource integrity](/docs/introduction/workflow#linking-to-your-assets-from-html). + +```sh +eik integrity [name] [version] +``` + ### login Write operations require you to be logged in to the Eik server. To log in, run the `login` command. @@ -144,6 +172,52 @@ _N.B._ If the client is authenticated with more than one server, it may be neces eik publish --server https://eik.store.com ``` +### map-alias + +See [alias](#alias) + +### meta + +Retrieve meta information by package, map or npm name. + +If a given name exists in several types (package and map for example), results will be returned and displayed from all matching types. + +```sh +eik meta +``` + +### npm-alias + +See [alias](#alias) + +### package-alias + +See [alias](#alias) + +### ping + +Ping an Eik server to check that it is responding. + +```sh +eik ping [server] +``` + +### publish + +Publish a package to an Eik server. Reads configuration from [`eik.json`] or `package.json`. + +```sh +eik publish +``` + +### version + +Compares local files with files on server and increments the `"version"` field in [`eik.json`] if necessary. + +```sh +eik version [level] +``` + ## Programatic usage If you need to script commands from the Eik CLI, consider importing `@eik/cli` in JavaScript. @@ -255,3 +329,5 @@ const result = await cli.version({ files, }); ``` + +[`eik.json`]: /docs/reference/eik-json/