doc clean

This commit is contained in:
ari committed 2026-10-09 14:35:12 -04:00
1 parent c2a7f94821
commit 30427e3975
34 files changed
+1119 -1758

No files matched your search

+3 -23
View File
@@ -1,12 +1,5 @@
# hermenix ctl — drive Hermes inside the guest.
#
# Identity, config, secrets, gateway service, and a passthrough to the
# hermes CLI itself. For controlling the VM around it, see vm/vm.nu.
#
# Depends on: lib/common.nu, lib/guest.nu (ssh-args).
def home-dir [] {
$env.HERMES_HOME_DIR? | default "/var/lib/hermes-vm/.hermes"
$env.HERMES_HOME_DIR? | default "/var/lib/hermes/.hermes"
}
def gateway-unit [] {
$env.HERMES_GATEWAY_UNIT? | default "hermes-agent"
@@ -14,8 +7,6 @@ def gateway-unit [] {
def ctl-gssh [cmd: string] { run-argv ((ssh-args) ++ [$cmd]) }
# Pull a file out of the guest, open it in $EDITOR, push it back.
# Skips the write if nothing changed (hash comparison).
def edit-remote [remote: string, mode: string = "0644"] {
let tmp = (mktemp)
let fetched = do -i { ctl-gssh $"cat ($remote)" } | complete
@@ -38,13 +29,8 @@ def edit-remote [remote: string, mode: string = "0644"] {
}
}
# Everything not matched by a more-specific `main ctl *` goes straight to the
# hermes CLI in the guest, with a pty for interactive subcommands like `chat`.
#
# A single string, not rest args: nu's parser tries to match any bare
# --flag-shaped token against this command's own flags before it ever
# reaches a rest parameter, so `hermenix ctl chat --model x` would fail to
# parse. Quote the whole thing instead — e.g. `hermenix ctl "chat --model x"`.
# Single string, not rest args: nu matches bare --flags on this command first.
# Quote multi-word passthroughs: hermenix ctl "chat --model x"
def "main ctl" [remainder: string = ""] {
if $remainder == "" {
print "usage: hermenix ctl <subcommand>"
@@ -94,8 +80,6 @@ def "main ctl conf" [action?: string] {
}
}
# API keys. Mode 0600, never enters the Nix store, and not printed unless
# you ask for it explicitly.
def "main ctl secrets" [action?: string] {
if $action == "edit" {
edit-remote $"(home-dir)/.env" "0600"
@@ -111,8 +95,6 @@ def "main ctl logs" [] { run-argv ((ssh-args) ++ ["-t" $"journalctl --user -u (g
def "main ctl restart" [] { ctl-gssh $"systemctl --user restart (gateway-unit)" }
def "main ctl units" [] { ctl-gssh "systemctl --user list-units 'hermes*' --all --no-pager" }
# Overwrite the agent's identity from the seed. Destructive — this is how
# you undo whatever it has decided about itself.
def "main ctl reseed" [] {
warn "This overwrites SOUL.md, memories and config.yaml in the guest"
warn "with the seed from /etc/nixos/hermes. Anything Hermes has"
@@ -122,8 +104,6 @@ def "main ctl reseed" [] {
ok "reseeded"
}
# Copy the agent's live identity back here, so you can fold what it has
# learned into the seed in guest/hermes/.
def "main ctl pull" [dest: string = "./hermes-home"] {
mkdir $dest
(