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

WIP - docs(cli): add completions commands #4819

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
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
67 changes: 66 additions & 1 deletion docs/content/references/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,70 @@ The six most useful commands to users are the following:
- **[IOTA Validator CLI](./cli/validator.mdx):** Use the `iota validator` command to access tools useful for IOTA validators.
- **[IOTA Genesis Ceremony CLI](./cli/ceremony.mdx):** Use the `iota ceremony` command to build a genesis blob.


Use the `help` flag for the commands that are not documented yet. For example, `iota validator --help`.

## IOTA CLI Completion

Completion files can be generated per shell when using the `gen-completions` feature.

```sh
cargo install --locked --git https://github.com/iotaledger/iota.git --branch <BRANCH-NAME> --features gen-completions
```

<Tabs groupId="shell">

<TabItem label="Bash" value="bash">

```sh
iota generate-completions --shell bash > ~/.iota/completion.bash
echo "source ~/.iota/completion.bash" >> ~/.bashrc
```

</TabItem>

<TabItem label="Elvish" value="elvish">

TODO

```sh
iota generate-completions --shell elvish
```

</TabItem>

<TabItem label="Fish" value="fish">

```sh
iota generate-completions --shell fish > iota.fish
mv iota.fish ~/.config/fish/completions
```

</TabItem>

<TabItem label="Powershell" value="powershell">

TODO

```sh
iota generate-completions --shell powershell
```

</TabItem>

<TabItem label="Zsh" value="zsh">

In order to use zsh completions, you must first install [Oh My Zsh](https://github.com/ohmyzsh/ohmyzsh#basic-installation).

Then, install [zsh-autocomplete](https://github.com/marlonrichert/zsh-autocomplete?tab=readme-ov-file#installation--setup).

Finally, you can generate the completions file and install it.

```sh
iota generate-completions --shell zsh -o ~/.oh-my-zsh/completions
```

To see the completions, restart the terminal session.

</TabItem>

</Tabs>
Loading