最近我在好几台无桌面环境的机器上设置了vibe coding环境,作为记录。操作环境都是基于arch linux的服务器,没有图形界面,完全通过命令行操作。

安装mise

通过 paru -S mise 或者 yay -S mise 安装mise。 官方文档 https://mise.jdx.dev/getting-started.html

Shell配置

如果你使用的是zsh或者fish,需要参考官方文档进行相关的设置

fish

一键配置

curl https://mise.run/fish | sh
# Installs mise and adds activation to ~/.config/fish/config.fish

或者手动在你的fish配置加入

# ~/.config/fish/config.fish
if status is-interactive
  mise activate fish | source
else
  mise activate fish --shims | source
end

zsh

一键配置

curl https://mise.run/zsh | sh
# Installs mise and adds activation to ~/.zshrc

手动配置

# ~/.zprofile or ~/.zshrc
eval "$(mise activate zsh --shims)"

bash

一键配置

curl https://mise.run/bash | sh
# Installs mise and adds activation to ~/.bashrc

手工配置

# ~/.bash_profile or ~/.bash_login or ~/.profile
eval "$(mise activate bash --shims)"

安装编程环境

mise use -g nodejs bun rust go

不同的编码环境可能需要配置国内的各种镜像源,请自行查阅相关文档进行配置。

安装编程Agent

mise use -g claude-code codex opencode

后续要全部更新 执行 mise upgrade 就可以了。

mise不具备加速功能,有些工具需要自备代理才能正常下载

Agent跨设备同步

Agent配置

在有界面的设备上,使用cc-switch配置好,然后通过webdav上传配置到云端。

桌面端的可以使用 paru -S cc-switch-bin 安装cc-switch。

同步到无头设备

在无桌面环境的设备上,通过命令安装 paru -S cc-switch-cli 安装cc-switch-cli。通过命令cc-switch打开程序,在菜单 “配置-webdav同步”,设置好webdav的地址和账号密码后,选择“webdav下载到本地”就行了。