Skip to content

fix: make update --host actually push instead of printing instructions - #36

Merged
abruption merged 1 commit into
mainfrom
fix/27-update-host-push
Sep 8, 2026
Merged

abruption merged 1 commit into
mainfrom
fix/27-update-host-push

Conversation

@abruption

Copy link
Copy Markdown
Owner

Problem

cc-peer update --host web-01 just reports the remote version and tells the user to run ./install.sh --host web-01. But:

  • install.sh might not exist (curl|sh users)
  • ./ is cwd-relative, not a stable path

Fix

Add push_to_remote(host, ssh_opts) — reads own source, base64-encodes it, pipes it as stdin to an SSH command that decodes, writes to the skill directory, and reports the installed version. Same pattern as run_remote() but writes a file instead of running a command.

cmd_update remote path now:

  • --check: report-only, no push (unchanged)
  • Version matches: "already current", no push
  • Version differs or not installed: push_to_remote()

No internet needed on the remote — the file travels over SSH.

Tests

  • test_builds_correct_ssh_command: verifies SSH command structure and version parsing
  • test_validates_host: security check on host argument
  • test_update_host_pushes_when_outdated: push called when version differs
  • test_update_host_skips_when_current: no push when version matches
  • test_update_host_check_reports_only: --check never pushes

Closes #27

update --host told the user to run ./install.sh --host, but
install.sh might not exist (curl|sh users) and ./ is cwd-relative.

Add push_to_remote(): reads own source, base64-encodes it, pipes it
over SSH where a shell one-liner decodes it into the skill directory,
sets the symlink, and reports the installed version. No internet
needed on the remote — the file travels over the SSH connection.

cmd_update now:
- --check: report-only, no push (unchanged)
- version matches: skip with "already current"
- version differs or not installed: push_to_remote()

Closes #27
@abruption
abruption merged commit 270b4ef into main Sep 8, 2026
7 checks passed
@abruption
abruption deleted the fix/27-update-host-push branch September 8, 2026 00:56
@abruption abruption mentioned this pull request Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

update --host tells you to run a script that usually isn't there

1 participant