login with fish
This commit is contained in:
parent
e6aa31f769
commit
f27eccf5b0
|
|
@ -139,6 +139,14 @@ vmCmd
|
||||||
console.log(s)
|
console.log(s)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vmCmd
|
||||||
|
.command("info")
|
||||||
|
.description("Show VM system info (via neofetch)")
|
||||||
|
.action(async () => {
|
||||||
|
await vm.ensure()
|
||||||
|
await vm.info()
|
||||||
|
})
|
||||||
|
|
||||||
vmCmd
|
vmCmd
|
||||||
.command("stop")
|
.command("stop")
|
||||||
.description("Stop the VM")
|
.description("Stop the VM")
|
||||||
|
|
|
||||||
17
src/vm.ts
17
src/vm.ts
|
|
@ -21,6 +21,10 @@ export async function ensure(): Promise<void> {
|
||||||
// Provision
|
// Provision
|
||||||
await $`limactl shell ${VM_NAME} -- bash -c "curl -fsSL https://claude.ai/install.sh | bash"`.quiet()
|
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
|
// 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()
|
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<void> {
|
||||||
await proc.exited
|
await proc.exited
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Open an interactive shell in the VM. */
|
/** Open an interactive fish shell in the VM. */
|
||||||
export async function shell(): Promise<void> {
|
export async function shell(): Promise<void> {
|
||||||
const proc = Bun.spawn(
|
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<void> {
|
||||||
|
const proc = Bun.spawn(
|
||||||
|
["limactl", "shell", VM_NAME, "--", "neofetch"],
|
||||||
{ stdin: "inherit", stdout: "inherit", stderr: "inherit" },
|
{ stdin: "inherit", stdout: "inherit", stderr: "inherit" },
|
||||||
)
|
)
|
||||||
await proc.exited
|
await proc.exited
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user