app
service-kicad
Public Made by Adomby adom
Shared headless KiCad 10: DRC, ERC, SVG/Gerber/STEP export, Altium library conversion, symbol/footprint/3D-model lookup. Every Adom tool shells to this CLI instead of calling the HTTP API directly.
#!/bin/bash
# adom-wiki package install script. Runs from the extracted tarball dir.
# The CLI binary is a RELEASE asset (per wiki doctrine, binaries never
# ride the install tarball) — declared as install.binary_name in
# package.json; if the harness hasn't already placed it next to us,
# fetch it explicitly. v1.0.1's script only copied the skill, so
# `pkg install` delivered no binary at all — everything the consumer
# keeps must be installed out of here.
set -e
PKG_DIR="$(cd "$(dirname "$0")" && pwd)"
VERSION="$(sed -n 's/.*"version": *"\([^"]*\)".*/\1/p' "$PKG_DIR/package.json" | head -1)"
# 1. CLI binary → ~/.local/bin (on PATH for Adom containers, no sudo).
BIN_DIR="$HOME/.local/bin"
mkdir -p "$BIN_DIR"
if [ ! -f "$PKG_DIR/service-kicad" ]; then
adom-wiki release download adom/service-kicad "$VERSION" --platform linux --out "$PKG_DIR" >/dev/null
fi
if [ -f "$PKG_DIR/service-kicad" ]; then
install -m 0755 "$PKG_DIR/service-kicad" "$BIN_DIR/service-kicad"
echo "✓ CLI → $BIN_DIR/service-kicad"
else
echo "! could not obtain service-kicad binary (release asset missing?) — CLI not installed" >&2
exit 1
fi
# 2. Skill(s) → ~/.claude/skills/
SKILLS_DIR="$HOME/.claude/skills"
mkdir -p "$SKILLS_DIR/service-kicad"
if [ -f "$PKG_DIR/SKILL.md" ]; then
cp "$PKG_DIR/SKILL.md" "$SKILLS_DIR/service-kicad/SKILL.md"
echo "✓ skill → $SKILLS_DIR/service-kicad/SKILL.md"
fi
for skill_dir in "$PKG_DIR/skills"/*/; do
[ -d "$skill_dir" ] || continue
skill_name=$(basename "$skill_dir")
mkdir -p "$SKILLS_DIR/$skill_name"
cp -r "$skill_dir"* "$SKILLS_DIR/$skill_name/"
done
# 3. Bash completions (binary writes them; skill already installed above).
"$BIN_DIR/service-kicad" install --completions-only 2>/dev/null || true
echo "Installed service-kicad — verify with: service-kicad health"