From a45881479d42a7f4f03461aac8dfdb6d32026f8e Mon Sep 17 00:00:00 2001 From: Juan Barbat Date: Sat, 4 Jul 2026 14:17:50 -0300 Subject: [PATCH 1/2] chore: remove Claude Code statusline and OpenCode TUI from dotfiles statusline.sh and tui.json are product config, not dotfiles cleanup. Clean up install.sh CLAUDE, README and keymaps docs. --- CLAUDE.md | 4 - README.md | 3 +- claude/statusline.sh | 315 ------------------------------------------- docs/keymaps.md | 7 +- install.sh | 11 -- opencode/tui.json | 7 - 6 files changed, 2 insertions(+), 345 deletions(-) delete mode 100755 claude/statusline.sh delete mode 100644 opencode/tui.json diff --git a/CLAUDE.md b/CLAUDE.md index d98df22..8e2e003 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -47,10 +47,6 @@ dotfiles/ │ ├── muxy.conf # Muxy integration config │ └── shaders/ # 4 cursor shaders (glsl) ├── herdr/config.toml # Multiplexor → ~/.config/herdr/config.toml -├── claude/ -│ └── statusline.sh # Statusline para Claude Code -├── opencode/ -│ └── tui.json # TUI config → ~/.config/opencode/tui.json ├── lazygit/config.yml # LazyGit → ~/.config/lazygit/config.yml ├── local/ │ └── env.zsh.example # Template para ~/.config/cortex-dots/local/env.zsh diff --git a/README.md b/README.md index 566c828..891652b 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ bash install.sh --check | Terminal | `ghostty/config`, `ghostty/shaders/` | | Prompt | `starship/starship.toml` using the generic `cortex_warm_slate` palette | | Multiplexer | `herdr/config.toml` plus session helpers | -| AI CLI UX | `claude/`, `opencode/`, Herdr helpers, agent-state docs | +| AI CLI UX | Herdr helpers, agent-state docs | | Package guardrails | global defaults for `npm`, `pnpm`, `bun`, and `uv` | ## Navigation Defaults @@ -127,7 +127,6 @@ scripts/test-install.sh --seed-stale-opposite scripts/test-install.sh --symlink --seed-stale-opposite bash -n install.sh zsh -n zsh/zshrc -for path in opencode/*.json; do jq . "$path" >/dev/null 2>&1 || echo "invalid: $path"; done python3 - <<'PY' import pathlib, tomllib for path in pathlib.Path('.').rglob('*.toml'): diff --git a/claude/statusline.sh b/claude/statusline.sh deleted file mode 100755 index e10096e..0000000 --- a/claude/statusline.sh +++ /dev/null @@ -1,315 +0,0 @@ -#!/bin/bash - -# Dark Vibrant colors (ANSI 256) -PRIMARY='\033[38;5;75m' # azul claro -ACCENT='\033[38;5;227m' # amarillo -SECONDARY='\033[38;5;111m' # azul gris -MUTED='\033[38;5;242m' # gris -SUCCESS='\033[38;5;83m' # verde (#50fa7b) -ERROR='\033[38;5;203m' # rojo (#ff5555) -PURPLE='\033[38;5;135m' # púrpura -BOLD='\033[1m' -STRIKE='\033[9m' -NC='\033[0m' - -# Cache para MCP (evita llamar cada 300ms) -MCP_CACHE_TTL=120 # 2 minutos - -# Leer JSON desde stdin -input=$(cat) - -if ! command -v jq >/dev/null 2>&1; then - printf 'Claude Code' - exit 0 -fi - -# Parsear campos básicos -MODEL=$(echo "$input" | jq -r '.model.display_name // "Claude"') -DIR=$(echo "$input" | jq -r '.workspace.current_dir // "~"') -MCP_CACHE_KEY=$(printf '%s' "$DIR" | tr '/ ' '__') -MCP_CACHE_FILE="/tmp/claude_mcp_cache_${MCP_CACHE_KEY}" - -ADDED=$(echo "$input" | jq -r '.cost.total_lines_added // 0') -REMOVED=$(echo "$input" | jq -r '.cost.total_lines_removed // 0') - -# Ventana de contexto — usa used_percentage del JSON (mismo cálculo que auto-compact) -CTX_PERCENT=$(echo "$input" | jq -r '.context_window.used_percentage // empty' 2>/dev/null) -if [ -z "$CTX_PERCENT" ] || [ "$CTX_PERCENT" = "null" ]; then - CTX_SIZE=$(echo "$input" | jq -r '.context_window.context_window_size // 200000') - INPUT_TOKENS=$(echo "$input" | jq -r '.context_window.current_usage.input_tokens // 0') - CACHE_CREATE=$(echo "$input" | jq -r '.context_window.current_usage.cache_creation_input_tokens // 0') - CACHE_READ=$(echo "$input" | jq -r '.context_window.current_usage.cache_read_input_tokens // 0') - TOTAL_USED=$((INPUT_TOKENS + CACHE_CREATE + CACHE_READ)) - if [ "$CTX_SIZE" -gt 0 ] 2>/dev/null; then - CTX_PERCENT=$((TOTAL_USED * 100 / CTX_SIZE)) - else - CTX_PERCENT=0 - fi -else - CTX_PERCENT=$(echo "$CTX_PERCENT" | awk '{printf "%d", $1 + 0.5}') -fi -[ "$CTX_PERCENT" -gt 100 ] && CTX_PERCENT=100 -[ "$CTX_PERCENT" -lt 0 ] && CTX_PERCENT=0 - -# Obtener servidores MCP desde config -get_mcp_servers() { - if [ -f "$MCP_CACHE_FILE" ]; then - CACHE_AGE=$(($(date +%s) - $(stat -f %m "$MCP_CACHE_FILE" 2>/dev/null || echo 0))) - if [ "$CACHE_AGE" -lt "$MCP_CACHE_TTL" ]; then - cat "$MCP_CACHE_FILE" - return - fi - fi - - local CURRENT_DIR - CURRENT_DIR=$(echo "$input" | jq -r '.workspace.current_dir // ""') - - local SERVERS="" - - if [ -n "$CURRENT_DIR" ]; then - SERVERS=$(jq -r ".projects[\"$CURRENT_DIR\"].mcpServers // {} | keys[]" "$HOME/.claude.json" 2>/dev/null | tr '\n' ',' | sed 's/,$//') - fi - - if [ -z "$SERVERS" ]; then - SERVERS=$(jq -r ".projects[\"$HOME\"].mcpServers // {} | keys[]" "$HOME/.claude.json" 2>/dev/null | tr '\n' ',' | sed 's/,$//') - fi - - echo "$SERVERS|" > "$MCP_CACHE_FILE" - echo "$SERVERS|" -} - -MCP_DATA=$(get_mcp_servers) -MCP_CONNECTED=$(echo "$MCP_DATA" | cut -d'|' -f1) -MCP_DISCONNECTED=$(echo "$MCP_DATA" | cut -d'|' -f2) - -label_brain() { - case "$1" in - work-brain) printf 'work' ;; - life-brain) printf 'life' ;; - second-brain) printf 'notes' ;; - *) return 1 ;; - esac -} - -format_brains() { - local result="" - local extras=0 - - if [ -n "$MCP_CONNECTED" ]; then - IFS=',' read -ra SERVERS <<< "$MCP_CONNECTED" - for srv in "${SERVERS[@]}"; do - local label - if label=$(label_brain "$srv"); then - [ -n "$result" ] && result+=" " - result+="${SUCCESS}${label}${NC}" - else - extras=$((extras + 1)) - fi - done - fi - - if [ -n "$MCP_DISCONNECTED" ]; then - IFS=',' read -ra SERVERS <<< "$MCP_DISCONNECTED" - for srv in "${SERVERS[@]}"; do - local label - if label=$(label_brain "$srv"); then - [ -n "$result" ] && result+=" " - result+="${ERROR}${STRIKE}${label}${NC}" - fi - done - fi - - if [ "$extras" -gt 0 ]; then - [ -n "$result" ] && result+=" " - result+="${MUTED}mcp+${extras}${NC}" - fi - - echo "$result" -} - -format_mcp() { - local result="" - - if [ -n "$MCP_CONNECTED" ]; then - IFS=',' read -ra SERVERS <<< "$MCP_CONNECTED" - for srv in "${SERVERS[@]}"; do - [ -n "$result" ] && result+=" " - result+="${SUCCESS}${srv}${NC}" - done - fi - - if [ -n "$MCP_DISCONNECTED" ]; then - IFS=',' read -ra SERVERS <<< "$MCP_DISCONNECTED" - for srv in "${SERVERS[@]}"; do - [ -n "$result" ] && result+=" " - result+="${ERROR}${STRIKE}${srv}${NC}" - done - fi - - if [ -z "$result" ]; then - echo "${MUTED}no mcp${NC}" - else - echo "$result" - fi -} - -MCP_DISPLAY=$(format_mcp) -BRAINS_DISPLAY=$(format_brains) - -realpath_portable() { - local target="$1" - if command -v realpath >/dev/null 2>&1; then - realpath "$target" - else - python3 - <<'PY' "$target" -import os -import sys -print(os.path.realpath(sys.argv[1])) -PY - fi -} - -# Estado SDD desde artefactos .ai/ -get_sdd_status() { - local current_dir - current_dir=$(echo "$input" | jq -r '.workspace.current_dir // ""') - [ -z "$current_dir" ] && echo "|" && return - - local ai_dir="$current_dir/.ai" - [ ! -d "$ai_dir" ] && echo "|" && return - - local script_path - script_path=$(realpath_portable "${BASH_SOURCE[0]}") - local repo_root="$(cd "$(dirname "$script_path")/../.." && pwd)" - local resume_script="$repo_root/scripts/sdd-resume-context.sh" - - local mode="" - local active_spec="" - local tasks_summary="" - local status="" - - if [ ! -x "$resume_script" ]; then - echo "|||" && return - fi - - local resume_json - resume_json=$("$resume_script" get "$current_dir" 2>/dev/null || true) - - if [ -n "$resume_json" ]; then - status=$(echo "$resume_json" | jq -r '.status // empty' 2>/dev/null) - mode=$(echo "$resume_json" | jq -r '.execution_mode // empty' 2>/dev/null) - - case "$status" in - ready) - active_spec=$(echo "$resume_json" | jq -r '.feature // empty' 2>/dev/null) - local tasks_file - tasks_file=$(echo "$resume_json" | jq -r '.tasks_path // empty' 2>/dev/null) - if [ -n "$tasks_file" ] && [ -f "$current_dir/$tasks_file" ]; then - local done pending - done=$(grep -c '^- \[x\]' "$current_dir/$tasks_file" 2>/dev/null || echo 0) - pending=$(grep -c '^- \[ \]' "$current_dir/$tasks_file" 2>/dev/null || echo 0) - tasks_summary="${done}/${pending}" - fi - ;; - ambiguous_feature) - active_spec="ambiguous" - ;; - incomplete_feature) - active_spec="incomplete" - ;; - esac - fi - - echo "${mode}|${active_spec}|${tasks_summary}" -} - -SDD_DATA=$(get_sdd_status) -SDD_MODE=$(echo "$SDD_DATA" | cut -d'|' -f1) -SDD_SPEC=$(echo "$SDD_DATA" | cut -d'|' -f2) -SDD_TASKS=$(echo "$SDD_DATA" | cut -d'|' -f3) - -# Nombre del directorio -DIR_NAME=$(basename "$DIR") - -# Info de git -BRANCH="" -GIT_DIRTY="" -if git -C "$DIR" rev-parse --git-dir > /dev/null 2>&1; then - BRANCH=$(git -C "$DIR" branch --show-current 2>/dev/null) - if [[ -n $(git -C "$DIR" status --porcelain 2>/dev/null) ]]; then - GIT_DIRTY="*" - fi -fi - -# Icono del modelo -MODEL_ICON="🤖" -case "$MODEL" in - *Opus*) MODEL_ICON="🎭" ;; - *Sonnet*) MODEL_ICON="📝" ;; - *Haiku*) MODEL_ICON="🍃" ;; -esac - -# Barra de progreso del contexto -BAR_WIDTH=8 -FILLED=$((CTX_PERCENT * BAR_WIDTH / 100)) -EMPTY=$((BAR_WIDTH - FILLED)) - -if [ "$CTX_PERCENT" -ge 80 ]; then - BAR_COLOR="$ERROR" -elif [ "$CTX_PERCENT" -ge 50 ]; then - BAR_COLOR="$ACCENT" -else - BAR_COLOR="$SUCCESS" -fi - -BAR="${BAR_COLOR}[" -for ((i=0; i [path]` | Pipe initial context into Claude Code. | -| Claude Code | `ccclip ` | Copy files as fenced code context to the clipboard. | | OpenCode | `oc [path]` | Start OpenCode in the current or given directory. | | OpenCode | `ocb [path]` | Alias for `oc`, preserving default flags. | -Claude Code and OpenCode keybindings are mostly app-native. This repo adds launch helpers, statusline config, and Herdr integration so sessions survive terminal detach/reattach. +Claude Code and OpenCode keybindings are mostly app-native. This repo adds launch helpers (cc, ccb, ccx, ccclip) and Herdr integration so sessions survive terminal detach/reattach. ## Collision Notes diff --git a/install.sh b/install.sh index b71780e..046ec35 100755 --- a/install.sh +++ b/install.sh @@ -252,21 +252,15 @@ PY check_install_target "$DOTFILES/herdr/config.toml" "$HOME/.config/herdr/config.toml" check_install_target "$DOTFILES/ghostty/config" "$HOME/.config/ghostty/config" check_install_target "$DOTFILES/ghostty/shaders" "$HOME/.config/ghostty/shaders" - check_install_target "$DOTFILES/opencode/tui.json" "$HOME/.config/opencode/tui.json" - check_install_target "$DOTFILES/claude/statusline.sh" "$HOME/.claude/statusline.sh" check_install_target "$DOTFILES/lazygit/config.yml" "$HOME/.config/lazygit/config.yml" echo "" echo "checking syntax" check_shell "$DOTFILES/install.sh" bash - check_shell "$DOTFILES/claude/statusline.sh" bash check_shell "$DOTFILES/zsh/zshrc" zsh for path in "$DOTFILES"/zsh/scripts/*.zsh; do check_shell "$path" zsh done - for path in "$DOTFILES"/opencode/*.json; do - check_json "$path" - done check_toml "$DOTFILES/starship/starship.toml" check_toml "$DOTFILES/bun/bunfig.toml" check_toml "$DOTFILES/uv/uv.toml" @@ -796,8 +790,6 @@ backup_if_exists "$HOME/.config/starship.toml" backup_if_exists "$HOME/.config/herdr/config.toml" backup_if_exists "$HOME/.config/ghostty/config" backup_if_exists "$HOME/.config/herdr/config.toml" -backup_if_exists "$HOME/.config/opencode/tui.json" -backup_if_exists "$HOME/.claude/statusline.sh" backup_if_exists "$HOME/.config/lazygit/config.yml" # --- Instalar configs --- @@ -875,9 +867,6 @@ install_target "$DOTFILES/starship/starship.toml" "$HOME/.config/starship.toml" install_target "$DOTFILES/herdr/config.toml" "$HOME/.config/herdr/config.toml" install_target "$DOTFILES/ghostty/config" "$HOME/.config/ghostty/config" install_target "$DOTFILES/ghostty/shaders" "$HOME/.config/ghostty/shaders" -install_target "$DOTFILES/opencode/tui.json" "$HOME/.config/opencode/tui.json" -install_target "$DOTFILES/claude/statusline.sh" "$HOME/.claude/statusline.sh" -run_or_plan "chmod +x $HOME/.claude/statusline.sh" chmod +x "$HOME/.claude/statusline.sh" install_target "$DOTFILES/lazygit/config.yml" "$HOME/.config/lazygit/config.yml" if [[ "$GHOSTTY_DEFER_WORKER_NEEDED" == true ]]; then diff --git a/opencode/tui.json b/opencode/tui.json deleted file mode 100644 index a9d3a60..0000000 --- a/opencode/tui.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "https://opencode.ai/tui.json", - "theme": "cortex-green", - "scroll_acceleration": { - "enabled": true - } -} From 9e44b341820e2ca985dba831f28df97cd70833fa Mon Sep 17 00:00:00 2001 From: Juan Barbat Date: Sat, 4 Jul 2026 14:30:03 -0300 Subject: [PATCH 2/2] fix: remove deleted statusline.sh from CI workflow bash_files --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index add40a8..7c22cd3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,6 @@ jobs: bash_files=( install.sh - claude/statusline.sh zsh/scripts/*.sh scripts/*.sh )