Cased CLI
About
cased-cli is an open source SSH client that brings the power of Cased to everyone's local terminal.
Table of contents
Installation
Linux, MacOS and WSL systems
cased-cli
can be installed using the go
tool, but since cased-cli
is currently in a GitHub private repository, the following steps are required to get it properly installed:
Example ~/.netrc file:
$ nano ~/.netrc
machine github.com
login your_github_username
password your_github_access_token
The login value should be your GitHub username.
The password value should be the GitHub personal access token you created.
Finally, run the following command to get cased-cli
installed on your local machine: GOPRIVATE=github.com/cased/cased-cli go install github.com/cased/cased-cli@latest
Manually cloning and building the project
- Clone cased-cli repository:
git clone https://github.com/cased/cased-cli
- Build the program:
Working on cased-cli using GitHub codespaces
To get cased-cli
installed in a codespace enviroment, just run the following command: GOPRIVATE=github.com go install github.com/cased/cased-cli@latest
Usage
- Run
$ cased-cli auth instance.domain
, where instance.domain is the domain name where cased-shell was installed and running. Following is a sample authentication using an cased-shell instance running in a GitHub codespaces used only demonstration purposes.
- A web browser should popup asking the user to fill in login credentials:
- If authentication is successful, a message will be displayed in the web browser, the user can close the web-browser/tab and back to the terminal:
- After a successfull authentication,
cased-cli
displays a list of available prompts in the terminal. Following is a list from this demo setup:
- Users can navigate the list using up/down arrow key.
- A '/' key triggers the search, which allows users to filter prompts by name/description.
- Pressing 'q' will exit the program.
- Finally, pressing <ENTER> will connect to the currently selected prompt in the list:
- When connected to a prompt, the user can interact with it as usual, running
exit
command should get the user back to the prompts screen.
- Pressing '/' during a SSH session will trigger the snippets screen
- If the web browser fails to open, users will be provided with a unique URL where they can try to authenticate manually.
Local Development
cased-cli
currently supports the following enviroment variables to allow for local development/testing:
Variable |
Format |
Description |
CASED_SERVER |
host:port |
Specify the network address where cased-server is listening. Default port is 6565. |
CASED_SERVER_API |
https://host:port |
Specify the address where cased-server API is listening. Default is https://IP:6566. |
TLS_SKIP_VERIFY |
true|false |
When developing locally, a self-signed TLS certificate is used, to allow cased-cli to work set TLS_SKIP_VERIFY=true |
- Example (on Linux/Bash), assuming
cased-server
is running on the same machine as cased-cli
:
$ export CASED_SERVER=localhost:6565
$ export CASED_SERVER_API=https://localhost:6566
$ export TLS_SKIP_VERIFY=true
$ ./cased-cli auth <domain>
Snippets
- Type
/
during a SSH session (it must be the first character in the command line)
- A screen similar to the one bellow should be displayed (if snippets are available):
- The snippets are organized in categories, each category has its own tab.
- To navigate between snippet categories use the left and right arrows in the keyboard.
- To search for a snippet press the '/' key, pressing <ESC> will get back to the previous screen.
- Pressing 'q' will exit the snippets screen and get user back to the shell.
- Press UP/Down keys to navigate between snippets in the current selected tab/category.
- Press <ENTER> to select a snippet, in the next screen the user can edit the snippet arguments, press <ENTER> again to submit, or use the [Submit] button. Press <ESC> to get back to the previous menu.
Contributing / Reporting issues
Creating a release
git tag -a v0.0.1
git push origin v0.0.1
License
Apache License, Version 2.0
About Cased
More information is available at www.cased.com.