Environment:0xNyk Council of high intelligence Bash
| Knowledge Sources | |
|---|---|
| Domains | Infrastructure, Scripting |
| Last Updated | 2026-10-20 00:00 GMT |
Overview
POSIX-compatible Bash shell (4.0+) with `set -euo pipefail` discipline for running the provider detection, installer, and CI validation scripts.
Description
The Bash environment provides the shell runtime for three critical scripts in the Council of High Intelligence: `scripts/detect-providers.sh` (LLM provider auto-detection), `install.sh` (multi-host skill installer), and `scripts/council-simulation-checklist.sh` (CI validation gate). All three scripts use `set -euo pipefail` for strict error handling — fail on error, fail on undefined variables, and fail on pipe failure.
The `detect-providers.sh` script additionally uses a macOS-compatible timeout implementation via `perl` (avoiding the `coreutils` `timeout` dependency), `command -v` for binary detection, and process substitution (`-H @<(…)`) for secure API key passing. The `council-simulation-checklist.sh` script uses `grep -q` for protocol feature parity checks and `compgen -G` for glob expansion.
Usage
Use this environment for:
- Provider detection — `detect-providers.sh` must run under Bash to detect installed LLM provider CLIs
- Installation — `install.sh` installs the skill into Claude/Codex/Gemini/opencode config directories
- CI validation — `council-simulation-checklist.sh` validates protocol parity across all SKILL mirror files
It is the mandatory prerequisite for the detect_providers_sh, install_sh, and council_simulation_checklist_sh implementations.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | Linux, macOS, or WSL2 | Bash is standard on all three |
| Shell | Bash 4.0+ | Uses `shopt -s nullglob`, associative-style arrays, `compgen -G` |
| Disk | < 1 MB | Scripts only |
| Optional | `perl` | Required on macOS for timeout emulation in detect-providers.sh |
Dependencies
System Packages
- `bash` >= 4.0
- `perl` — macOS timeout emulation in `detect-providers.sh`
- `grep` — used by `council-simulation-checklist.sh` for parity checks
- `sed` — version extraction from CHANGELOG.md
- `awk` — model list parsing in `detect-providers.sh`
Optional Packages (for full CI checks)
- `shellcheck` — lint validation of `install.sh` (skipped with warning if absent)
- `curl` — NIM endpoint reachability check in `detect-providers.sh`
- `jq` — JSON parsing for OpenAI-compatible API dispatch
- `python3` — invoked by `install.sh` for opencode agent conversion
Credentials
No credentials are required for the Bash environment itself. The scripts running within it may consume:
- `NVIDIA_API_KEY` — checked by `detect-providers.sh` for NIM provider availability (must start with `nvapi-`)
Quick Install
# Run the provider detection script
bash scripts/detect-providers.sh
# Run the full CI validation checklist
./scripts/council-simulation-checklist.sh
# Install the skill (dry-run first to verify)
./install.sh --dry-run
./install.sh
Code Evidence
Strict error handling — all three scripts use `set -euo pipefail`. From `scripts/detect-providers.sh:L1-2`:
#!/usr/bin/env bash
set -euo pipefail
Same pattern in `install.sh:L1-2` and `scripts/council-simulation-checklist.sh:L1-2`.
macOS-compatible timeout via Perl from `scripts/detect-providers.sh:L23-38`:
# macOS-compatible timeout using perl (no coreutils required)
run_with_timeout() {
perl -e '
use POSIX ":sys_wait_h";
my $timeout = shift @ARGV;
my $pid = fork();
if ($pid == 0) { exec @ARGV; exit 1; }
my $elapsed = 0;
while ($elapsed < $timeout) {
if (waitpid($pid, WNOHANG) > 0) { exit ($? >> 8); }
select(undef, undef, undef, 0.1);
$elapsed += 0.1;
}
kill("TERM", $pid);
waitpid($pid, 0);
exit 124;
' "$TIMEOUT_SECONDS" "$@" 2>/dev/null
}
Secure API key handling via process substitution from `scripts/detect-providers.sh:L106-108`:
# The auth header is passed via process substitution so the key never
# appears in curl's argv (visible to other local users via `ps`).
if run_with_timeout curl -sf -o /dev/null \
-H @<(printf 'Authorization: Bearer %s\n' "${NVIDIA_API_KEY}") \
"${nim_endpoint}/models" 2>/dev/null; then
Grep-based parity checks from `scripts/council-simulation-checklist.sh:L163-168`:
for skill_file in SKILL.md SKILL.codex.md SKILL.gemini.md; do
grep -q "STANCE:" "${skill_file}" || fail "Structured STANCE line missing in ${skill_file} (PR #36)"
grep -q "Vote Tally" "${skill_file}" || fail "Vote Tally verdict field missing in ${skill_file} (PR #36)"
grep -q "1\.5" "${skill_file}" || fail "1.5x domain-weight seat missing in ${skill_file} (PR #36)"
grep -q "2/3" "${skill_file}" || fail "2/3 consensus threshold missing in ${skill_file} (PR #36)"
done
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| `detect-providers.sh exited with error` | Script failed under `set -e` | Run `bash -x scripts/detect-providers.sh` to trace; check `perl` availability on macOS |
| `SKILL.md is missing` | Checklist run from wrong directory | Run from repo root: `cd /path/to/repo && ./scripts/council-simulation-checklist.sh` |
| `Version drift: CHANGELOG=… plugin.json=…` | Manifest versions not bumped on release | Update version in `.claude-plugin/plugin.json` and `.claude-plugin/marketplace.json` to match `CHANGELOG.md` |
| `shellcheck not installed; skipped` | shellcheck absent on system | Install `shellcheck` for full lint coverage (warning only, not a failure) |
| `Anti-conformity directive missing from one or more Round 2 prompts` | Protocol feature dropped from a SKILL mirror during editing | Re-add the Anti-conformity directive to all 3 Round 2 prompts in the affected SKILL file |
Compatibility Notes
- Linux: Full support — `bash`, `perl`, `grep`, `sed`, `awk` all standard.
- macOS: Full support — uses Perl-based timeout emulation instead of `coreutils timeout`. No Homebrew dependencies required.
- Windows (Git Bash): May work for `install.sh` and `detect-providers.sh`, but `council-simulation-checklist.sh` expects Unix paths. Use WSL2 for CI validation.
- sh/dash: Not compatible — scripts use Bash 4.0+ features (`shopt -s nullglob`, `compgen -G`, `${BASH_SOURCE[0]}`).