Skip to content

cassmtnr/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

215 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Dotfiles v2.4.0

Modern, secure, and performance-optimized development environment for macOS and Linux

What are Dotfiles?

Dotfiles are configuration files that customize your development environment and command line tools. They're called "dotfiles" because they typically start with a dot (.) and are hidden by default in Unix-like systems. These files control everything from your shell prompt to your text editor settings, making your development environment consistent and personalized across different machines.

What This Repository Does

This dotfiles repository will transform your macOS or Linux system into a comprehensive, secure, and performant development environment. It provides:

  • πŸš€ Performance Optimized: Optimized shell startup with immediate Node.js/npm availability
  • πŸ”’ Security First: Secure SSH configuration templates and key management
  • πŸ€– AI CLI Safety Hooks: PreToolUse hooks that block dangerous commands (shared by Claude Code & Codex CLI)
  • 🧠 AI CLI Skills & Commands: Reusable skills (code review, spec writing) and workflow commands (CRAFT)
  • πŸ“¦ Complete Package Management: 40+ essential development tools and applications
  • πŸ› οΈ Modern Toolchain: Starship prompt, Oh My Zsh, and contemporary CLI utilities
  • πŸ‘» Ghostty Terminal: GPU-accelerated terminal with Nord theme and custom keybindings
  • πŸ”„ Automated Setup: One-command installation with comprehensive error handling
  • 🐧 Cross-Platform: Supports both macOS and Linux with OS-specific adaptations
  • 🍎 macOS Optimized: System defaults and configurations (macOS only)

Installation

Quick Start

# Clone the repository
git clone https://github.com/cassmtnr/dotfiles.git ~/dotfiles
cd ~/dotfiles

# Run the installation
./install.sh

The installation script automatically sets up your complete development environment with error handling and progress feedback. It's idempotent, so you can run it multiple times safely.

Updating After Changes

After editing dotfiles, use the lightweight update script instead of re-running the full installer:

./update.sh              # Just refresh symlinks (fast)
./update.sh -p           # Also update Homebrew packages
./update.sh -d           # Also re-apply macOS defaults
./update.sh -a           # All of the above

Available Aliases & Functions

This configuration includes a comprehensive set of productivity-enhancing aliases and functions.

Key productivity features:

  • 25+ aliases for navigation, git, and system utilities (.aliases)
  • Utility functions including mkd, killport, extract, weather (.functions)
  • Performance optimized with immediate Node.js tool availability

Required Customizations

After installation, you'll need to configure these components for your specific environment:

1. SSH Configuration

The SSH config is automatically symlinked to ~/.ssh/config. Customize it with your actual settings:

codium ~/dotfiles/.ssh/config   # or: code ~/dotfiles/.ssh/config

Update with your actual SSH key paths and host configurations. The 1Password SSH agent path is auto-configured for macOS. Generate keys in organized folders (e.g., ~/.ssh/github/, ~/.ssh/work/).

2. Update Key Configurations

  • SSH Agent: Edit .ssh-agent with your actual key paths
  • Git: Set your identity with git config --global user.name/user.email
  • Local Settings: Create ~/.zshrc.local for machine-specific configurations

Project Structure

dotfiles/
β”œβ”€β”€ install.sh                 # Main installation script
β”œβ”€β”€ update.sh                  # Lightweight update (symlinks + optional packages/defaults)
β”œβ”€β”€ .utils.sh                  # Shared utilities (OS detection, logging, symlinks, packages)
β”œβ”€β”€ .brewfile                  # Package definitions (45+ packages)
β”œβ”€β”€ .editorconfig              # Cross-editor coding style consistency
β”œβ”€β”€ .zshrc                     # Main shell configuration
β”œβ”€β”€ .zshenv                    # Environment variables
β”œβ”€β”€ .functions                 # Custom functions (mkd, killport, extract)
β”œβ”€β”€ .aliases                   # Shell aliases (25+ shortcuts)
β”œβ”€β”€ .ssh-agent                 # SSH agent management
β”œβ”€β”€ .completion                # Shell completions
β”œβ”€β”€ .starship                  # Starship prompt configuration
β”œβ”€β”€ .defaults                  # macOS system preferences
β”œβ”€β”€ .bun                       # Bun JavaScript runtime config
β”œβ”€β”€ .ghostty/
β”‚   β”œβ”€β”€ config                 # Ghostty terminal configuration (Nord theme)
β”‚   └── icon.icns              # Custom Ghostty application icon
β”œβ”€β”€ .ssh/
β”‚   └── config                 # SSH configuration template
β”œβ”€β”€ .ai/                           # AI CLI config (shared by Claude Code & Codex CLI)
β”‚   β”œβ”€β”€ instructions.md        # Shared global AI instructions (β†’ ~/.claude/CLAUDE.md)
β”‚   β”œβ”€β”€ commands/
β”‚   β”‚   └── craft.md           # CRAFT workflow command (β†’ ~/.claude/commands/ & ~/.codex/prompts/)
β”‚   β”œβ”€β”€ skills/
β”‚   β”‚   β”œβ”€β”€ code-review.md     # Critical code review & fix skill
β”‚   β”‚   └── spec-writing.md    # Implementation spec writing skill
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   └── block-dangerous-commands.js  # PreToolUse safety hook
β”‚   β”œβ”€β”€ claude/                # Claude Code specific
β”‚   β”‚   β”œβ”€β”€ settings.json      # Settings (hooks, permissions, statusline, plugins)
β”‚   β”‚   └── config/
β”‚   β”‚       └── statusline-command.sh  # Custom statusline (project, branch, context %)
β”‚   └── codex/                 # Codex CLI specific
β”‚       β”œβ”€β”€ config.toml        # Codex CLI configuration
β”‚       └── hooks.json         # Codex CLI hooks (references shared hook scripts)
β”œβ”€β”€ .vscodium/
β”‚   β”œβ”€β”€ settings.json          # Cleaned user settings (no Copilot/sync entries)
β”‚   β”œβ”€β”€ extensions.txt         # Extension IDs for Open VSX (one per line)
β”‚   └── icon.icns              # Custom macOS app icon (added manually)
β”œβ”€β”€ .lazydocker/
β”‚   └── config.yml             # LazyDocker terminal UI configuration
β”œβ”€β”€ .motd/                     # Message of the Day scripts (Linux/VPS)
β”‚   β”œβ”€β”€ 10-hostname-color      # Hostname display with figlet + lolcat
β”‚   β”œβ”€β”€ 20-sysinfo             # System info (load, memory)
β”‚   β”œβ”€β”€ 35-diskspace           # Disk space display
β”‚   β”œβ”€β”€ 40-services            # System services status
β”‚   β”œβ”€β”€ 50-fail2ban            # Fail2ban status
β”‚   └── 60-docker              # Docker information
β”œβ”€β”€ .alfred/
β”‚   └── Alfred.alfredpreferences/  # Alfred workflows and settings (macOS only)
β”œβ”€β”€ index.html                 # GitHub Pages landing page
└── .nojekyll                  # Disables Jekyll on GitHub Pages

Core Components

  • install.sh - Comprehensive installation with error handling and progress feedback
  • update.sh - Lightweight update script (symlinks + optional packages/defaults)
  • .utils.sh - Shared utilities sourced by both install.sh and update.sh
  • .zshrc - Modular shell configuration with performance optimizations
  • .functions - Utility functions (mkd, killport, extract, weather, playwright-install)
  • .brewfile - Curated collection of 40+ development tools
  • .editorconfig - Cross-editor coding standards (charset, indentation, line endings)
  • .ghostty/config - Ghostty terminal with Nord theme, custom keybindings, and shell integration
  • .ssh/config - Security-focused SSH template with organized key management
  • .ai/ - AI CLI configuration with safety hooks, skills, and commands (shared by Claude Code & Codex CLI, symlinked to ~/.claude/ & ~/.codex/)
  • .vscodium/ - VSCodium editor configuration (settings, keybindings, extensions list, custom icon)
  • .lazydocker/ - LazyDocker terminal UI for Docker management
  • .motd/ - Message of the Day scripts for Linux/VPS servers
  • .alfred/ - Alfred workflows and preferences (macOS only, symlinked via Alfred's sync feature)

AI CLI Safety Hooks

The .ai/hooks/ directory contains PreToolUse hooks shared by Claude Code and Codex CLI:

  • block-dangerous-commands.js - Blocks dangerous Bash commands at three safety levels:

    • Critical: filesystem destruction (rm -rf ~/), disk operations (dd, mkfs), fork bombs, git history rewriting
    • High: all git write operations, elevated privileges (sudo), secrets exposure, publishing/deployment commands, database operations, network/infrastructure changes
    • Strict: cautionary patterns like git checkout ., docker prune

    Safety level is set to high by default. Patterns are enforced via regex matching and blocked commands are logged to ~/.claude/hooks-logs/.

  • Custom statusline (.ai/claude/config/statusline-command.sh) displays project name, git branch, session ID, context window %, and model name.

AI CLI Skills & Commands

The .ai/skills/ and .ai/commands/ directories provide reusable AI workflows (shared by Claude Code and Codex CLI):

  • Skills (contextual capabilities automatically loaded when relevant):

    • code-review β€” Critical code review across 8 dimensions (correctness, security, concurrency, error handling, performance, API contracts, code quality, test quality). Reviews all changed code, reports findings by severity, fixes everything, and verifies with linter + tests.
    • spec-writing β€” Write implementation-ready specs following proven patterns: phase/epic headers, task templates, quality checklists, and anti-patterns to avoid.
  • Commands (invoked explicitly via /command-name):

    • /craft β€” CRAFT workflow (Code, Review, Audit, Fix, Test): implements a task from the project spec, then refines it through 3 rounds of expert code review with fixes between rounds. Ships artisan-quality code.

VSCodium

This repo uses VSCodium (the open-source VS Code build without Microsoft telemetry). Settings, keybindings, extensions, and a custom icon are version-controlled in .vscodium/ and managed automatically:

  • install.sh installs VSCodium via Brewfile, creates config symlinks, installs extensions, and applies the custom icon
  • update.sh re-syncs symlinks, re-applies the icon, and syncs the extension list back to extensions.txt
  • update.sh -p also runs package updates and installs any new extensions
  • brew() wrapper in .functions automatically re-applies the custom icon after brew upgrade or brew reinstall
  • alias code="codium" in .aliases lets existing aliases (dot, meow, zrc) work transparently

To customize the icon, save a .icns file to ~/dotfiles/.vscodium/icon.icns β€” it will be applied automatically on the next ./update.sh run.

Additional Customization

  • Aliases: Edit .aliases for custom shortcuts
  • Functions: Add utilities to .functions
  • Packages: Modify .brewfile and run brew bundle
  • Prompt: Customize .starship for terminal appearance

Security Notes

πŸ”’ Important Security Practices:

  • Never commit actual SSH keys - only configuration templates
  • Use .zshrc.local for private/sensitive configurations
  • Keep secrets out of version control - the .gitignore is configured to protect sensitive files
  • Template paths are examples - replace with your actual key locations
  • Review permissions - SSH keys should have 600 permissions (chmod 600 ~/.ssh/*/id_*)
  • Use strong passphrases for SSH keys in sensitive environments

Troubleshooting

  • Slow startup: Profile with time zsh -lic exit and zmodload zsh/zprof
  • SSH issues: Test with ssh -T git@github.com and debug with ssh -vT
  • Homebrew: Check with brew doctor and update with brew update

Reporting Issues

Found a bug or have a suggestion? Please report it on the GitHub Issues page.

When reporting issues, please include:

  • OS version (macOS / Linux distribution)
  • Error messages (if any)
  • Steps to reproduce
  • Expected vs actual behavior

License

These dotfiles are released under the CC0 1.0 Universal license.

CC0

Inspired By

About

mac dotfiles with some linux remarks πŸ—οΈ

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors