| Crates.io | devops-cli |
| lib.rs | devops-cli |
| version | 0.2.1 |
| created_at | 2025-08-18 12:52:32.646499+00 |
| updated_at | 2025-08-26 07:49:52.601082+00 |
| description | devops cli tools |
| homepage | https://github.com/denfren/devops-cli |
| repository | https://github.com/denfren/devops-cli.git |
| max_upload_size | |
| id | 1800428 |
| size | 139,069 |
A suite of cli tools for DevOps
See config for an introduction to configuration and example for typical configuration.
Homebrew
brew install denfren/tap/devops-cli
from source
cargo install devops-cli
dssh spawns ssh sessions by querying for EC2 instances. It can also be used to invoke arbitrary commands using
information from the instances.
dssh [--profile <profile>] [<query>...] query EC2 instances and spawn ssh session
query limits the instance selection. When only one instance matches the command executes immediatelyQuery words can have three forms
i-... will only be matched against the aws instance idGiven three instances
www_server-fra-i-122222-01sql_db_server-dus-i-133333-01sql_db_server-dus-i-144444-02Then running...
dssh ww immediately connects to the www_server (single result)dssh db shows a list of the db servers to pick one to connect to (multiple results)dssh db 2 finds the instance whose name contains both db and the cluster instance is 2, despite the first
instance having a literal 2 in its name (single result)dssh i-13 connects to sql db 01, because its instance id starts with i-13AWS_PROFILEDSSH_LOG (default: "warn"): configure log levelDSSH_TEMPLATE_DISPLAY (string): template to use to display instances in the selection dialog. Supports Jinja2
templating with instance dataDSSH_TEMPLATE_COMMAND (json, a list of strings): command template to execute for single instance selections.
Defaults to "ssh", "{{ private_ip }}", example: ["ssh", "admin@{{ private_dns }}", "-p", "2222"]DSSH_TEMPLATE_MULTICOMMAND (json, a list of strings): command template to execute when multiple instances are
selected. Defaults to the value of the DSSH_TEMPLATE_COMMANDDSSH_TUNNELBLICK_CONNECTION: A name of a tunnelblick connection to check if it is connected.Fields available in the template context (instance details)
dvpn, dvpn --profile <profile> connects to the VPN.
dvpn -d, dvpn --disconnect disconnects all VPNs.
DVPN_LOG (default: "warn"): configure log levelDVPN_TUNNELBLICK_CONNECTION: the name of the connection in tunnelblickThe cli commands are configured using environment variables. To simplify configuration, values can be specified in env
files at the following locations:
$XDG_CONFIG_HOME/dcli/*.env$HOME/.dcli/*.envWhen running commands, a "profile" can be specified using -p/--profile <profile-name>. This affects which env files
are loaded. In the order listed below, values are loaded:
<profile>.env is loaded. Otherwise default.env is loaded.<tool-name>.env is loaded and can be used to provide tool-specific configuration used across all profiles.global.env can be used to configure across all profiles and all tools.Values that are the empty are considered to be unset. This allows overriding values to remove a setting.
"yes", "true", "1", "on", "enable", "enabled""no", "false", "0", "off", "disable", "disabled"Typical configuration
$HOME/.dcli/staging.env and $HOME/.dcli/prod.env
AWS_PROFILE=my-role-name
DVPN_TUNNELBLICK_CONFIG=my-tunnelblick-config-name
Use staging by default
Simply symlink default.env to staging.env:
ln -s $HOME/.dcli/staging.env $HOME/.dcli/default.env
Let dssh check VPN configured for dvpn
use global.env to let DSSH use DVPN's value by default:
DSSH_TUNNELBLICK_CONNECTION=${DVPN_TUNNELBLICK_CONNECTION}