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 revision #68

Merged
merged 5 commits into from
Oct 5, 2024
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
78 changes: 54 additions & 24 deletions apps/docs/content/references/cli.mdx
Original file line number Diff line number Diff line change
@@ -1,28 +1,38 @@
---
title: zCLI
title: Using zCLI
description: Learn how to install and use zCLI, the powerful command-line tool for interacting with Zerops. Explore zCLI commands, streamline service management, and simplify your workflow from your terminal.
---

import CustomCard from '/src/components/CustomCard';
import Image from '/src/components/Image';

zCLI is the Zerops command-line tool.
## What is zCLI?

## Install zCLI
zCLI is the command-line tool for Zerops that allows users to manage services, simplify interactions, configure infrastructure directly from the terminal.

zCLI can be installed using npm:
## Platforms

zCLI currently supports:

- Linux (x86 & x64)
- macOS (x86-64 & ARM64)
- Windows (x64)

## Get started

To get started, you may install **zCLI** globally using [NPM](https://www.npmjs.com) or [Yarn](https://yarnpkg.com/) package manager:

```sh
npm i -g @zerops/zcli
```

Currently, the zCLI is distributed for Linux (x86 & x64 architecture), macOS (x86-64 & ARM64 architecture) and Windows (x64 architecture).
```sh
yarn global add @zerops/zcli
```

<CustomCard
emoji="🚀"
title="Do you want to manually download the zCli binary?"
>
To download the zCLI directly, use the [latest
↗](https://github.com/zeropsio/zcli/releases) release on GitHub.
<CustomCard emoji="🚀" title="Do you want to manually download the zCli binary?">
To download the zCLI directly, get the [latest
↗](https://github.com/zeropsio/zcli/releases) release from GitHub.
</CustomCard>

### Windows
Expand All @@ -31,49 +41,69 @@ Currently, the zCLI is distributed for Linux (x86 & x64 architecture), macOS (x8
irm https://zerops.io/zcli/install.ps1 | iex
```

This will be added to one of the following directories: `C:\Program Files\`, `C:\Program Files (x86)\` or `C:\Windows\System32\`.
zCLI will be installed inside `C:\Program Files\` or `C:\Program Files (x86)\`

### Linux/MacOS

```sh
curl -L https://zerops.io/zcli/install.sh | sh
```

This will be added to `/usr/bin` or `/usr/local/bin`.
zCLI will be installed inside `/usr/bin` or `/usr/local/bin`.

### NixOS

Note: Make sure `nix-command`& flakes are enabled if not you can also use `--extra-experimental-features 'nix-command flakes'` with `nix`.
:::note
Make sure `nix-command` and flakes are enabled, if not. You can also use `--extra-experimental-features 'nix-command flakes'` with `nix`.
:::

- Clone the [zCLI repository](https://github.com/zeropsio/zcli)
Clone the [zCLI repository](https://github.com/zeropsio/zcli) and build the binary.

```
git clone https://github.com/zeropsio/zcli
```

- `cd zcli` into the root of the cloned repository and run `nix develop`.
- Run `nix build` to build the binary / execuetable of zCli.
- zCLI's binary / execuetable will be present in `./result/bin/zcli`.
```
cd zcli
```

## Create a personal access token
```
nix develop
```

Personal tokens allow you to securely access Zerops using zCLI. You can create one or more personal tokens and manage them in Zerops GUI.
```
nix build
```

You can find zCLI binary inside `result/bin`.

## Personal access tokens

Personal tokens allow you to securely access Zerops directly. You can create one or more personal tokens and manage them in [Zerops GUI](https://app.zerops.io).

To create a new personal access token open your account settings by clicking your avatar in the top right corner and choose **Access token management**. Then create a new access token.
### Managing your access tokens

To create a new personal access token, go to [Access Tokens management](https://app.zerops.io/settings/token-management) and click "Generate a new access token".

<p align="center">
<Image
lightImage="/img/screenshots/access-tokens-light.webp"
darkImage="/img/screenshots/access-tokens-dark.webp"
alt="personal access tokens"
style={{ width: '95%', height: 'auto' }}
style={{ width: '100%', height: 'auto' }}
/>
</p>

## Use the access token to login to zCLI
You may delete an access token anytime.

### Using access tokens

Login to zCLI using following command:
You may use an access token to access Zerops using this command:

```sh
zcli login <token>
```

## References

[zCLI Commands and Usage](/references/cli/commands)
Loading
Loading