{"id":45866891,"url":"https://github.com/kirkchen/devbox","last_synced_at":"2026-02-27T08:56:31.158Z","repository":{"id":337408477,"uuid":"1036573676","full_name":"kirkchen/devbox","owner":"kirkchen","description":null,"archived":false,"fork":false,"pushed_at":"2026-02-20T14:35:29.000Z","size":175,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-20T18:20:01.348Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kirkchen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-12T09:18:28.000Z","updated_at":"2026-02-20T14:35:32.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/kirkchen/devbox","commit_stats":null,"previous_names":["kirkchen/devbox"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kirkchen/devbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirkchen%2Fdevbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirkchen%2Fdevbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirkchen%2Fdevbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirkchen%2Fdevbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kirkchen","download_url":"https://codeload.github.com/kirkchen/devbox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kirkchen%2Fdevbox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29888591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T08:34:21.514Z","status":"ssl_error","status_checked_at":"2026-02-27T08:32:38.035Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-27T08:56:30.454Z","updated_at":"2026-02-27T08:56:31.153Z","avatar_url":"https://github.com/kirkchen.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Universal DevContainer with Chezmoi Dotfiles\n\nA minimal, robust development container setup with intelligent cross-platform dotfiles management using Chezmoi.\n\n## Features\n\n- 🐳 **DevContainer**: Pre-configured Ubuntu 22.04 environment with VS Code integration\n- 📦 **Prebuilt Image**: Published to GitHub Container Registry for fast startup in other projects\n- 🔧 **Chezmoi**: Smart dotfiles management with automatic environment detection\n- 🚀 **Oh-My-Zsh**: Bullet-train theme with essential plugins\n- 🛠️ **Modern CLI Tools**: fzf, eza, bat, ag, lazygit, delta, and more\n- 🖥️ **Multi-Environment Support**: Automatic detection for macOS, Linux, and DevContainers\n- ⚙️ **Minimal Configuration**: Only asks for name and email\n- 🛡️ **Defensive Programming**: Robust error handling and fallback mechanisms\n- 🤖 **Claude Code Integration**: Pre-configured settings, plugins, and MCP servers\n\n## Quick Start\n\n### Option 1: Use Prebuilt Image in Your Projects (Fastest)\n\nFor the fastest setup in your other projects, use the prebuilt image from GitHub Container Registry:\n\n1. Copy the `.devcontainer/devcontainer.json` from this repo to your project\n2. Replace the `build` section with:\n   ```json\n   \"image\": \"ghcr.io/kirkchen/devbox-devcontainer:latest\"\n   ```\n3. Keep only the features you need (most are already in the image):\n   ```json\n   \"features\": {\n     \"ghcr.io/schlich/devcontainer-features/playwright:0\": {}\n   }\n   ```\n4. Open in VS Code with Dev Containers extension\n\n**Startup time: ~30 seconds** instead of 5-10 minutes!\n\n### Option 2: Using This DevContainer (Development)\n\n1. Open this folder in VS Code\n2. Install the \"Dev Containers\" extension if not already installed\n3. Press `Cmd/Ctrl + Shift + P` and select \"Dev Containers: Reopen in Container\"\n4. After the container builds, run `setup-dotfiles` to configure your environment\n5. Follow the prompts to enter your name and email\n\n### Option 3: Local Setup (macOS/Linux)\n\n1. Install Chezmoi:\n\n   ```bash\n   # macOS\n   brew install chezmoi\n\n   # Linux\n   sh -c \"$(curl -fsLS get.chezmoi.io)\"\n   ```\n\n2. Initialize from this repository:\n\n   ```bash\n   # From the devbox directory\n   chezmoi init --source=\"./chezmoi\" --apply\n   ```\n\n3. Follow the interactive prompts to configure:\n   - Your name\n   - Your email\n   - GitHub token (optional, for MCP server)\n\n## Directory Structure\n\n```\ndevbox/\n├── .devcontainer/           # DevContainer configuration\n│   ├── devcontainer.json    # Container settings\n│   ├── Dockerfile           # Multi-arch container image\n│   └── scripts/\n│       ├── setup-dotfiles.sh # Interactive dotfiles setup\n│       └── welcome.sh       # Welcome message\n├── .github/\n│   └── workflows/\n│       └── build-devcontainer.yml # Automated image building\n├── chezmoi/                 # Chezmoi-managed dotfiles\n│   ├── .chezmoi.toml.tmpl   # Interactive configuration template\n│   ├── .chezmoiignore       # Files to ignore\n│   ├── .chezmoiscripts/     # One-time setup scripts\n│   │   ├── run_once_01-install-oh-my-zsh.sh\n│   │   ├── run_once_02-install-cli-tools.sh.tmpl\n│   │   └── run_once_04-install-claude-plugins.sh\n│   ├── dot_gitconfig.tmpl   # Git configuration\n│   ├── dot_zshrc.tmpl       # Zsh configuration\n│   ├── dot_claude.json.tmpl # Claude Code MCP servers\n│   ├── dot_vimrc            # Vim configuration\n│   ├── private_dot_claude/  # Claude Code settings\n│   │   ├── settings.json.tmpl\n│   │   ├── settings.md      # Settings documentation\n│   │   └── CLAUDE.md.tmpl   # Development guidelines\n│   └── private_dot_config/\n│       ├── lazygit/\n│       │   └── config.yml   # Lazygit config (delta pager)\n│       ├── zsh/             # Modular Zsh configs\n│       │   ├── oh-my-zsh.zsh\n│       │   ├── core.zsh.tmpl\n│       │   ├── tools.zsh      # macOS: Homebrew, rbenv, NVM, pnpm\n│       │   ├── functions.zsh  # Cross-platform: now(), fixup()\n│       │   ├── functions-macos.zsh # macOS: code()\n│       │   ├── aliases.zsh    # Git, K8s, tools aliases\n│       │   └── gitpod.zsh     # Gitpod environment management\n│       └── raycast/\n│           └── scripts/       # macOS Raycast scripts\n└── install.sh               # Automated installation script\n```\n\n## Included Tools\n\n### Shell \u0026 Terminal\n\n- **Zsh**: Modern shell with Oh-My-Zsh framework\n- **Theme**: Bullet-train theme with proper font support\n\n### CLI Tools\n\n- **fzf**: Fuzzy finder with intelligent fallback (ag → rg → find)\n- **eza**: Modern replacement for ls (successor to exa)\n- **bat**: Cat with syntax highlighting (multi-architecture support)\n- **ag**: The Silver Searcher for fast code search\n- **lazygit**: Git TUI (uses delta as pager)\n- **delta**: Modern git diff viewer (side-by-side, line numbers)\n- **htop**: Interactive process viewer\n- **direnv**: Environment variable management\n\n### Development\n\n- **Git**: Version control with defensive aliases\n- **Vim**: Text editor with essential plugins (NERDTree, fzf.vim, CoC)\n- **VS Code**: Integrated with DevContainer\n- **Claude Code**: Pre-configured with plugins and MCP servers\n\n### macOS Specific\n\n- **Homebrew**: Package manager integration\n- **rbenv**: Ruby version management (if installed)\n- **NVM**: Node.js version management (if installed)\n- **pnpm**: Fast package manager (if installed)\n- **Raycast**: WiFi management scripts\n\n## Configuration\n\n### Interactive Setup\n\nWhen you first run `chezmoi init` or `setup-dotfiles`, you'll be prompted for:\n\n- **Name**: Used in Git commits and configurations\n- **Email**: Used in Git configuration\n- **GitHub Token**: Optional, for Claude Code MCP server\n\nThe system automatically detects your environment (macOS, Linux, or DevContainer) and configures accordingly.\n\n### Shell Aliases\n\n#### Git Aliases (with comments)\n\n| Alias | Command | Description |\n|-------|---------|-------------|\n| `gbr` | `git branch` | 列出分支 |\n| `gcbr` | `git rev-parse --abbrev-ref HEAD` | 顯示目前分支名稱 |\n| `gpsu` | `git push --set-upstream origin $(gcbr)` | 推送並設定 upstream |\n| `gcoi` | Interactive checkout with fzf | 互動式切換分支 |\n| `gmi` | Interactive merge with fzf | 互動式合併分支 |\n| `gmdb` | Delete branches by namespace | 刪除指定 namespace 的分支 |\n| `gdt` | `git difftool` | 開啟 diff 工具 |\n| `,,` | `cd $(git rev-parse --show-toplevel)` | 跳到 git repo 根目錄 |\n\n#### Kubernetes Aliases\n\n| Alias | Description |\n|-------|-------------|\n| `kctxi` | 互動式切換 Kubernetes context |\n| `knsi` | 互動式切換 Kubernetes namespace |\n\n#### Tool Aliases\n\n| Alias | Description |\n|-------|-------------|\n| `lg` | lazygit |\n| `cat` | bat (if installed) |\n| `ls/ll/lt` | eza with icons (if installed) |\n\n### Shell Functions\n\n| Function | Description |\n|----------|-------------|\n| `now` | 輸出 UTC 時間戳記 (YYYYMMDDHHmmss) |\n| `fixup \u003cmsg\u003e` | 建立 fixup commit 並自動 rebase |\n| `code [path]` | 用 VS Code 開啟檔案或目錄 (macOS) |\n\n### Gitpod Environment Management (Linux/DevContainer)\n\n```bash\ngpenv start   # Start a stopped environment and optionally SSH into it\ngpenv stop    # Stop a running environment\ngpenv ssh     # SSH into a running environment\ngpenv open    # Open a running environment in browser\ngpenv list    # List all environments\n\n# Shortcut aliases\ngps / gpt / gpsh / gpo / gpl\n```\n\n### Claude Code Configuration\n\nPre-configured with:\n\n- **Status Line**: Shows `🌿 branch | model | directory`\n- **Plugins**: code-review, superpowers\n- **Language**: Traditional Chinese (zh-TW)\n- **Security**: Blocks reading `.env*` and `secrets/` files\n- **MCP Servers**: sequential-thinking, context7, github (if token provided)\n\n## Prebuilt Image\n\nThis repository automatically publishes a prebuilt Docker image to GitHub Container Registry, perfect for use in other projects.\n\n### Available Image\n\n- `ghcr.io/kirkchen/devbox-devcontainer:latest`\n\n### Automatic Updates\n\nGitHub Actions automatically builds and publishes new images when:\n\n- `.devcontainer/Dockerfile` is modified (pushed to main branch)\n- Manually triggered via GitHub Actions\n\n## Updating Dotfiles\n\n### Modify Templates\n\n1. Edit files in the `chezmoi/` directory\n2. Apply changes: `chezmoi apply --source=\"./chezmoi\"`\n\n### Add New Files\n\n1. Add to chezmoi: `chezmoi add ~/.config/newfile --source=\"./chezmoi\"`\n2. Commit changes to repository\n\n### Sync Across Machines\n\n```bash\n# Pull latest changes\ncd ~/Code/devbox\ngit pull\n\n# Apply to current machine\nchezmoi apply --source=\"./chezmoi\"\n```\n\n## Key Features\n\n### Defensive Programming\n\n- **Command existence checks**: Aliases only created if commands exist\n- **Intelligent fallbacks**: FZF uses ag → rg → find chain\n- **Confirmation prompts**: Destructive operations require confirmation\n- **Error handling**: Proper error suppression and handling\n- **Platform detection**: Automatic environment adaptation\n\n### Environment Detection\n\nThe configuration automatically detects and adapts to:\n\n- **macOS**: Homebrew paths, version managers, Raycast scripts\n- **Linux**: APT/DNF package managers, Linux paths\n- **DevContainer**: Container-optimized settings, Gitpod management\n\n## Troubleshooting\n\n### Font Issues\n\nIf Powerline symbols don't align:\n\n1. Install a Nerd Font (see Fonts section)\n2. Set terminal font to the Mono variant\n3. Restart terminal\n\n### Permission Issues\n\n```bash\n# Fix script permissions\nchmod +x .devcontainer/scripts/*.sh\nchmod +x chezmoi/.chezmoiscripts/*.sh\n```\n\n### Chezmoi Not Found\n\n```bash\n# Install manually\ncurl -fsLS get.chezmoi.io | sh\nexport PATH=\"$HOME/.local/bin:$PATH\"\n```\n\n### Tool Not Available\n\nThe configuration includes fallbacks for missing tools:\n\n- If `bat` is not available, `cat` works normally\n- If `eza` is not available, `ls` is used\n- If `ag` is not available, `rg` or `find` is used for FZF\n\n## Fonts\n\nFor the best terminal experience, install a Nerd Font:\n\n- [SauceCodePro Nerd Font](https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/SourceCodePro)\n- [MesloLGS NF](https://github.com/romkatv/powerlevel10k#meslo-nerd-font-patched-for-powerlevel10k)\n\n## License\n\nMIT\n\n## Contributing\n\nFeel free to submit issues and pull requests to improve this setup!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkirkchen%2Fdevbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkirkchen%2Fdevbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkirkchen%2Fdevbox/lists"}