One-click dev environment setup for Linux / macOS. Default shells: bash + zsh (Oh My Zsh); Fish is optional (see below). Also vimrc, tmux, etc.
--yes for non-interactive mode; --force to re-run / reinstallcommon/Brewfile + optional common/Brewfile.optional; --new-mac for new-machine checksconfig/mirrors.bash + linked ~/.npmrc / ~/.cargo/config.tomlconfig/triton.bashconfig/resetrc.bash holds all shared env as # SECTION: … blocks (nvm, pyenv, CUDA, LLVM, …). Edit that file to affect bash, zsh, and profiles; optional Fish uses the same file via emit_fish_env.bash when linked.What touches the system
$HOME (and standard XDG paths) are modified by default, via common/link.ini → create_links.sh: symlinks such as ~/.bashrc, ~/.zshrc, ~/.my-utils.env, ~/.shell_init.bash, etc. Fish symlinks are commented out in link.ini until you opt in.config/resetrc.bash, shell_init.bash, …). No /etc patches are required for this dotfiles layout.common/misc.sh may run chsh to zsh after Oh My Zsh install—that does change the login shell in /etc/passwd (or equivalent). Remove or guard that block if you want zero account-level changes.Multi-OS
common/install_packages.sh + common/deb_app_list.ini / common/Brewfile (macOS; falls back to common/mac_app_list.txt) / common/rpm_app_list.ini. Already-installed packages are skipped unless --force. Optional GUI/mas set: common/Brewfile.optional.config/resetrc.bash uses _is_linux / _is_macos inside sections (PATH, CUDA, brew kegs, …). Mainland mirrors: config/mirrors.bash (default on; MY_UTILS_MIRRORS=off in ~/.env.rc to disable env mirrors).Multi-shell
resetrc.bash (bash-compatible); config/shell_init.bash loads bash_interactive.bash or config/zsh_entry.zsh (Oh My Zsh), then resetrc + optional_home.bash.fish yourself (apt/brew/…), uncomment the Fish lines in common/link.ini, run ./bootstrap.sh --tools links --yes. Then config/emit_fish_env.bash + config/fish/my-utils.fish import exported variables from resetrc; aliases/functions are not auto-ported.Gaps (by choice)
~/.bashrc / ~/.zshrc won’t load my-utils unless you add a one-liner to ~/.profile or ~/.zprofile pointing at shell_init / resetrc—not linked by default to keep the installer conservative.中文概要: 默认 packages 只装 zsh(含 Oh My Zsh 相关),不装 Fish;Fish 相关 symlink 在 link.ini 里默认注释,需用时自行安装 fish 并取消注释后再跑 links。misc 里 chsh 可能把登录 shell 改为 zsh。
git clone https://github.com/blueyi/my-utils.git ~/workspace/my-utils
cd ~/workspace/my-utils
./myu help # unified CLI (short for my-utils)
# One-shot init (no prompts): packages, links, misc, vimrc, cursor
./myu setup --yes
# same as: ./bootstrap.sh --yes
exec $SHELL
# 1) Xcode CLT (if needed)
xcode-select --install
# 2) Sign in to the Mac App Store (required for Brewfile `mas` entries)
# 3) Clone and bootstrap
git clone https://github.com/blueyi/my-utils.git ~/workspace/my-utils
cd ~/workspace/my-utils
./myu setup --new-mac --yes
# Optional extra apps (discord, lark, Telegram, …):
./myu packages --optional --yes
# Privacy vault (prompt for password ≥8 chars; decrypt privacy/*.enc):
# ./myu vault restore
# Re-run is safe: successful tools and already-installed packages are skipped.
# Force a full redo:
./myu setup --new-mac --force --yes
exec $SHELL
Edit common/Brewfile for the core macOS set; put extras in common/Brewfile.optional. Changing either file (when used) invalidates the packages stamp. Changing common/link.ini invalidates the links stamp so new symlinks (e.g. npmrc / cargo) apply on the next --yes.
Default on after links + shell init:
config/mirrors.bash~/.npmrc → config/npm/npmrc; ~/.cargo/config.toml → config/cargo/config.tomlDisable env mirrors: export MY_UTILS_MIRRORS=off in ~/.env.rc. Unlink the two files to fully revert npm/Cargo registries.
Preferred entry: ./myu (short for my-utils). bootstrap.sh still works as the underlying runner.
./myu help
./myu setup --yes # packages links misc vimrc cursor
./myu packages --yes
./myu packages --optional --yes
./myu links --force --yes
./myu vault backup # encrypt → privacy/*.enc
./myu vault restore # decrypt (password prompt, ≥8 chars)
./myu setup --new-mac --yes # includes vault restore
# Equivalent low-level:
./bootstrap.sh --tools env --yes
./bootstrap.sh --tools vault-backup --yes
Idempotency: successful tools write stamps under ~/.local/state/my-utils/bootstrap/. Later runs skip those tools unless --force. packages also re-runs when Brewfile (+ optional, if used) changes; links re-runs when link.ini changes. Within packages, already-installed apt/yum/brew packages are skipped unless --force (then reinstall).
~/.vimrc, ~/.bashrc, ~/.zshrc symlink to files under config/. ~/.p10k.zsh → config/p10k.zsh (Powerlevel10k; edit in repo, re-run links if needed). ~/.bashrc / ~/.zshrc end with source ~/.shell_init.bash, which runs config/shell_init.bash: zsh → Oh My Zsh + p10k + resetrc.bash; bash → interactive defaults + resetrc.bash. All shared env lives in config/resetrc.bash as ordered # SECTION: … blocks (proxy, PATH, nvm, pyenv, zsh-only OpenClaw/fzf, CUDA, LLVM, …). Zsh-only bits are guarded with ZSH_VERSION inside that file.
config/
├── _vimrc, _bashrc, _zshrc → ~/.vimrc, ~/.bashrc, ~/.zshrc
├── p10k.zsh → ~/.p10k.zsh (Powerlevel10k theme)
├── shell_init.bash → ~/.shell_init.bash
├── resetrc.bash # monolithic env (comment sections; search SECTION:)
├── mirrors.bash # Mainland China env mirrors (GOPROXY, NODEJS_ORG_MIRROR, …)
├── npm/npmrc → ~/.npmrc
├── cargo/config.toml → ~/.cargo/config.toml
├── zprofile.brew.bash # reference snippet; misc appends brew shellenv to ~/.zprofile
├── sections/README.md # pointer only (old split layout archived in deprecated/)
├── bash_interactive.bash # bash-only prompt, completion
├── zsh_entry.zsh # Oh My Zsh + theme/plugins, then resetrc
├── path.bash, cmake_env.bash # thin → resetrc (IDE one-liners)
├── emit_fish_env.bash, fish/my-utils.fish # optional Fish; symlink via commented lines in link.ini
├── triton.bash # optional GPU/Triton layer on top of resetrc
├── deprecated/ # archive (see deprecated/README.md)
└── ...
Not installed or linked by default. Steps: sudo apt install fish (or brew install fish) → uncomment the two Fish lines in common/link.ini → ./bootstrap.sh --tools links --yes. Then Fish loads my-utils.fish, which runs emit_fish_env.bash to mirror resetrc.bash + optional_home.bash exports. For pyenv in Fish, see pyenv init - fish upstream.
# Preset profiles (manual source)
source ~/repos/my-utils/profiles/cpp/env.bash # C++ / LLVM
source ~/repos/my-utils/profiles/python/env.bash # Python
source ~/repos/my-utils/profiles/ai_infra/env.bash # AI Infra
# Triton (GPU kernel) dev
source "$MYRC_PATH/triton.bash"
If you see:
CMake was unable to find a build program corresponding to "Ninja"CMAKE_C_COMPILER not set / CMAKE_CXX_COMPILER not setQuick fix (any terminal, including Cursor/IDE): source the CMake env script before running cmake so PATH, CC, CXX, and CMAKE_MAKE_PROGRAM are set:
# Replace with your actual my-utils path if different
source ~/workspace/my-utils/config/cmake_env.bash
# or, if MY_UTILS_ROOT is already set:
source "$MY_UTILS_ROOT/config/cmake_env.bash"
cd /path/to/your/project/build
cmake ..
macOS:
PATH: Homebrew and baseline paths are set in config/resetrc.bash when you use the linked rc. If your terminal didn’t load it (e.g. Cursor’s built-in terminal), use the source .../config/cmake_env.bash one-liner above (it sources resetrc.bash).
C/C++ compiler: Install Xcode Command Line Tools so clang is available:
xcode-select --install
Linux (apt): Install packages with ./bootstrap.sh --tools packages --yes. If the terminal didn’t load your rc, run source .../config/cmake_env.bash before cmake.
gdr)Interactive git is always the real git (never wrapped). Dual-remote lives only in gdr.
When GitHub is slow/blocked and you keep a GitCode mirror under the same namespace (blueyi/…):
git pull -r # native git
gdr pull -r # dual: pull origin; on timeout → gitcode
gdr push # push GitHub then GitCode (OK if either succeeds)
gdr fetch origin
gdr clone git@github.com:blueyi/foo.git
gdr setup # wire origin + gitcode remotes for current repo
gdr setup --scan ~/workspace/repos
gdr lives at common/gdr (MY_BIN / common/ is on PATH after shell init). Defaults: config/git-dual-remote.env.
Password-encrypt machine-local secrets into privacy/*.enc, commit ciphertext to GitHub, and restore on a new machine after clone.
| Command | Purpose |
|---|---|
./myu vault backup | Encrypt paths in privacy/manifest |
./myu vault restore | Decrypt into $HOME (prompts if SYNC_ENV_KEY unset) |
./myu vault encrypt -i SRC -o DST.enc | Encrypt one file |
./myu vault decrypt -i SRC.enc [-o DST] | Decrypt one file (stdout if -o omitted) |
./myu setup --new-mac | Bootstrap + restore at the end |
# Old machine (batch)
./myu vault backup
git add privacy/*.enc privacy/manifest && git commit -m "Update privacy vault" && git push
# Single file
./myu vault encrypt -i ~/.ssh/config -o privacy/ssh-config.enc
./myu vault decrypt -i privacy/ssh-config.enc -o ~/.ssh/config
# New machine
./myu vault restore
Password: SYNC_ENV_KEY or interactive prompt, ≥8 characters. Crypto: OpenSSL AES-256-CBC + PBKDF2. Edit privacy/manifest (name|mode|path). Modes: file, env-merge.
Sync Cursor settings to cursor_bak/ and use symlinks so edits stay in the repo. Backed up (macOS: ~/Library/Application Support/Cursor, Linux: ~/.config/Cursor):
cursor_bak/rulescursor_bak/projects (per-workspace state; terminals/, agent-transcripts/, mcps/ schema caches, and canvases/{node_modules,tsconfig.json} are gitignored — user MCP config is in User/mcp.json)Included in default tool list (both ./bootstrap.sh --yes and interactive ./bootstrap.sh will include cursor unless you use --tools to limit):
./bootstrap.sh --yes # runs cursor step with others
./bootstrap.sh --tools cursor --yes # only Cursor config link
./bootstrap.sh --tools cursor # interactive: ask then link
# Standalone:
./common/cursor_config_link.sh # Link
./common/cursor_config_link.sh --restore # Restore original paths
MIT
283 commits
Shell
72.2%
Python
8.1%
Vim Script
7.3%
TypeScript
4.8%
JavaScript
4.1%
CSS
2.5%
One-click dev environment setup for Linux / macOS. Default shells: bash + zsh (Oh My Zsh); Fish is optional (see below). Also vimrc, tmux, etc.
--yes for non-interactive mode; --force to re-run / reinstallcommon/Brewfile + optional common/Brewfile.optional; --new-mac for new-machine checksconfig/mirrors.bash + linked ~/.npmrc / ~/.cargo/config.tomlconfig/triton.bashconfig/resetrc.bash holds all shared env as # SECTION: … blocks (nvm, pyenv, CUDA, LLVM, …). Edit that file to affect bash, zsh, and profiles; optional Fish uses the same file via emit_fish_env.bash when linked.What touches the system
$HOME (and standard XDG paths) are modified by default, via common/link.ini → create_links.sh: symlinks such as ~/.bashrc, ~/.zshrc, ~/.my-utils.env, ~/.shell_init.bash, etc. Fish symlinks are commented out in link.ini until you opt in.config/resetrc.bash, shell_init.bash, …). No /etc patches are required for this dotfiles layout.common/misc.sh may run chsh to zsh after Oh My Zsh install—that does change the login shell in /etc/passwd (or equivalent). Remove or guard that block if you want zero account-level changes.Multi-OS
common/install_packages.sh + common/deb_app_list.ini / common/Brewfile (macOS; falls back to common/mac_app_list.txt) / common/rpm_app_list.ini. Already-installed packages are skipped unless --force. Optional GUI/mas set: common/Brewfile.optional.config/resetrc.bash uses _is_linux / _is_macos inside sections (PATH, CUDA, brew kegs, …). Mainland mirrors: config/mirrors.bash (default on; MY_UTILS_MIRRORS=off in ~/.env.rc to disable env mirrors).Multi-shell
resetrc.bash (bash-compatible); config/shell_init.bash loads bash_interactive.bash or config/zsh_entry.zsh (Oh My Zsh), then resetrc + optional_home.bash.fish yourself (apt/brew/…), uncomment the Fish lines in common/link.ini, run ./bootstrap.sh --tools links --yes. Then config/emit_fish_env.bash + config/fish/my-utils.fish import exported variables from resetrc; aliases/functions are not auto-ported.Gaps (by choice)
~/.bashrc / ~/.zshrc won’t load my-utils unless you add a one-liner to ~/.profile or ~/.zprofile pointing at shell_init / resetrc—not linked by default to keep the installer conservative.中文概要: 默认 packages 只装 zsh(含 Oh My Zsh 相关),不装 Fish;Fish 相关 symlink 在 link.ini 里默认注释,需用时自行安装 fish 并取消注释后再跑 links。misc 里 chsh 可能把登录 shell 改为 zsh。
git clone https://github.com/blueyi/my-utils.git ~/workspace/my-utils
cd ~/workspace/my-utils
./myu help # unified CLI (short for my-utils)
# One-shot init (no prompts): packages, links, misc, vimrc, cursor
./myu setup --yes
# same as: ./bootstrap.sh --yes
exec $SHELL
# 1) Xcode CLT (if needed)
xcode-select --install
# 2) Sign in to the Mac App Store (required for Brewfile `mas` entries)
# 3) Clone and bootstrap
git clone https://github.com/blueyi/my-utils.git ~/workspace/my-utils
cd ~/workspace/my-utils
./myu setup --new-mac --yes
# Optional extra apps (discord, lark, Telegram, …):
./myu packages --optional --yes
# Privacy vault (prompt for password ≥8 chars; decrypt privacy/*.enc):
# ./myu vault restore
# Re-run is safe: successful tools and already-installed packages are skipped.
# Force a full redo:
./myu setup --new-mac --force --yes
exec $SHELL
Edit common/Brewfile for the core macOS set; put extras in common/Brewfile.optional. Changing either file (when used) invalidates the packages stamp. Changing common/link.ini invalidates the links stamp so new symlinks (e.g. npmrc / cargo) apply on the next --yes.
Default on after links + shell init:
config/mirrors.bash~/.npmrc → config/npm/npmrc; ~/.cargo/config.toml → config/cargo/config.tomlDisable env mirrors: export MY_UTILS_MIRRORS=off in ~/.env.rc. Unlink the two files to fully revert npm/Cargo registries.
Preferred entry: ./myu (short for my-utils). bootstrap.sh still works as the underlying runner.
./myu help
./myu setup --yes # packages links misc vimrc cursor
./myu packages --yes
./myu packages --optional --yes
./myu links --force --yes
./myu vault backup # encrypt → privacy/*.enc
./myu vault restore # decrypt (password prompt, ≥8 chars)
./myu setup --new-mac --yes # includes vault restore
# Equivalent low-level:
./bootstrap.sh --tools env --yes
./bootstrap.sh --tools vault-backup --yes
Idempotency: successful tools write stamps under ~/.local/state/my-utils/bootstrap/. Later runs skip those tools unless --force. packages also re-runs when Brewfile (+ optional, if used) changes; links re-runs when link.ini changes. Within packages, already-installed apt/yum/brew packages are skipped unless --force (then reinstall).
~/.vimrc, ~/.bashrc, ~/.zshrc symlink to files under config/. ~/.p10k.zsh → config/p10k.zsh (Powerlevel10k; edit in repo, re-run links if needed). ~/.bashrc / ~/.zshrc end with source ~/.shell_init.bash, which runs config/shell_init.bash: zsh → Oh My Zsh + p10k + resetrc.bash; bash → interactive defaults + resetrc.bash. All shared env lives in config/resetrc.bash as ordered # SECTION: … blocks (proxy, PATH, nvm, pyenv, zsh-only OpenClaw/fzf, CUDA, LLVM, …). Zsh-only bits are guarded with ZSH_VERSION inside that file.
config/
├── _vimrc, _bashrc, _zshrc → ~/.vimrc, ~/.bashrc, ~/.zshrc
├── p10k.zsh → ~/.p10k.zsh (Powerlevel10k theme)
├── shell_init.bash → ~/.shell_init.bash
├── resetrc.bash # monolithic env (comment sections; search SECTION:)
├── mirrors.bash # Mainland China env mirrors (GOPROXY, NODEJS_ORG_MIRROR, …)
├── npm/npmrc → ~/.npmrc
├── cargo/config.toml → ~/.cargo/config.toml
├── zprofile.brew.bash # reference snippet; misc appends brew shellenv to ~/.zprofile
├── sections/README.md # pointer only (old split layout archived in deprecated/)
├── bash_interactive.bash # bash-only prompt, completion
├── zsh_entry.zsh # Oh My Zsh + theme/plugins, then resetrc
├── path.bash, cmake_env.bash # thin → resetrc (IDE one-liners)
├── emit_fish_env.bash, fish/my-utils.fish # optional Fish; symlink via commented lines in link.ini
├── triton.bash # optional GPU/Triton layer on top of resetrc
├── deprecated/ # archive (see deprecated/README.md)
└── ...
Not installed or linked by default. Steps: sudo apt install fish (or brew install fish) → uncomment the two Fish lines in common/link.ini → ./bootstrap.sh --tools links --yes. Then Fish loads my-utils.fish, which runs emit_fish_env.bash to mirror resetrc.bash + optional_home.bash exports. For pyenv in Fish, see pyenv init - fish upstream.
# Preset profiles (manual source)
source ~/repos/my-utils/profiles/cpp/env.bash # C++ / LLVM
source ~/repos/my-utils/profiles/python/env.bash # Python
source ~/repos/my-utils/profiles/ai_infra/env.bash # AI Infra
# Triton (GPU kernel) dev
source "$MYRC_PATH/triton.bash"
If you see:
CMake was unable to find a build program corresponding to "Ninja"CMAKE_C_COMPILER not set / CMAKE_CXX_COMPILER not setQuick fix (any terminal, including Cursor/IDE): source the CMake env script before running cmake so PATH, CC, CXX, and CMAKE_MAKE_PROGRAM are set:
# Replace with your actual my-utils path if different
source ~/workspace/my-utils/config/cmake_env.bash
# or, if MY_UTILS_ROOT is already set:
source "$MY_UTILS_ROOT/config/cmake_env.bash"
cd /path/to/your/project/build
cmake ..
macOS:
PATH: Homebrew and baseline paths are set in config/resetrc.bash when you use the linked rc. If your terminal didn’t load it (e.g. Cursor’s built-in terminal), use the source .../config/cmake_env.bash one-liner above (it sources resetrc.bash).
C/C++ compiler: Install Xcode Command Line Tools so clang is available:
xcode-select --install
Linux (apt): Install packages with ./bootstrap.sh --tools packages --yes. If the terminal didn’t load your rc, run source .../config/cmake_env.bash before cmake.
gdr)Interactive git is always the real git (never wrapped). Dual-remote lives only in gdr.
When GitHub is slow/blocked and you keep a GitCode mirror under the same namespace (blueyi/…):
git pull -r # native git
gdr pull -r # dual: pull origin; on timeout → gitcode
gdr push # push GitHub then GitCode (OK if either succeeds)
gdr fetch origin
gdr clone git@github.com:blueyi/foo.git
gdr setup # wire origin + gitcode remotes for current repo
gdr setup --scan ~/workspace/repos
gdr lives at common/gdr (MY_BIN / common/ is on PATH after shell init). Defaults: config/git-dual-remote.env.
Password-encrypt machine-local secrets into privacy/*.enc, commit ciphertext to GitHub, and restore on a new machine after clone.
| Command | Purpose |
|---|---|
./myu vault backup | Encrypt paths in privacy/manifest |
./myu vault restore | Decrypt into $HOME (prompts if SYNC_ENV_KEY unset) |
./myu vault encrypt -i SRC -o DST.enc | Encrypt one file |
./myu vault decrypt -i SRC.enc [-o DST] | Decrypt one file (stdout if -o omitted) |
./myu setup --new-mac | Bootstrap + restore at the end |
# Old machine (batch)
./myu vault backup
git add privacy/*.enc privacy/manifest && git commit -m "Update privacy vault" && git push
# Single file
./myu vault encrypt -i ~/.ssh/config -o privacy/ssh-config.enc
./myu vault decrypt -i privacy/ssh-config.enc -o ~/.ssh/config
# New machine
./myu vault restore
Password: SYNC_ENV_KEY or interactive prompt, ≥8 characters. Crypto: OpenSSL AES-256-CBC + PBKDF2. Edit privacy/manifest (name|mode|path). Modes: file, env-merge.
Sync Cursor settings to cursor_bak/ and use symlinks so edits stay in the repo. Backed up (macOS: ~/Library/Application Support/Cursor, Linux: ~/.config/Cursor):
cursor_bak/rulescursor_bak/projects (per-workspace state; terminals/, agent-transcripts/, mcps/ schema caches, and canvases/{node_modules,tsconfig.json} are gitignored — user MCP config is in User/mcp.json)Included in default tool list (both ./bootstrap.sh --yes and interactive ./bootstrap.sh will include cursor unless you use --tools to limit):
./bootstrap.sh --yes # runs cursor step with others
./bootstrap.sh --tools cursor --yes # only Cursor config link
./bootstrap.sh --tools cursor # interactive: ask then link
# Standalone:
./common/cursor_config_link.sh # Link
./common/cursor_config_link.sh --restore # Restore original paths
MIT
283 commits
Shell
72.2%
Python
8.1%
Vim Script
7.3%
TypeScript
4.8%
JavaScript
4.1%
CSS
2.5%