Installing the CipherStash CLI
The CipherStash CLI is the primary way you’ll interact with CipherStash. It allows you to login to a workspace, manage collections, and so on.
In order to install CipherStash CLI, you must have a Linux or macOS computer (or virtual machine) on which you can install software. Windows is not officially supported at this time, although you may have some success with WSL2.
Step 1: Install Dependencies
The CipherStash CLI requires these dependencies:
- Node.js version 16 or higher
- OpenSSL
- Rust compiler and build tools (at least 1.59, and nightly if you are on ARM)
⚠️ If you are confident installing these yourself, you can skip ahead.
Otherwise, please follow the instructions for installing the dependencies on your relevant platform:
Installing Dependencies on macOS
Installing the dependencies using Homebrew:
brew install openssl node@16 rust
If you are running macOS on Apple Silicon, you’ll need to install the nightly version of Rust, so cryptography works.
rustup default nightly
rustup update nightly
You will also need the Xcode command line tools which you can install by running:
xcode-select --install
Dependency: Configuring Node.js v16 on macOS
Once you have the Node.js v16 installed, you need to configure npm so CipherStash CLI dependencies using Rust can install correctly:
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH="~/.npm-global/bin:$PATH"' >> ~/.profile
source ~/.profile
Installing Dependencies on Linux
Specific steps will depend on your distribution.
Installing the build dependencies is typically a matter of asking your package manager nicely. For instance, on Fedora/Centos/Redhat:
sudo dnf install openssl-devel gmp-devel curl make automake gcc
Meanwhile, over in Debian/Ubuntu land:
sudo apt install build-essential curl libssl-dev
Dependency: Installing Node.js v16 on Linux
Installing Node.js is a slightly more involved proposition. Most Linux distributions don’t ship Node.js v16 or higher. We recommend following the official Node.js documentation to get Node.js v16 installed.
If you are running Ubuntu, you can run:
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
Once you have the Node.js v16 installed, you need to configure npm so CipherStash CLI dependencies using Rust can install correctly:
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH="~/.npm-global/bin:$PATH"' >> ~/.profile
source ~/.profile
Dependency: Installing Rust on Linux
Lastly, you’ll need a Rust toolchain to build the cryptography inside the CipherStash CLI.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
If you’re running Linux on ARM, you’ll need to use Rust nightly, so cryptography works:
rustup default nightly
rustup update nightly
Step 2: Install the CipherStash CLI
We’re on the home stretch now.
To install the CipherStash CLI, you can use the Node.js package manager, npm
, to install the stash
command:
npm install -g @cipherstash/stash-cli
Step 3: Login to CipherStash
Exciting times, we’re ready to get an access token and connect to CipherStash!
With the ID of the workspace that you found earlier in hand, run this command:
stash login --workspace <workspaceID>
This command will prompt you to visit an authentication URL under auth.cipherstash.com
.
You might have to login again, if you haven’t visited the Console in a while.
Once logged in, you should be presented with a page that looks like this:
Click the “Confirm” button to approve the creation of your access token.
Congratulations!
You are now logged into CipherStash in your local development environment. The next thing to do is to create your first collection of records.