add cline

This commit is contained in:
2026-10-28 06:26:57 -06:00
parent 28a6e43e07
commit 7c22510eee
8 changed files with 89 additions and 5 deletions
+4 -2
View File
@@ -73,7 +73,7 @@ Pacman installs software from the "packages.conf" file. It installs software suc
### AUR ### AUR
Yay is installed as is the way AUR packages are installed and maintained. Examples include the Helium Browser and Winboat. Yay is installed as is the way AUR packages are installed and maintained. Examples include the Helium Browser and Winboat. Helium is made the default browser once; you can choose another in Settings > Apps > Default Apps.
### Flathub ### Flathub
@@ -244,7 +244,7 @@ restic snapshots
## Sandboxed AI agents ## Sandboxed AI agents
CoreDesktop installs the AI coding agents opencode, Hermes Agent and Claude Code, and runs them in a sandbox. In the sandbox, an agent: CoreDesktop installs the AI coding agents opencode, Hermes Agent, Cline Desktop and Claude Code, and runs them in a sandbox. In the sandbox, an agent:
- can change files only in the directory you start it from (plus its own settings and a few package caches), so start it from a project directory - can change files only in the directory you start it from (plus its own settings and a few package caches), so start it from a project directory
- can't read your SSH keys, password stores, browser profiles, Flatpak apps' data (browsers, Signal, Telegram and the rest), your Nextcloud password, cloud and Git credentials, or the other agents' logins - can't read your SSH keys, password stores, browser profiles, Flatpak apps' data (browsers, Signal, Telegram and the rest), your Nextcloud password, cloud and Git credentials, or the other agents' logins
@@ -252,6 +252,8 @@ CoreDesktop installs the AI coding agents opencode, Hermes Agent and Claude Code
Typing `opencode`, `hermes` or `hermes-agent` runs it in the sandbox. To run one without it, type `unsandboxed opencode`. Hermes' gateway, the background service that lets you talk to Hermes through Matrix and other messaging apps, runs in the sandbox too, and can reach the Matrix server in Hermes' settings. For other messaging services, add their domains as shown below. Hermes talks to its gateway through a local socket, so its sandbox allows local sockets but hides the ones that would let it act outside the sandbox: your session's D-Bus and SSH agent, Docker, Tailscale, X11, tmux and browsers. Claude Code uses its own built-in sandbox for every command it runs (see `/sandbox` inside Claude). Typing `opencode`, `hermes` or `hermes-agent` runs it in the sandbox. To run one without it, type `unsandboxed opencode`. Hermes' gateway, the background service that lets you talk to Hermes through Matrix and other messaging apps, runs in the sandbox too, and can reach the Matrix server in Hermes' settings. For other messaging services, add their domains as shown below. Hermes talks to its gateway through a local socket, so its sandbox allows local sockets but hides the ones that would let it act outside the sandbox: your session's D-Bus and SSH agent, Docker, Tailscale, X11, tmux and browsers. Claude Code uses its own built-in sandbox for every command it runs (see `/sandbox` inside Claude).
Cline Desktop, opened from the app menu, runs in the sandbox with your projects in `~/Projects`: it can change files there, and open projects elsewhere only to read them. It also reaches Cline's own servers (cline.bot). It draws through your Wayland session but can't reach the session's other sockets, so it can't use D-Bus, the keyring or the GPU (it draws without the GPU). To run it without the sandbox, type `unsandboxed cline-desktop`.
Before using an agent the first time, sign in and choose a model provider with `configure` (see below). Before using an agent the first time, sign in and choose a model provider with `configure` (see below).
If an agent needs a site or folder the sandbox blocks, add it in `~/.config/coredesktop/sandbox/base.json` (for every agent) or `~/.config/coredesktop/sandbox/opencode.json` (for one agent): If an agent needs a site or folder the sandbox blocks, add it in `~/.config/coredesktop/sandbox/base.json` (for every agent) or `~/.config/coredesktop/sandbox/opencode.json` (for one agent):
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
# Make Helium the default browser. This runs once, so a browser you choose
# later in Settings stays your default.
[ -f /usr/share/applications/helium.desktop ] || exit 0
xdg-settings set default-web-browser helium.desktop
+5
View File
@@ -82,6 +82,10 @@ DEV_TOOLS=(
go go
herdr herdr
hugo hugo
# cline-desktop's build aborts without an appindicator library (its PKGBUILD
# only lists one as optional); also its tray icon. Here so it's installed
# before DESKTOP builds cline-desktop.
libayatana-appindicator
neovim neovim
nodejs nodejs
npm npm
@@ -117,6 +121,7 @@ MAINTENANCE=(
DESKTOP=( DESKTOP=(
bitwarden bitwarden
cliamp cliamp
cline-desktop
element-desktop element-desktop
gnome gnome
gnome-tweaks gnome-tweaks
+16 -2
View File
@@ -57,6 +57,19 @@ case "$agent" in
*) profile="$agent" ;; *) profile="$agent" ;;
esac esac
# Cline Desktop is a window, usually opened from the app menu in your home
# directory, so it always starts in ~/Projects and can change projects there.
# Its profile hides /run/user, where your session's D-Bus and keyring sockets
# are, except the Wayland socket it draws through. The sandbox has no GPU, and
# WebKit can't start its own sandbox (bubblewrap) inside this one.
gui_socket=""
case "$profile" in
cline-desktop)
mkdir -p "$HOME/Projects" && cd "$HOME/Projects" || exit 1
gui_socket="$XDG_RUNTIME_DIR/${WAYLAND_DISPLAY:-wayland-0}"
export GDK_BACKEND=wayland WEBKIT_DISABLE_DMABUF_RENDERER=1 WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS=1 ;;
esac
srt="$(command -v srt || echo "$HOME/.local/bin/srt")" srt="$(command -v srt || echo "$HOME/.local/bin/srt")"
if [ ! -x "$srt" ]; then if [ ! -x "$srt" ]; then
echo "The sandbox (srt) isn't installed; run update. To run $agent without it: unsandboxed $agent" echo "The sandbox (srt) isn't installed; run update. To run $agent without it: unsandboxed $agent"
@@ -101,8 +114,9 @@ done
# Outside the sandbox's writable paths, so the agent can't change its own rules # Outside the sandbox's writable paths, so the agent can't change its own rules
settings="$SETTINGS_DIR/$agent.$$.json" settings="$SETTINGS_DIR/$agent.$$.json"
if ! jq -s --arg domains "$COREDESKTOP_SANDBOX_DOMAINS" \ if ! jq -s --arg domains "$COREDESKTOP_SANDBOX_DOMAINS" --arg socket "$gui_socket" \
"$MERGE"' | .network.allowedDomains += ($domains | split(" ") | map(select(. != "")))' \ "$MERGE"' | .network.allowedDomains += ($domains | split(" ") | map(select(. != "")))
| if $socket != "" then .filesystem.allowRead += [$socket] else . end' \
"${configs[@]}" > "$settings"; then "${configs[@]}" > "$settings"; then
echo "Couldn't read the sandbox config: ${configs[*]}" echo "Couldn't read the sandbox config: ${configs[*]}"
exit 1 exit 1
+1
View File
@@ -0,0 +1 @@
../agent
+4 -1
View File
@@ -67,7 +67,10 @@
"~/.claude.json", "~/.claude.json",
"~/.hermes", "~/.hermes",
"~/.config/opencode", "~/.config/opencode",
"~/.local/share/opencode" "~/.local/share/opencode",
"~/.cline",
"~/.config/bot.cline.app",
"~/.local/share/bot.cline.app"
], ],
"allowRead": [], "allowRead": [],
"allowWrite": [ "allowWrite": [
+35
View File
@@ -0,0 +1,35 @@
{
"network": {
"allowedDomains": [
"cline.bot",
"*.cline.bot"
],
"allowAllUnixSockets": true
},
"filesystem": {
"denyRead": [
"/run/user",
"/run/dbus",
"/run/docker.sock",
"/run/podman",
"/run/tailscale",
"/run/ssh-unix-local",
"/tmp/.X11-unix",
"/tmp/tmux-*",
"/tmp/ssh-*",
"/tmp/*/SingletonSocket"
],
"allowRead": [
"~/.cline",
"~/.config/bot.cline.app",
"~/.local/share/bot.cline.app",
"~/.cache/bot.cline.app"
],
"allowWrite": [
"~/.cline",
"~/.config/bot.cline.app",
"~/.local/share/bot.cline.app",
"~/.cache/bot.cline.app"
]
}
}
+18
View File
@@ -43,6 +43,24 @@ if [ -f "$CLAUDE_SETTINGS" ]; then
fi fi
fi fi
# Cline Desktop is opened from the app menu, so an entry of the same name in
# ~/.local/share/applications, which wins over the package's, runs it in the
# sandbox. It's removed when the package is.
CLINE_DESKTOP="/usr/share/applications/cline-desktop.desktop"
CLINE_ENTRY="$HOME/.local/share/applications/cline-desktop.desktop"
if [ -f "$CLINE_DESKTOP" ]; then
tmp="$(mktemp)"
sed "s#^Exec=.*#Exec=$COREDESKTOP/sandbox/bin/cline-desktop %U#" "$CLINE_DESKTOP" > "$tmp"
if cmp -s "$tmp" "$CLINE_ENTRY"; then
rm -f "$tmp"
else
echo "Running Cline Desktop in the sandbox..."
mkdir -p "$(dirname "$CLINE_ENTRY")" && mv -f "$tmp" "$CLINE_ENTRY" && chmod 644 "$CLINE_ENTRY" || STATUS=1
fi
elif [ -f "$CLINE_ENTRY" ]; then
rm -f "$CLINE_ENTRY"
fi
# Hermes' gateway acts on messages from outside this machine, so it runs in # Hermes' gateway acts on messages from outside this machine, so it runs in
# the sandbox too: a systemd drop-in starts it through sandbox/bin/hermes. It # the sandbox too: a systemd drop-in starts it through sandbox/bin/hermes. It
# also needs to reach the Matrix server in Hermes' settings, which differs on # also needs to reach the Matrix server in Hermes' settings, which differs on