Universal installer for AI CLI agents (defaults to npm)
npm install axinstallInstall AI CLI agents (Claude Code, Codex, Gemini, etc.) in any environment.
``bashInstall Claude Code globally
npx -y axinstall "claude"
Prerequisites
- Node.js >=22.14.0
- Use
pnpm dlx (recommended) or npx (bundled with npm) for one-off runs
- Examples assume a POSIX shell (sh/bash/zsh); adjust for PowerShell or CMDBy default,
axinstall installs agents using npm. This means npm must be
available unless you explicitly override the installer:-
--with (e.g., --with "pnpm")
- AXINSTALL_WITH=Supported installers:
- npm
- pnpm
- bun
- yarn
- Homebrew (
brew)Conventions
- Prefer long flags in scripts (
--verbose instead of -v)
- Examples include explicit quoting for flag values and arguments$3
Override the default binary lookup by setting environment variables:
`bash
export AXINSTALL_NPM_PATH=/path/to/npm
export AXINSTALL_PNPM_PATH=/path/to/pnpm
export AXINSTALL_BUN_PATH=/path/to/bun
export AXINSTALL_YARN_PATH=/path/to/yarn
export AXINSTALL_BREW_PATH=/path/to/brew
`Examples
$3
`bash
Install using npm (default)
npx -y axinstall "claude"
npx -y axinstall "codex"
npx -y axinstall "gemini"Force a specific package manager
npx -y axinstall "claude" --with "npm"
npx -y axinstall "opencode" --with "brew"Install locally (not globally)
npx -y axinstall "claude" --local
`$3
`bash
Get list of agent CLI names
npx -y axinstall --list-agents | tail -n +2 | cut -f1Find agents from a specific provider
npx -y axinstall --list-agents | tail -n +2 | awk -F'\t' '$4 == "Anthropic" {print $1}'Get available installers only
npx -y axinstall --status --only "installers" | tail -n +2 | awk -F'\t' '$4 == "available" {print $2}'Count installed vs not found agents
npx -y axinstall --status --only "agents" | tail -n +2 | cut -f4 | sort | uniq -c
`Output
--list-agents prints a tab-separated header and rows with columns:`
CLI NAME PACKAGE PROVIDER
`--status prints a tab-separated header and rows with columns:`
TYPE ID NAME STATUS VERSION PROVIDER PACKAGE
`-
TYPE values: AGENT | INSTALLER
- STATUS values:
- for AGENT: installed | not_found
- for INSTALLER: available | not_found
- --only values: "all" | "agents" | "installers"Agent Rule
Add to your
CLAUDE.md or AGENTS.md:`markdown
Rule:
axinstall UsageRun
npx -y axinstall --help to learn available options.Use
axinstall to install AI CLI agents in any environment. It uses the
requested package manager (via --with / AXINSTALL_WITH) and uses npm
by default.
``MIT