Complete installation and configuration guide for Server Scripts CLI.
- Bash 4.0+: Check version with
bash --version - yq v4+: YAML processor by mikefarah
- systemd: For service status and log querying
- Git: For automatic repository root detection
Snap (Recommended):
sudo snap install yqBinary Download:
VERSION=v4.40.5
BINARY=yq_linux_amd64
wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY} -O yq
chmod +x yq
sudo mv yq /usr/local/bin/Verify:
yq --version
# Expected: yq (https://github.com/mikefarah/yq/) version v4.40.5# Clone repository
git clone https://github.com/fidpa/server-scripts-cli
cd server-scripts-cli
# Make scripts executable
chmod +x ssc.sh generate-manifest.sh
# Create alias in ~/.bashrc
echo "alias ssc='$(pwd)/ssc.sh'" >> ~/.bashrc
source ~/.bashrc
# Test
ssc --version# Install to /usr/local/bin
sudo cp ssc.sh /usr/local/bin/ssc
sudo cp generate-manifest.sh /usr/local/bin/
sudo chmod +x /usr/local/bin/{ssc,generate-manifest.sh}
# Test
ssc --version# Create ~/.local/bin if it doesn't exist
mkdir -p ~/.local/bin
# Symlink
ln -s $(pwd)/ssc.sh ~/.local/bin/ssc
# Ensure ~/.local/bin is in PATH
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
# Test
ssc --versionYour repository should follow this structure:
your-repo/
├── scripts/
│ ├── operations/
│ │ └── backup.sh # Your scripts here
│ ├── monitoring/
│ │ └── health-check.sh
│ └── setup/
│ └── install.sh
├── ssc.sh # CLI tool
├── generate-manifest.sh # Manifest generator
└── manifest.yaml # Auto-generated (DO NOT EDIT)
- Add YAML front-matter to your scripts:
#!/bin/bash
# ---
# deployment: manual
# service: none
# status: active
# type: cli-tool
# requires_root: false
# ---
#
# Your script content- Run generator:
./generate-manifest.sh- Verify:
ssc list
ssc validatessc runs without configuration. Seven environment variables change its
behaviour, all optional, all with a default that matches what ssc does when
you set nothing:
| Variable | Default | Effect |
|---|---|---|
SSC_MANIFEST_FILE |
manifest.yaml in the repository root |
Read the manifest from somewhere else |
SSC_REPO_ROOT |
git rev-parse --show-toplevel, else the directory of ssc.sh |
Resolve script paths against this directory |
SSC_LOG_LEVEL |
info |
debug, info, warning or error; filters the status messages of ssc itself |
SSC_COLOR |
auto |
auto colors when stdout is a terminal, always and never decide for it |
SSC_SYSTEMD_ENABLED |
true |
false makes ssc status and ssc logs return without calling systemctl or journalctl |
SSC_EXEC_TIMEOUT |
0 |
Seconds after which ssc run kills the script, via timeout; 0 disables it |
SSC_STRICT_VALIDATION |
false |
true makes ssc validate check every field against MANIFEST_SCHEMA.md |
The tables that list, info and status print are data, not messages:
SSC_LOG_LEVEL=error silences the commentary around them and leaves the table
itself alone, which is what you want in a pipe. debug goes the other way and
prints the resolved repository root, the resolved manifest and the exact command
behind ssc run to stderr.
export SSC_LOG_LEVEL="debug"
export SSC_COLOR="never"works for a single shell. For something permanent, copy the template:
mkdir -p ~/.config/ssc
cp config/ssc.env.example ~/.config/ssc/ssc.env
chmod 600 ~/.config/ssc/ssc.envssc sources ~/.config/ssc/ssc.env itself at startup, so there is nothing to
add to ~/.bashrc. A variable already set in your environment wins over the
file. Sourcing a file executes it, so ssc skips the file and says so when it
is not owned by you or when group or others can write it; that is what the
chmod 600 above is for.
If your scripts have associated systemd services, use:
# Show all service statuses
ssc status
# Show specific service
ssc status -s backup-example
# Include logs
ssc status -s backup-example -l -n 50# Show systemd timer schedule
ssc status --timers# Show logs for script's service
ssc logs backup-example
# With options (passed to journalctl)
ssc logs backup-example -n 100 --since "1 hour ago"- Edit your scripts (add/modify YAML front-matter)
- Regenerate manifest:
./generate-manifest.sh
- Validate:
ssc validate
Bash completion support:
# Install completion (if available in repo)
sudo cp completions/ssc.bash /etc/bash_completion.d/
source /etc/bash_completion.d/ssc.bashSee TROUBLESHOOTING.md for common issues.
- Read MANIFEST_SCHEMA.md for complete YAML reference
- Check examples/demo-scripts/ for script patterns
- Run
ssc helpfor CLI reference