app
adom-vscode
Public Made by Adomby adom
Drive VS Code from your AI — a CLI + extension that lets Claude Code, Codex, and any other process open files, switch modes, paste screenshots, view live AI session stats, and run any VS Code command via a local HTTP API. Pre-installed in every Adom container.
#!/usr/bin/env bash
# adom-wiki pkg install script for adom-vscode.
#
# This script runs as the regular user — `needs_sudo: false` in package.json,
# matching every other adom-wiki CLI (adom-google, adom-mouser, adom-tts, the
# parts CLIs, etc.). The binary goes into ~/.local/bin so daemon-managed
# updates never need a sudo gate.
#
# The CLI itself (`adom-vscode install`, invoked at the bottom of this script)
# will SELF-ELEVATE to sudo for the one step that truly needs root — patching
# /usr/lib/code-server/lib/vscode/.../workbench.html to install the
# paste-screenshot interceptor that lets users Ctrl+V images into a Claude CLI
# terminal. That patch is idempotent (re-runs return "Browser scripts already
# up to date") so most installs never invoke sudo at all; only the first patch
# (or one that follows a code-server upgrade that overwrote workbench.html, or
# one that follows a PASTE_SCREENSHOT_JS change) actually shells `sudo cp`.
#
# Self-elevation is safe here because adom-vscode is an Adom-container-only
# tool, and Adom containers grant the user passwordless sudo by design.
# Hooking into workbench.html is load-bearing for the Claude CLI image-paste
# UX — and any future browser-side instrumentation we want to add into
# code-server's main HTML load — so we keep it explicit rather than degrade.
set -euo pipefail
HERE="$(cd "$(dirname "$0")" && pwd)"
BIN_SRC="$HERE/bin/adom-vscode"
BIN_DST="${HOME}/.local/bin/adom-vscode"
if [ ! -f "$BIN_SRC" ]; then
echo "ERROR: $BIN_SRC missing from package payload" >&2
exit 1
fi
mkdir -p "$(dirname "$BIN_DST")"
install -m 0755 "$BIN_SRC" "$BIN_DST"
echo "Installed adom-vscode -> $BIN_DST"
case ":${PATH}:" in
*":${HOME}/.local/bin:"*) ;;
*) echo "Note: $HOME/.local/bin is not on PATH. Add: export PATH=\"\$HOME/.local/bin:\$PATH\"" ;;
esac
# The CLI handles the rest, including self-elevating to sudo for the
# workbench.html patch (see inject_browser_scripts in cli/src/main.rs).
"$BIN_DST" install