Files

1 line
13 KiB
JSON

{"repo": "candemircan/dotfiles", "files": {"zsh/.zshrc": {"b80bdca2dbb6f52d3ba4b38c0f53ffcda0146169": {"t": 1785596342.5712109, "n": 9063, "h": "a3edb0b2d4d59f8a", "c": "[ -f ~/.zsh_secrets ] && source ~/.zsh_secrets\n\nHISTFILE=\"$HOME/.zsh_history\"\nHISTSIZE=50000\nSAVEHIST=10000\n\nsetopt EXTENDED_HISTORY\nsetopt HIST_EXPIRE_DUPS_FIRST\nsetopt HIST_IGNORE_DUPS\nsetopt HIST_VERIFY\nsetopt SHARE_HISTORY\n\n# Performance: Smarter Path Management (Avoid duplicates)\ntypeset -U path # Keep path unique\npath=(\n ~/.local/bin\n ~/.config/helix\n ~/.juliaup/bin\n $path\n)\n\n\n# Lightweight shell setup. Loading all of Oh My Zsh runs compinit on every new\n# shell, which dominates pane startup time in tmux/herdr.\nexport ZSH=\"$HOME/.oh-my-zsh\"\nexport ZSH_CUSTOM=\"${ZSH_CUSTOM:-$ZSH/custom}\"\nexport ZSH_CACHE_DIR=\"${ZSH_CACHE_DIR:-${XDG_CACHE_HOME:-$HOME/.cache}/oh-my-zsh}\"\nmkdir -p \"$ZSH_CACHE_DIR/completions\" 2>/dev/null\nfpath=(\n \"$ZSH_CACHE_DIR/completions\"\n \"$ZSH/functions\"\n \"$ZSH/completions\"\n \"$ZSH_CUSTOM/functions\"\n \"$ZSH_CUSTOM/completions\"\n \"$ZSH/plugins/git\"\n $fpath\n)\n\nalias g='git'\nalias ga='git add'\nalias gaa='git add --all'\nalias gapa='git add --patch'\nalias gau='git add --update'\nalias gb='git branch'\nalias gba='git branch --all'\nalias gbd='git branch --delete'\nalias gcb='git checkout -b'\nalias gco='git checkout'\nalias gc='git commit --verbose'\nalias gca='git commit --verbose --all'\nalias gcmsg='git commit --message'\nalias gd='git diff'\nalias gdca='git diff --cached'\nalias gl='git pull'\nalias gp='git push'\nalias gst='git status'\nalias grt='cd \"$(git rev-parse --show-toplevel || echo .)\"'\n\nif [[ -o interactive && -t 0 && -t 1 && -r \"$ZSH_CUSTOM/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh\" ]]; then\n source \"$ZSH_CUSTOM/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh\"\nfi\n\nautoload -Uz compinit\nzstyle ':completion:*' menu select\n\n_lazy_compinit() {\n (( ${+_ZSH_COMPINIT_LOADED} )) && return\n typeset -g _ZSH_COMPINIT_LOADED=1\n compinit -C -d \"${ZSH_COMPDUMP:-${ZDOTDIR:-$HOME}/.zcompdump-${HOST%%.*}-${ZSH_VERSION}}\"\n}\n\n_lazy_expand_or_complete() {\n _lazy_compinit\n zle .expand-or-complete\n}\n\n_lazy_reverse_menu_complete() {\n _lazy_compinit\n zle .reverse-menu-complete\n}\n\nif [[ -o interactive && -t 0 && -t 1 ]]; then\n zle -N expand-or-complete _lazy_expand_or_complete\n zle -N reverse-menu-complete _lazy_reverse_menu_complete\n bindkey '^I' expand-or-complete\n bindkey '^[[Z' reverse-menu-complete\n\n if [ -f ~/.fzf.zsh ]; then\n source ~/.fzf.zsh\n else\n # fzf >= 0.48 bundles key-bindings + completion in `--zsh` output.\n # (Fedora's fzf package no longer ships completion.zsh in\n # /usr/share/fzf/shell, so sourcing the files directly breaks.)\n _fzf_integration=\"$(command fzf --zsh 2>/dev/null)\"\n if [ -n \"$_fzf_integration\" ]; then\n eval \"$_fzf_integration\"\n elif [ -d /usr/share/doc/fzf/examples ]; then\n # Debian/Ubuntu\n for _f in key-bindings.zsh completion.zsh; do\n [ -f \"/usr/share/doc/fzf/examples/$_f\" ] && source \"/usr/share/doc/fzf/examples/$_f\"\n done\n elif [ -d /usr/share/fzf/shell ]; then\n # Fedora (older fzf packaging)\n for _f in key-bindings.zsh completion.zsh; do\n [ -f \"/usr/share/fzf/shell/$_f\" ] && source \"/usr/share/fzf/shell/$_f\"\n done\n fi\n unset _fzf_integration _f\n fi\nfi\n[ -s \"$HOME/.config/envman/load.sh\" ] && source \"$HOME/.config/envman/load.sh\"\n\n\nexport EDITOR=hx\nalias py='python -m pdb -c c'\nalias p='bat --style=plain --paging=never'\n\n# fzf with ripgrep and fd for better performance\nexport FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'\nexport FZF_CTRL_T_COMMAND=\"$FZF_DEFAULT_COMMAND\"\nexport FZF_ALT_C_COMMAND='fd --type d --hidden --follow --exclude .git'\n\n# --- Sandboxed coding agents ------------------------------------------------\n# `sclaude` and `spi` run Claude Code and Pi inside a local sandbox with outbound network.\n# Both OSes run the same rootless OCI container: node22-uv (node:22 + uv,\n# built from sandbox/Containerfile) when available, else plain node:22.\n# default-deny fs — only $PWD, .container_venv and the agent state dir are\n# mounted; env scrubbed except what's passed explicitly. Host secrets\n# (~/.ssh, ~/.aws, ~/.zsh_secrets, ...) are unreachable inside.\n# Linux : podman. `:Z` relabels mounts for SELinux (no-op elsewhere).\n# macOS : apple/container (each container is a lightweight VM).\n# A dedicated .container_venv is mounted over /workspace/.venv so container\n# Python binaries never corrupt the host .venv. A shared uv package cache\n# (~/.cache/uv-container) keeps Python installs fast across runs.\n# Auth: Claude uses /login (browser OAuth); ~/.claude is bound rw so the\n# session persists across runs. No ANTHROPIC_API_KEY is passed.\n# Pi uses the OpenCode Go subscription via OPENCODE_GO_KEY /\n# OPENCODE_API_KEY; state persists in ~/.pi_cache (mounted at ~/.pi).\n# Plain `claude` / `pi` (host binaries) remain untouched and unsandboxed.\ncase \"$(uname -s)\" in\nLinux)\n sclaude() {\n command -v podman >/dev/null || { echo \"sandbox: podman not installed\" >&2; return 1; }\n mkdir -p \"$HOME/.claude\" \"$(pwd)/.container_venv\" \"$HOME/.cache/uv-container\"\n local img=docker.io/library/node:22\n podman image exists localhost/node22-uv 2>/dev/null && img=localhost/node22-uv\n podman run -it --rm \\\n -v \"$(pwd)\":/workspace:Z \\\n -v \"$(pwd)/.container_venv\":/workspace/.venv:Z \\\n -v \"$HOME/.claude\":/root/.claude:Z \\\n -v \"$HOME/.cache/uv-container\":/root/.cache/uv:Z \\\n -w /workspace \\\n \"$img\" npx @anthropic-ai/claude-code \"$@\"\n }\n spi() {\n command -v podman >/dev/null || { echo \"sandbox: podman not installed\" >&2; return 1; }\n mkdir -p \"$HOME/.pi_cache\" \"$(pwd)/.container_venv\" \"$HOME/.cache/uv-container\"\n local -a env_args=()\n [[ -n \"${OPENCODE_GO_KEY:-}\" ]] && env_args+=(-e \"OPENCODE_GO_KEY=$OPENCODE_GO_KEY\")\n [[ -n \"${OPENCODE_API_KEY:-}\" ]] && env_args+=(-e \"OPENCODE_API_KEY=$OPENCODE_API_KEY\")\n (( ${#env_args} )) || echo \"sandbox: OPENCODE_GO_KEY/OPENCODE_API_KEY not set (check ~/.zsh_secrets)\" >&2\n local img=docker.io/library/node:22\n podman image exists localhost/node22-uv 2>/dev/null && img=localhost/node22-uv\n podman run -it --rm \\\n -v \"$(pwd)\":/workspace:Z \\\n -v \"$(pwd)/.container_venv\":/workspace/.venv:Z \\\n -v \"$HOME/.pi_cache\":/root/.pi:Z \\\n -v \"$HOME/.cache/uv-container\":/root/.cache/uv:Z \\\n -w /workspace \\\n \"${env_args[@]}\" \\\n \"$img\" npx @mariozechner/pi-coding-agent \"$@\"\n }\n ;;\nDarwin)\n sclaude() {\n command -v container >/dev/null || { echo \"sandbox: apple/container CLI not installed\" >&2; return 1; }\n mkdir -p \"$HOME/.claude\" \"$(pwd)/.container_venv\" \"$HOME/.cache/uv-container\"\n local img=docker.io/library/node:22\n container image inspect node22-uv >/dev/null 2>&1 && img=node22-uv\n container run -it --rm \\\n -v \"$(pwd)\":/workspace \\\n -v \"$(pwd)/.container_venv\":/workspace/.venv \\\n -v \"$HOME/.claude\":/root/.claude \\\n -v \"$HOME/.cache/uv-container\":/root/.cache/uv \\\n -w /workspace \\\n \"$img\" npx @anthropic-ai/claude-code \"$@\"\n }\n spi() {\n command -v container >/dev/null || { echo \"sandbox: apple/container CLI not installed\" >&2; return 1; }\n mkdir -p \"$HOME/.pi_cache\" \"$(pwd)/.container_venv\" \"$HOME/.cache/uv-container\"\n local -a env_args=()\n [[ -n \"$OPENCODE_GO_KEY\" ]] && env_args+=(-e \"OPENCODE_GO_KEY=$OPENCODE_GO_KEY\")\n [[ -n \"$OPENCODE_API_KEY\" ]] && env_args+=(-e \"OPENCODE_API_KEY=$OPENCODE_API_KEY\")\n (( ${#env_args} )) || echo \"sandbox: OPENCODE_GO_KEY/OPENCODE_API_KEY not set (check ~/.zsh_secrets)\" >&2\n local img=docker.io/library/node:22\n container image inspect node22-uv >/dev/null 2>&1 && img=node22-uv\n container run -it --rm \\\n -v \"$(pwd)\":/workspace \\\n -v \"$(pwd)/.container_venv\":/workspace/.venv \\\n -v \"$HOME/.pi_cache\":/root/.pi \\\n -v \"$HOME/.cache/uv-container\":/root/.cache/uv \\\n -w /workspace \\\n \"${env_args[@]}\" \\\n \"$img\" npx @mariozechner/pi-coding-agent \"$@\"\n }\n ;;\nesac\n\ncount() {\n if [ \"$1\" == \"-h\" ]; then\n echo \"Usage: count <<directory>>\"\n else\n find $1 -maxdepth 1 -type f -not -path '*/.*' | wc -l\n fi\n}\n\n\n\neval \"$(starship init zsh)\"\n\n# Zoxide (jump with z)\neval \"$(zoxide init zsh)\"\n\n# Obsidian note search — $vault must be exported in ~/.zsh_secrets\nsn() {\n note=$(cd \"$vault\" && find . -name \"*.md\" 2>/dev/null | sed 's|^\\./||' | fzf --prompt=\"Note: \")\n [ -z \"$note\" ] && return\n hx \"$vault/$note\"\n}\n\nsetopt GLOB_DOTS\n\nif [[ -o interactive && -t 0 && -t 1 && -r \"$ZSH_CUSTOM/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh\" ]]; then\n source \"$ZSH_CUSTOM/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh\"\nfi\n\n\n# Added by Antigravity CLI installer\nexport PATH=\"/Users/candemircan/.local/bin:$PATH\"\n"}}, "CLAUDE.md": {"b80bdca2dbb6f52d3ba4b38c0f53ffcda0146169": {"t": 1785596344.147838, "n": 3397, "h": "0f353a3e8fdfa66e", "c": "# Dotfiles\n\nGNU Stow-based dotfiles repo for macOS and Linux.\n\n## Structure\n\nEach top-level directory is a stow package symlinked into `$HOME`:\n\n- `zsh/` — `.zshrc` (Oh My Zsh, fzf, zoxide, starship, aliases, local AI functions) + `.local/bin/` scripts\n- `herdr/` — `.config/herdr/config.toml` (primary terminal workspace manager, prefix `C-a`)\n- `tmux/` — `.tmux.conf` (legacy rollback config, prefix `C-a`, TPM, flexoki dark theme)\n- `kitty/` — `.config/kitty/` (gruvbox dark theme, RobotoMono Nerd Font, boots into Herdr)\n- `helix/` — `.config/helix/` (gruvbox dark, REPL pipe, serpl, LSP config)\n- `ruff/` — `.config/ruff/pyproject.toml` (global Ruff lint defaults)\n- `claude/` — agent skills (`baklavacutter`, `docments-to-docstrings`) + `.claude/managed-settings.json` (machine-level safety policies)\n- `pi/` — `.pi/agent/` (Pi defaults and OpenCode Go model provider)\n- `sandbox/` — `Containerfile` for the `node22-uv` agent sandbox image (node:22 + uv). Not a stow package; built by `install.sh`, so don't add it to the stow loop\n- `git/` — `.gitconfig` (shared Git settings and identity); machine-local overrides go in `~/.gitconfig.local` (not tracked)\n\n### `zsh/.local/bin/` scripts\n\n| Script | Purpose |\n|---|---|\n| `tmux-init-default` | Legacy tmux rollback helper; creates the `default` session (window 1 shell, window 9 btop) |\n| `sessionizer` | fzf over `~/Projects` + `~/Projects/cpi`; creates/attaches sessions, activates `.venv` |\n| `tmux-yazi` | Yazi chooser popup; text files → `hx`, others → system opener |\n| `tmux-obsidian` | Opens `$vault/Inbox.md` in helix (reads `~/.zsh_secrets`) |\n| `herdr-sessionizer` | fzf project picker; creates/focuses Herdr workspaces and tabs |\n| `herdr-space-switcher` | fzf over Herdr spaces only; focuses selected space |\n| `herdr-yazi` | Yazi chooser temporary pane; text files open in the previously active Herdr pane |\n| `herdr-init-default` | Starts/attaches Herdr, ensures `default` and `btop` spaces |\n\n### `.zshrc` functions\n\n| Function | Purpose |\n|---|---|\n| `ai <prompt>` | Run opencode with a prompt |\n| `sclaude`, `spi` | Sandboxed agents — rootless OCI container (`node22-uv` = node:22 + uv, built from `sandbox/Containerfile`; falls back to plain `node:22` if unbuilt): podman on Linux (`:Z` mounts for SELinux), `apple/container` on macOS. Only `$PWD`, `.container_venv` → `.venv`, a shared uv cache (`~/.cache/uv-container`), and agent state are mounted. Claude OAuth persists via `~/.claude`; Pi gets `OPENCODE_GO_KEY`/`OPENCODE_API_KEY` and persists state in `~/.pi_cache` |\n| `sn` | Fuzzy Obsidian note search |\n| `count <dir>` | Count files in a directory |\n\n## Scripts\n\n- `install.sh` — Full bootstrap: installs brew, tools, agents, plugins, then runs `stow.sh`.\n- `stow.sh` — Symlinks all packages, wires agent skills, and shares instructions across agents.\n\n\n\nSkills from `~/.agent-skills/` are symlinked into Claude, OpenCode, and Pi skills directories.\n\n`claude/.claude/managed-settings.json` contains machine-level Claude Code safety policies. `stow.sh` prompts to install it to:\n- macOS: `/Library/Application Support/ClaudeCode/managed-settings.json`\n- Linux: `/etc/claude-code/managed-settings.json`\n\n## Adding a new package\n\n1. Create a directory mirroring the target path relative to `$HOME` (e.g. `foo/.config/foo/config.toml`).\n2. Add the directory name to the `stow` loop in `stow.sh`.\n3. Run `./stow.sh`.\n"}}}}