Skip to content

Commit

Permalink
docs: cli commands
Browse files Browse the repository at this point in the history
  • Loading branch information
wkillerud committed Aug 5, 2024
1 parent 77eae12 commit 5d31f5b
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/dependencies/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
78 changes: 77 additions & 1 deletion docs/reference/at-eik-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 <name> <version> <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.
Expand Down Expand Up @@ -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 <name>
```

### 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.
Expand Down Expand Up @@ -255,3 +329,5 @@ const result = await cli.version({
files,
});
```

[`eik.json`]: /docs/reference/eik-json/

0 comments on commit 5d31f5b

Please sign in to comment.