Skip to content

Commit ae401ce

Browse files
Merge pull request #541 from oasisprotocol/uniyalabhishek/537-improve-oasis-cli-doc-mac
docs: Add setup documentation for Oasis CLI for all platforms
2 parents 400e6bc + 062c849 commit ae401ce

5 files changed

Lines changed: 158 additions & 86 deletions

File tree

.markdownlint.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,12 @@ link-fragments: false
2727
# Do not always require language specifiers with fenced code blocks since they
2828
# are not part of the Markdown spec.
2929
fenced-code-language: false
30+
31+
# Allow inline HTML for MDX tab components.
32+
no-inline-html:
33+
allowed_elements:
34+
- Tabs
35+
- TabItem
36+
37+
# MDX files often start with imports, so disable first-line heading rule.
38+
first-line-heading: false

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ lint-git:
5252

5353
lint-docs:
5454
@$(PRINT) "$(CYAN)*** Running markdownlint-cli...$(OFF)\n"
55-
@npx --yes markdownlint-cli '**/*.md'
55+
@npx --yes markdownlint-cli '**/*.md?(x)'
5656

5757
lint-go-mod-tidy:
5858
@$(PRINT) "$(CYAN)*** Checking go mod tidy...$(OFF)\n"

docs/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ description: Powerful CLI for managing Oasis networks, nodes, tokens and dApps
66
# Oasis Command Line Interface
77

88
Oasis command-line interface (CLI) is a powerful all-in-one tool for
9-
interacting with the Oasis Network. You can download the latest release
10-
binaries from the [GitHub repository].
9+
interacting with the Oasis Network.
10+
Head to the **[installation instructions]** to download and install it!
11+
12+
[installation instructions]: setup.mdx
1113

1214
It boasts a number of handy features:
1315

@@ -19,8 +21,8 @@ It boasts a number of handy features:
1921
- connecting to remote (via TCP/IP) or local (Unix socket) Oasis node
2022
instance
2123
- Powerful wallet features:
22-
- standard token operations (transfers, allowances, deposits, withdrawals and
23-
balance queries)
24+
- standard token operations (transfers, allowances, deposits, withdrawals
25+
and balance queries)
2426
- file-based wallet with password protection
2527
- full Ledger hardware wallet support
2628
- address book
@@ -32,7 +34,7 @@ It boasts a number of handy features:
3234
schemes
3335
- raw, BIP-44, ADR-8 and Ledger's legacy derivation paths
3436
- Node operator features:
35-
- Oasis node inspection and healthchecks
37+
- Oasis node inspection and health-checks
3638
- network governance transactions
3739
- staking reward schedule transactions
3840
- Developer features:
@@ -43,5 +45,4 @@ It boasts a number of handy features:
4345
calls
4446
- debugging tools for deployed Wasm contracts
4547
- inspection of blocks, transactions, results and events
46-
47-
[GitHub repository]: https://github.com/oasisprotocol/cli/releases
48+

docs/setup.md

Lines changed: 0 additions & 78 deletions
This file was deleted.

docs/setup.mdx

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
import Tabs from '@theme/Tabs';
2+
import TabItem from '@theme/TabItem';
3+
4+
# Setup
5+
6+
## Download and Run
7+
8+
The Oasis team provides CLI binaries for Linux,
9+
macOS and Windows operating systems.
10+
If you want to run it on another platform,
11+
you can [build the CLI from source][cli-source].
12+
13+
Download the latest release from our [GitHub repository][cli-releases] and
14+
follow the instructions for **your platform** below:
15+
16+
<Tabs>
17+
<TabItem value="Linux" label="Linux">
18+
#### Prerequisites
19+
20+
- amd64 or arm64 Linux.
21+
- Ensure `~/.local/bin` is on your `PATH`:
22+
```shell
23+
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
24+
source ~/.bashrc
25+
mkdir -p ~/.local/bin
26+
```
27+
28+
#### Installation
29+
30+
1. Download the latest **Linux** archive (e.g. `oasis_cli_X.Y.Z_linux_amd64.tar.gz`).
31+
2. Extract it:
32+
```shell
33+
cd ~/Downloads
34+
tar -xzf oasis_cli_X.Y.Z_linux_amd64.tar.gz # adjust version and architecture
35+
```
36+
3. Move the binary to your path:
37+
```shell
38+
mv oasis ~/.local/bin/
39+
```
40+
4. Verify:
41+
```shell
42+
oasis --version
43+
```
44+
</TabItem>
45+
46+
<TabItem value="macOS" label="macOS">
47+
#### Prerequisites
48+
49+
- macOS (Apple Silicon & Intel).
50+
- Ensure `~/.local/bin` is on your `PATH` (add it in `~/.zshrc` or `~/.bashrc`):
51+
```shell
52+
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
53+
source ~/.zshrc
54+
mkdir -p ~/.local/bin
55+
```
56+
57+
#### Installation
58+
59+
1. Download the latest **macOS** archive (e.g. `oasis_cli_X.Y.Z_darwin_all.tar.gz`) from the releases page.
60+
2. Extract it:
61+
```shell
62+
cd ~/Downloads
63+
tar -xzf oasis_cli_X.Y.Z_darwin_all.tar.gz # adjust version
64+
```
65+
3. Move the binary to your path:
66+
```shell
67+
mv oasis ~/.local/bin/
68+
```
69+
4. Bypass Gatekeeper (first run only):
70+
```shell
71+
xattr -d com.apple.quarantine ~/.local/bin/oasis
72+
```
73+
If a dialog appears, open **System Settings → Privacy & Security** and click **Open Anyway**.
74+
5. Verify:
75+
```shell
76+
oasis --version
77+
```
78+
</TabItem>
79+
80+
<TabItem value="Windows" label="Windows">
81+
#### Prerequisites
82+
83+
- Windows 10/11 (x86-64).
84+
- Decide on a folder already in your `PATH` (e.g. `%USERPROFILE%\bin`) or add one.
85+
86+
#### Installation
87+
88+
1. Download the latest **Windows** ZIP file (e.g. `oasis_cli_X.Y.Z_windows_amd64.zip`).
89+
2. Extract it (double-click or `tar -xf` in PowerShell).
90+
3. Copy `oasis.exe` to a directory on your `PATH`, for example:
91+
```powershell
92+
New-Item -ItemType Directory -Force "$env:USERPROFILE\bin"
93+
Copy-Item .\oasis.exe "$env:USERPROFILE\bin\"
94+
```
95+
If that folder isn’t on the `PATH`, add it via **System Properties → Environment Variables**.
96+
4. Verify:
97+
```powershell
98+
oasis --version
99+
```
100+
</TabItem>
101+
</Tabs>
102+
103+
When running the Oasis CLI for the first time, it will generate a configuration
104+
file and populate it with the current Mainnet and Testnet networks. It will also
105+
configure all [ParaTimes supported by the Oasis Foundation][paratimes].
106+
107+
## Configuration
108+
109+
The configuration folder of Oasis CLI is located:
110+
111+
- on Linux:
112+
- `$HOME/.config/oasis/`
113+
- on macOS:
114+
- `/Users/$USER/Library/Application Support/oasis/`
115+
- on Windows:
116+
- `%USERPROFILE%\AppData\Local\oasis\`
117+
118+
There, you will find `cli.toml` which contains the configuration of the
119+
networks, ParaTimes and your wallet. Additionally, each file-based account in
120+
your wallet will have a separate, password-encrypted JSON file in the same
121+
folder named after the name of the account with the `.wallet` extension.
122+
123+
## Multiple Profiles
124+
125+
You can utilize multiple profiles of your Oasis CLI by
126+
passing the `--config` parameter
127+
with a location of a desired `cli.toml`:
128+
129+
![code shell](../examples/setup/wallet-list-config.in.static)
130+
131+
![code](../examples/setup/wallet-list-config.out.static)
132+
133+
## Back Up Your Wallet
134+
135+
To back up your complete Oasis CLI configuration including your wallet, archive
136+
the configuration folder containing `cli.toml` and `.wallet` files.
137+
138+
[cli-releases]: https://github.com/oasisprotocol/cli/releases
139+
[cli-source]: https://github.com/oasisprotocol/cli
140+
[paratimes]: https://github.com/oasisprotocol/docs/blob/main/docs/build/tools/other-paratimes/README.mdx

0 commit comments

Comments
 (0)