SuperAPI AI Directory

soia-env-claude-cli-install

Deployment & operations

View repository

Updated 10-16 08:26

About this skill

soia-env-claude-cli-install

Install and verify the standalone Anthropic Claude Code CLI (command claude). The Agent handles terminal operations; the customer only needs to state the goal and complete login in the official browser or system authorization interface.

Customer-readable instructions

What this skill can do

The customer wants The skill will do The customer can see
Install Claude Code Check the system and existing sources, and install using the official user-level channel Current version, source, installation directory, and verification results
Check or update Compare the current version with the official latest version; after explicit authorization, update along the original source "No update needed", "Update available, not performed", or "Updated"
Log in to Claude Start the official claude login flow Browser authorization steps, without displaying credentials
Command unavailable Check PATH, duplicate installations, and claude doctor Blocking cause and safe remediation plan

How the customer uses it

  1. The customer directly says "Help me install Claude Code CLI"; the customer is not required to copy terminal commands.
  2. The Agent first performs read-only checks and shows the plan. The customer's installation request only authorizes installing the missing CLI, not updating an existing version.
  3. When only "Update Claude" is said, first show the two versions and ask whether to update to the latest; only explicit statements such as "Update to the latest version" invoke the updater.
  4. When login is needed, the Agent starts the flow, and the customer only clicks authorize on the official Anthropic page; the customer must not be asked to send authorization codes, API keys, or passwords into the chat.
  5. After installation, update, and login, separately verify the standalone CLI's version, help command, diagnostic results, and login status.

First login and real configuration verification

  • 配置文件目录Only show candidate directories; the skill must simultaneously read config_status and config_file_status, and must not treat the default path as "configured".
  • If ~/.claude or settings.json has not yet been created, the Agent starts claudein the project selected by the customer, and Claude Code displays the official login options; the customer completes authorization only on the official Anthropic page or in the official Claude app.
  • If the customer chooses the Anthropic API method, the customer creates and keeps the API key themselves in the Anthropic Console; the Agent only checks the "exists/can authenticate" result and does not receive or echo the key.
  • After login is complete, rerun claude doctor and the skill check script; if browser authorization has not been completed, the processing result must say "Waiting for first login" and must not say "Running normally".

Dependencies and installation

Dependencies Type What to do when missing
macOS, Linux, or Windows Hard dependency Use only systems and architectures supported by the official documentation
Node.js/npm npm channel dependency Not needed for the official standalone installation; only invoke when choosing npm soia-env-node-install
Network diagnostics Optional prerequisite Invoke when the official site fails soia-env-network-diagnose, without automatically modifying the network
Anthropic account Login dependency The customer completes authorization in the official browser; the Agent does not read credentials

For official sources, package names, configuration, and auto-update facts, see official-sources.md。

Domestic network environment note: if npm channel installation times out or download fails, first switch to the npmmirror domestic mirror and retry, then switch back to the official source as needed; for latest version queries, use the official npm registry, and under restricted networks truthfully write "not obtained" rather than guessing:

npm config set registry https://registry.npmmirror.com   # 切国内镜像
npm config set registry https://registry.npmjs.org       # 切回官方源

Standard process

  1. Run python3 scripts/inspect_cli.py --json, read-only obtain the standalone command, current version, actual path, installation method, configuration directory, and whether the configuration directory/file actually exists.
  2. Run python3 scripts/check_latest.py --json, obtain the latest version from the official npm release metadata; on failure write "not obtained" and do not guess.
  3. Installed and runnable:当前状态 Always write "installed". Without authorization for the latest version, stop; do not reinstall or update.
  4. Not installed: prefer the official standalone installation; only use this when the customer chooses npm npm install -g @anthropic-ai/claude-code. When installing a network script, first download it to the system temporary directory, check the source and contents, then execute the local copy; do not directly execute a network response.
  5. Update to latest: for the official standalone source use claude update; for the npm source use npm install -g @anthropic-ai/claude-code@latest; for the Homebrew source, first identify the actual cask, then update along that cask. Do not switch sources in passing.
  6. Verify the same absolute path's --version、--help and doctor. When login status is unclear, start the official login process; login is completed by the customer in the browser.
  7. Re-run the two check scripts to use scripts/render_status.py generate a one-line customer status list.

Product auto-update boundary

  • This skill's "do not update by default" means the Agent does not call the installer or updater. Claude Code itself may have auto-update enabled, which must be disclosed in the status explanation.
  • Read-only checks must not modify autoUpdates、DISABLE_AUTOUPDATER or any configuration.
  • When the customer explicitly requests to turn off or turn on product auto-update, first show the impact, then modify according to the official setting and re-check; that configuration authorization does not equal authorization for this update.

Customer status list (mandatory)

The reply must begin with the following ten-column table, output only one row Claude Code CLI:

Skill Current status Current version Latest version Running status Installation method Installation directory Configuration file directory Update time Handling result
Claude Code CLI <installed/not installed/blocked> <version or not obtained> <version or not obtained> <normal/abnormal/unverified> <official standalone installation/Homebrew installation/npm global installation/not obtained> <directory or not obtained> <directory or not obtained> <installed/already latest/updatable, not executed/awaiting confirmation whether to update to latest/updated/blocked: reason>
  • When the user only asks about Claude Code CLI, do not add rows for Node.js, npm, Codex, Claude desktop products, or other skills.
  • 更新时间 Must be generated after final verification; installation directory and configuration directory should preferentially show ~ relative paths to avoid exposing usernames.
  • After updating 当前状态 still write "Installed", and put the update result only in 处理结果。
  • when multiple claude are found, report the copy actually in effect for the current login shell and indicate the conflict; do not delete the other copies.
  • when the latest version cannot be obtained, write "not obtained"; do not substitute a cached, remembered, or other product version.
  • config_status=未创建 or config_file_status=未创建 , write the processing result as "awaiting first login/configuration" and provide the startup command and official authorization method; do not print only a nonexistent path.

Intermediate states of installation and update

when actually changing the machine, generate a random run_idfor this run, call scripts/record_install_progress.pyimmediately at each actual stage, and display the stage list in sync. Read-only checks do not create records.

checking → planning → [waiting_confirmation] → installing/updating → verifying → completed/failed/blocked
Stage Current status Update time Processing result
<check/plan/awaiting confirmation/install or update/verify/complete or failed> <in progress/waiting/completed/failed/blocked> <redacted result>
  • installation uses --action install; update uses --action update。
  • only when the customer explicitly requests the latest version may the update stage pass --customer-requested-latest; the recorder will reject unauthorized updates.
  • records store only the fixed result_code, stage, and time; they do not store full commands, accounts, tokens, response bodies, or customer-private absolute paths.

Permissions and rollback

  • prefer user-level installation; do not use sudoby default. When administrator privileges are needed, the shell profile must be modified, the source must be switched, or an existing command must be overwritten, show the plan first and obtain separate confirmation.
  • before updating, record the old version and source; on failure, keep the original installation and do not automatically uninstall, downgrade, clean up configuration, or disable automatic updates.
  • network scripts and installation packages are stored only in a system temporary directory unique to each run, and are cleaned up on success, failure, or cancellation.

Private information and intermediate data

  • login credentials are managed by the official Claude login state or the system credential store; do not read or copy the credential contents in ~/.claude .
  • non-secret configuration stays in the official configuration directory; SOIA does not create a separate key file.
  • redacted stage records of machine changes are stored in the user state directory and rotated by default according to the repository storage specification; read-only flows do not write to disk by default.
  • do not store API keys, authorization codes, cookies, sessions, accounts, or private paths in repositories, ordinary configuration, logs, or receipts.

Logs and completion receipt

the final receipt includes a fixed ten-column table, the verified command categories, whether browser authorization is required, and the original version recoverable on failure. Normal dependencies are not expanded into extra rows.

Example: one real check

actual results of steps 1 and 2 of the standard flow executed on a real macOS (arm64) machine on 2026-08-08 (paths redacted via ~ , data preserved verbatim):

inspect_cli.py --json key fields:

Field Actual value
current_status Installed
current_version 2.1.226
install_method Homebrew installation
install_dir /opt/homebrew/Caskroom/claude-code@latest/2.1.226
config_status / config_file_status Created / already exists
runtime_status Normal

check_latest.py --json:latest_version 2.1.226(source: npm)。

final ten-column customer status table (render_status.py actual rendering):

Skill Current status Current version Latest version Running status Installation method Installation directory Configuration file directory Update time Processing result
Claude Code CLI Installed 2.1.226 2.1.226 Normal Homebrew installation /opt/homebrew/Caskroom/claude-code@latest/2.1.226 ~/.claude 2026-08-08T16:25:10+08:00 Already up to date

One real detail: on this machine, at 14:40 that day the version was still 2.1.224, and by 16:25 it was already 2.1.226—Homebrew claude-code@latest channel product auto-update is working, which is exactly the situation required to be disclosed by the section "Product auto-update boundaries."

What it is not responsible for (capability boundaries)

  • Does not complete login and authorization on behalf of the customer: browser authorization, verification codes, and API key creation are all completed by the customer on Anthropic's official pages; it does not read, receive, or echo any credentials
  • Does not update installed versions by default: "help me install" only authorizes installing what is missing; updating requires an explicit statement at the level of "update to the latest version"
  • Does not touch the system: does not by default sudo, does not modify the shell profile or PATH, and does not uninstall or clean up other claude copies on the machine (if multiple copies are found, it only reports the conflict)
  • Is not responsible for the Claude desktop app or account billing: it only handles CLI installation, checking, updating, and login guidance

Forward testing

Use a temporary fake claude to cover not installed, installed, abnormal versions, and multiple PATH copies; mock the npm latest-version response; verify ten-column rendering,~ path masking, not updating by default, and the recorder refusing when there is no explicit latest-version authorization updating。

install the entire domain (Claude Code and Codex share the same domain plugin):

claude plugin marketplace add soia-team/soia-open-skills
claude plugin install soia-env@soia

install only this one skill:

npx skills add soia-team/soia-open-env-skills -g -a '*' -s soia-env-claude-cli-install -y

WorkBuddy 's installation unit is role-based experts rather than plugins,npx skills add -a '*' cannot cover it, so it needs to be installed separately; see docs/install/workbuddy.md。