diff --git a/src/cli.ts b/src/cli.ts index 5db304e..1b01731 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -139,6 +139,14 @@ vmCmd console.log(s) }) +vmCmd + .command("info") + .description("Show VM system info (via neofetch)") + .action(async () => { + await vm.ensure() + await vm.info() + }) + vmCmd .command("stop") .description("Stop the VM") diff --git a/src/vm.ts b/src/vm.ts index d9a356b..52308a2 100644 --- a/src/vm.ts +++ b/src/vm.ts @@ -21,6 +21,10 @@ export async function ensure(): Promise { // Provision await $`limactl shell ${VM_NAME} -- bash -c "curl -fsSL https://claude.ai/install.sh | bash"`.quiet() + await $`limactl shell ${VM_NAME} -- sudo apt install -y neofetch fish`.quiet() + + await $`limactl shell ${VM_NAME} -- sudo apt install -y fish"`.quiet() + // Replace ~/.claude and ~/.claude.json with symlinks to host credentials await $`limactl shell ${VM_NAME} -- bash -c "rm -rf ~/.claude ~/.claude.json && ln -sf ${home}/.claude ~/.claude && ln -sf ${home}/.claude.json ~/.claude.json"`.quiet() } @@ -67,10 +71,19 @@ export async function claude(workdir: string): Promise { await proc.exited } -/** Open an interactive shell in the VM. */ +/** Open an interactive fish shell in the VM. */ export async function shell(): Promise { const proc = Bun.spawn( - ["limactl", "shell", VM_NAME], + ["limactl", "shell", VM_NAME, "--", "env", "TERM=xterm-256color", "fish", "--login"], + { stdin: "inherit", stdout: "inherit", stderr: "inherit" }, + ) + await proc.exited +} + +/** Run neofetch in the VM. */ +export async function info(): Promise { + const proc = Bun.spawn( + ["limactl", "shell", VM_NAME, "--", "neofetch"], { stdin: "inherit", stdout: "inherit", stderr: "inherit" }, ) await proc.exited