Objective
Do only one thing: determine whether the current machine can continue to carry out the relevant development tasks; if it cannot, automatically fill in the gaps as much as possible based on the machine's existing capabilities.
Base version requirements
- Java/Javac: the major version must be 25 or above.
- Maven: must be 3.9.10 or above.
Must confirm first
Before writing to hosts, you must clearly ask the user for their office location:
- Chongqing office: use
references/cq-required-hosts.txt, script parameter is--office cq - Beijing office: use
references/bj-required-hosts.txt, script parameter is--office bj
If the user has not confirmed their office location, only diagnostics and non-hosts fixes are allowed; do not guess the hosts configuration.
Workflow
-
First confirm whether the user works in Chongqing or Beijing.
-
Run
reportmode, diagnostics only without writing.reporta return code of2means the environment is not ready, and does not indicate a script error.
python3 scripts/bootstrap_env.py --mode report --office cq
python3 scripts/bootstrap_env.py --mode report --office bj
- If the report shows the environment is incomplete, after confirming with the user whether to automatically repair it, run
applymode.
python3 scripts/bootstrap_env.py --mode apply --office cq
python3 scripts/bootstrap_env.py --mode apply --office bj
-
If automatic installation is blocked by system permissions, report the missing items and the permission conditions the user needs to handle. Do not fake a successful installation.
-
Only install the internal CLI when a subsequent task actually needs to operate on the internal platform.
python3 scripts/bootstrap_env.py --mode apply --office cq --install-internal-clis
- After repairing, run
reportonce more, and output the final status.
What the script is responsible for
- Identify system information: operating system, platform, architecture, Shell, PATH, home directory, hosts file path.
- Identify system tools:
git、python3、node、npm、npx、pipx、jq、rg、mvn、pnpm、java、javac、curl、wget、sudo, etc. - Identify SDKMAN and package managers: SDKMAN,
brew、apt-get、dnf、yum、pacman、zypper、winget、choco。 - By default, only scan each
skills/eliteforge-*/SKILL.mdtop-level file's## Environment Variablessection, and identify skill environment variables according to theeliteforge-skill-specspecified`ELITEFORGE_SKILL_<ABBR>_<PURPOSE>` [optional|required|conditional] descformat; only report variable names and missing status, do not print variable values. - Attempt to install the required commands:
git、python3、node、npm、npx、pipx、jq、rg、pnpm, Java/Javac 25 or above, Maven 3.9.10 or above. - When automatically installing Java/Javac and Maven, if the current machine already has SDKMAN installed and it can be initialized, SDKMAN must be prioritized for installation; if SDKMAN is unavailable or the installation fails, fall back to the system package manager.
- Install the required Python CLI packages via
pipx:pre-commit。 - Configure
~/.npmrc's npm private registry. - Configure
~/.pip/pip.conf's pip private registry. - Check the Git global configuration:
user.namemust be configured and must not be a placeholder; using a personal Chinese name is recommended, but Chinese characters are not used as a readiness gate.user.emailmust be configured and must not be a placeholder; using a valid company email is recommended.init.defaultBranch=mastercolor.ui=autopager.branch=falsepager.status=falsecore.quotePath=falsehttp.https://git.cisdigital.cn.proxy=empty value
- Rewrite
git.cisdigital.cn's SSH address to HTTPS. - Maintain according to the confirmed office location
/etc/hosts。
Security rules
- Do not hard-code, commit to the repository, or directly print passwords, Tokens, or shared credentials.
- Private source credentials are governed by the online "must-know" documentation; the script only maintains non-sensitive source address configuration, and does not require or read local private source credential environment variables.
- Git personal identity configuration must be performed manually by the user with
git config --global user.name "你的姓名"andgit config --global user.email "公司邮箱"; the script does not write it automatically.user.name/user.emailreadiness determination is based on "configured and not a placeholder"; non-Chinese names or non-standard email addresses are only advisory prompts and are not blocking items. - When private source authentication information is needed, prompt the user to write it into the local configuration themselves according to the online "must-know" documentation; do not require the user to send passwords or Tokens in plaintext in the conversation.
- If
/etc/hostsalready has the same domain pointing to another IP, do not overwrite it, and must report the conflict. - When writing hosts, only maintain the script marker block; do not clear the user's existing content.
- System installation and hosts writing only attempt what can be done automatically; when interactive sudo, administrator privileges, account provisioning, or project authorization is needed, report it as a blocker.
git.cisdigital.cnHTTPS is preferred; do not require users to switch to SSH cloning.
Script parameters
--mode report|apply:reportonly checks;applywrites security fixes and attempts to install missing dependencies.--office cq|bj: required business parameter, confirmed by the user; usecqfor Chongqing, andbj。--package-manager auto|brew|apt-get|dnf|yum|pacman|zypper|winget|choco: force specification when automatic detection is inaccurate. This parameter only controls the system package manager fallback path; Java/Javac and Maven still preferentially try SDKMAN.--home-dirand--hosts-file: can point to temporary paths for verification without polluting the real machine.--skills-root: specifies the directory where theeliteforge-*skill is located; by default it is inferred from the script location as the repositoryskillsdirectory.--skip-install: skip tool installation, but still apply configuration file fixes.--install-internal-clis: installs or upgrades the internal Python CLI viapipx.
Output rules
- The summary must be short and actionable, and at least cover:
system、SDKMAN、package manager、tools、hosts、npm/pip mirrors、git global config、git https rewrite、pipx packages、skill_env_vars、remaining blockers。 - If
applywas run, it must clearly state which files were changed, which installation commands were executed, and which items were blocked by permissions or accounts. skill_env_varsmust be reported separately asmissing_required、missing_conditional、optional_unsetthree categories; onlymissing_requiredand the already triggeredmissing_conditionalare environment readiness blockers.- If
skill_env_vars.missing_requiredorskill_env_vars.missing_conditionalis non-empty, the user must be prompted to configure the corresponding environment variables; do not require the user to send passwords or Tokens in plaintext in the conversation. - For matters that still require human handling, point out the specific conditions or files; do not copy reference materials wholesale.
Reference materials
references/onboarding-checklist.md: human prerequisites, private source credentials, security boundaries.references/cq-required-hosts.txt: Chongqing office hosts.references/bj-required-hosts.txt: Beijing office hosts.