# easy-init **Repository Path**: jun33/easy-init ## Basic Information - **Project Name**: easy-init - **Description**: easy-init - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-04-24 - **Last Updated**: 2026-04-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # easy-init `easy-init` 用来快速初始化一台新的开发机器,默认只做最常用的一条安装链路: - macOS / Linux 安装 `Homebrew` - Windows 安装 `Scoop` - 安装核心软件:`git`、`openjdk`、`maven`、`anaconda`、`node`、`pnpm` - 安装浏览器:`chrome` - 可选安装:`docker` - 可选配置:`pip`、`conda` 镜像源 ## 设计原则 - 足够简单:首版不做复杂 profile,不做系统级全局安装分支 - 交互最少:只保留必要的目录选择和几个确认步骤 - 幂等执行:检测到软件已安装时直接跳过,不重复安装 ## 用法 ### 方式一:本地执行 macOS / Linux: ```bash chmod +x bootstrap.sh bin/easy-init ./bootstrap.sh ``` Windows PowerShell: ```powershell Set-ExecutionPolicy RemoteSigned -Scope CurrentUser .\bootstrap.ps1 ``` ### 方式二:远程拉起 macOS / Linux: ```bash curl -fsSL https://gitee.com/jun33/easy-init/raw/master/bootstrap.sh | bash ``` Windows PowerShell: ```powershell Set-ExecutionPolicy RemoteSigned -Scope CurrentUser irm https://gitee.com/jun33/easy-init/raw/master/bootstrap.ps1 | iex ``` 如果使用远程拉起,需要提前设置仓库地址: - `EASY_INIT_REPO_URL` - `EASY_INIT_BRANCH`,默认 `master` 如果直接使用官方仓库: - 不需要预装 `git` - 不需要提前设置 `EASY_INIT_REPO_URL` - bootstrap 会优先用 `git clone`,如果本机没有 `git`,就直接下载脚本文件后继续执行 示例: ```bash curl -fsSL https://gitee.com/jun33/easy-init/raw/master/bootstrap.sh | bash ``` Windows 示例: ```powershell irm https://gitee.com/jun33/easy-init/raw/master/bootstrap.ps1 | iex ``` ## 执行流程 1. 选择工作目录 2. 检查并安装 `brew` 或 `scoop` 3. 检查并安装 `brew` 时,macOS 使用 `HomebrewCN` 的 `zsh` 安装脚本,Linux 使用 `bash` 安装脚本 4. 默认安装 `git/openjdk21/maven/anaconda/node/pnpm` 5. 默认安装 `chrome` 6. 询问是否配置 `pip` 镜像源 7. macOS / Linux / Windows 都会先展示任务选择菜单 8. 选中“安装核心软件”后,会继续展示具体包列表供选择 9. 选中的 `pip` / `conda` / `docker` / `chrome` 任务才会执行 安装阶段会先检测目标软件是否已存在: - `brew` 软件用 `brew list` 检测 - `scoop` 软件用 `SCOOP/apps//current` 检测 - 已安装的软件会直接跳过,不重复执行安装 Windows 交互优化: - 先选任务:核心软件、Chrome、Python 镜像源、Docker - 再选具体核心软件:`git`、`openjdk21`、`maven`、`anaconda3`、`nodejs-lts`、`pnpm` - 输入格式为逗号分隔编号,直接回车使用默认选项 Unix 交互优化: - `curl | bash` 场景下,交互输入会从 `/dev/tty` 读取,不会因为标准输入被占用而直接走默认值 - macOS 会显示任务菜单:核心软件、Chrome、Python 镜像源、Docker - Linux 会显示任务菜单:核心软件、Chrome、Python 镜像源、Docker ## Windows 约束 - 只使用用户级 `SCOOP` - 不使用 `Machine` 级环境变量 - 默认不走管理员级全局安装 ## 当前支持的软件 macOS / Linux: - `git` - `openjdk@21` - `maven` - `anaconda` - `node` - `pnpm` Windows: - `git` - `openjdk21` - `maven` - `anaconda3` - `nodejs-lts` - `pnpm` - `extras/googlechrome` 浏览器: - macOS: `google-chrome` - Linux: 用户显式选择后安装 `google-chrome` - Windows: `extras/googlechrome` 可选扩展: - macOS: `docker` via `brew install --cask docker` - Linux: `docker` 和 `docker-compose` - Windows: `docker-desktop` ## 仓库结构 ```text . ├── bootstrap.sh ├── bootstrap.ps1 ├── bin/ │ ├── easy-init │ └── easy-init.ps1 ├── lib/ │ ├── common.sh │ ├── common.ps1 │ ├── unix-installer.sh │ └── windows-installer.ps1 ├── docs/plans/ └── state/ ``` ## 后续扩展 后续如果软件范围扩大,再把固定软件清单抽成配置文件,避免首版为了“可配置”牺牲脚本可读性和稳定性。