-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdot_bash_aliases
More file actions
36 lines (34 loc) · 2.03 KB
/
Copy pathdot_bash_aliases
File metadata and controls
36 lines (34 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Bash aliases
# Claude CLI - skip permissions prompt; DISABLE_AUTOUPDATER so mise owns the version.
# ENABLE_CLAUDEAI_MCP_SERVERS defers to the environment (the Coder pod sets it per
# dotfiles profile: true for onXmaps, false elsewhere) and defaults to false off-cluster.
# Single-quoted so ${...} expands at invocation, not when this file is sourced.
alias claude='DISABLE_AUTOUPDATER=1 ENABLE_CLAUDEAI_MCP_SERVERS=${ENABLE_CLAUDEAI_MCP_SERVERS:-false} claude --dangerously-skip-permissions'
# ccc — attach to (or create) a persistent tmux session running Claude Code.
# Survives terminal disconnects and is reachable over SSH; `claude` above still
# launches Claude directly (no tmux). Named ccc (not cc) to avoid shadowing the
# system C compiler at /usr/bin/cc.
ccc() {
# If we're root (the runtime container may run the agent as root), drop to the
# container's primary non-root user (UID 1000 by devcontainer convention) —
# Claude refuses --dangerously-skip-permissions as root. Keep HOME so the dotfiles
# (ccc, claude alias, ~/.tmux.conf) and ~/.claude config — installed under the
# current home — are still found. No-op when already non-root (e.g. the desktop).
if [ "$(id -u)" = "0" ]; then
local u; u=$(id -un 1000 2>/dev/null) || true
[ -n "$u" ] && exec su -s /bin/bash "$u" -c "export HOME='$HOME'; exec bash -ic ccc"
fi
command -v tmux >/dev/null 2>&1 || { claude; return; }
tmux attach -t claude 2>/dev/null || tmux new -s claude "bash -ic 'claude; exec bash -i'"
}
# cdx — attach to (or create) a persistent tmux session running the Codex CLI.
# Sibling of ccc. `codex` config + interactive login live in the shared-home
# ~/.codex (persisted across workspaces), so run `codex login` once.
cdx() {
if [ "$(id -u)" = "0" ]; then
local u; u=$(id -un 1000 2>/dev/null) || true
[ -n "$u" ] && exec su -s /bin/bash "$u" -c "export HOME='$HOME'; exec bash -ic cdx"
fi
command -v tmux >/dev/null 2>&1 || { codex; return; }
tmux attach -t codex 2>/dev/null || tmux new -s codex "bash -ic 'codex; exec bash -i'"
}