axinstall 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -2
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +17 -12
- package/dist/detect-agent.js +2 -2
- package/dist/detect-installer.d.ts +7 -7
- package/dist/detect-installer.js +13 -14
- package/dist/handle-install.d.ts +1 -1
- package/dist/handle-install.js +22 -32
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/installer-data.d.ts +12 -3
- package/dist/installer-data.js +18 -9
- package/dist/resolve-installer-command.js +2 -1
- package/dist/run-command.d.ts +1 -1
- package/dist/run-command.js +12 -7
- package/dist/validate-cli-options.d.ts +1 -1
- package/dist/validate-cli-options.js +4 -3
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -8,12 +8,18 @@ Install AI CLI agents (Claude Code, Codex, Gemini, etc.) in any environment.
|
|
|
8
8
|
# Install Claude Code globally
|
|
9
9
|
npx axinstall claude
|
|
10
10
|
|
|
11
|
+
# Install multiple agents in one command
|
|
12
|
+
npx axinstall claude codex gemini opencode copilot
|
|
13
|
+
|
|
11
14
|
# Install with a specific package manager
|
|
12
15
|
npx axinstall claude --with npm
|
|
13
16
|
|
|
14
17
|
# Preview what would be installed (dry run)
|
|
15
18
|
npx axinstall claude --dry-run
|
|
16
19
|
|
|
20
|
+
# Enable verbose output
|
|
21
|
+
npx axinstall claude --verbose
|
|
22
|
+
|
|
17
23
|
# List supported agents
|
|
18
24
|
npx axinstall --list-agents
|
|
19
25
|
|
|
@@ -43,15 +49,22 @@ export AXINSTALL_YARN_PATH=/path/to/yarn
|
|
|
43
49
|
export AXINSTALL_BREW_PATH=/path/to/brew
|
|
44
50
|
```
|
|
45
51
|
|
|
52
|
+
Choose a default installer via environment variable:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
export AXINSTALL_WITH=pnpm
|
|
56
|
+
```
|
|
57
|
+
|
|
46
58
|
## Examples
|
|
47
59
|
|
|
48
60
|
### Install agents
|
|
49
61
|
|
|
50
62
|
```bash
|
|
51
|
-
# Install using auto-detected package manager (pnpm > bun > yarn >
|
|
63
|
+
# Install using auto-detected package manager (npm > pnpm > bun > yarn > brew)
|
|
52
64
|
axinstall claude
|
|
53
65
|
axinstall codex
|
|
54
66
|
axinstall gemini
|
|
67
|
+
axinstall claude codex gemini opencode copilot
|
|
55
68
|
|
|
56
69
|
# Force a specific package manager
|
|
57
70
|
axinstall claude --with npm
|
|
@@ -87,7 +100,7 @@ Add to your `CLAUDE.md` or `AGENTS.md`:
|
|
|
87
100
|
Run `npx -y axinstall --help` to learn available options.
|
|
88
101
|
|
|
89
102
|
Use `axinstall` to install AI CLI agents in any environment. It auto-detects
|
|
90
|
-
the best available package manager (pnpm, bun, yarn,
|
|
103
|
+
the best available package manager (npm, pnpm, bun, yarn, brew) and handles
|
|
91
104
|
the installation with a single command.
|
|
92
105
|
```
|
|
93
106
|
|
package/dist/cli.d.ts
CHANGED
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* axinstall - AI agent installation CLI.
|
|
4
4
|
*
|
|
5
5
|
* Installs CLI agents (Claude Code, Codex, Gemini, etc.) using
|
|
6
|
-
*
|
|
6
|
+
* npm by default (override via --with or AXINSTALL_WITH).
|
|
7
7
|
*/
|
|
8
8
|
import { Command } from "@commander-js/extra-typings";
|
|
9
9
|
import { AGENT_CLIS } from "axshared";
|
|
@@ -31,33 +31,38 @@ const program = new Command()
|
|
|
31
31
|
.showSuggestionAfterError()
|
|
32
32
|
.option("--list-agents", "List supported agents")
|
|
33
33
|
.option("--status", "Show installed agents and available package managers")
|
|
34
|
-
.option("--only <scope>", "Limit --status output (agents|installers). Default: all.")
|
|
34
|
+
.option("--only <scope>", "Limit --status output (all|agents|installers). Default: all.")
|
|
35
35
|
.option("-v, --verbose", "Enable verbose output")
|
|
36
36
|
.addHelpText("after", `
|
|
37
37
|
Examples:
|
|
38
|
-
$ axinstall claude Install Claude Code globally
|
|
39
|
-
$ axinstall claude
|
|
40
|
-
$ axinstall claude --
|
|
41
|
-
$ axinstall claude --
|
|
38
|
+
$ axinstall "claude" Install Claude Code globally
|
|
39
|
+
$ axinstall "claude" "codex" "gemini" Install multiple agents sequentially
|
|
40
|
+
$ axinstall "claude" --local Install to node_modules/.bin
|
|
41
|
+
$ axinstall "claude" --with "npm" Use specific package manager
|
|
42
|
+
$ axinstall "claude" --dry-run Preview installation command
|
|
42
43
|
$ axinstall --list-agents | tail -n +2 | cut -f1 List agent CLI names
|
|
43
|
-
$ axinstall --status --only installers | grep available Show available installers
|
|
44
|
+
$ axinstall --status --only "installers" | grep available Show available installers
|
|
44
45
|
|
|
45
46
|
Environment:
|
|
46
|
-
AXINSTALL_WITH
|
|
47
|
+
AXINSTALL_WITH Force package manager (${INSTALLER_NAMES})
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
Default:
|
|
50
|
+
npm (requires npm unless overridden)
|
|
51
|
+
To use pnpm/bun/yarn/brew, pass --with <installer> or set AXINSTALL_WITH=<installer>.
|
|
52
|
+
|
|
53
|
+
Supported installers:
|
|
49
54
|
${INSTALLER_NAMES}
|
|
50
55
|
Override paths: ${INSTALLER_ENV_VARS}`);
|
|
51
56
|
// =============================================================================
|
|
52
57
|
// Install / List / Status (Default)
|
|
53
58
|
// =============================================================================
|
|
54
59
|
program
|
|
55
|
-
.argument("[
|
|
60
|
+
.argument("[agents...]", `Agents to install (${AGENT_CLIS.join(", ")})`)
|
|
56
61
|
.option("--with <installer>", `Package manager to use (${INSTALLER_IDS.join(", ")})`)
|
|
57
62
|
.option("--local", "Install to node_modules/.bin (run via package runner)", false)
|
|
58
63
|
.option("--dry-run", "Show command without executing", false)
|
|
59
|
-
.action((
|
|
60
|
-
runCommand(
|
|
64
|
+
.action((agentClis, cliOptions) => {
|
|
65
|
+
runCommand(agentClis, cliOptions);
|
|
61
66
|
});
|
|
62
67
|
// =============================================================================
|
|
63
68
|
// Parse and Execute
|
package/dist/detect-agent.js
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Detects which AI agents are installed in the current environment.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { execFileSync } from "node:child_process";
|
|
7
7
|
import { getAllAgents } from "axshared";
|
|
8
8
|
/**
|
|
9
9
|
* Check if a single agent is installed by running `<cli> --version`.
|
|
10
10
|
*/
|
|
11
11
|
function checkAgent(agent) {
|
|
12
12
|
try {
|
|
13
|
-
const output =
|
|
13
|
+
const output = execFileSync(agent.cli, ["--version"], {
|
|
14
14
|
encoding: "utf8",
|
|
15
15
|
stdio: ["pipe", "pipe", "pipe"],
|
|
16
16
|
}).trim();
|
|
@@ -16,14 +16,14 @@ declare function checkAllInstallers(): InstallerCheckResult[];
|
|
|
16
16
|
* Get all available installers.
|
|
17
17
|
*/
|
|
18
18
|
declare function getAvailableInstallers(): Installer[];
|
|
19
|
-
/**
|
|
20
|
-
* Auto-detect the best available installer based on priority.
|
|
21
|
-
*
|
|
22
|
-
* Priority order: npm > pnpm > bun > yarn > brew
|
|
23
|
-
*/
|
|
24
|
-
declare function detectBestInstaller(): Installer | undefined;
|
|
25
19
|
/**
|
|
26
20
|
* Check if a specific installer is available.
|
|
27
21
|
*/
|
|
28
22
|
declare function isInstallerAvailable(id: InstallerId): boolean;
|
|
29
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Detect the best available installer based on `INSTALLER_PRIORITY`.
|
|
25
|
+
*
|
|
26
|
+
* Retained for library consumers; the CLI defaults to npm unless overridden.
|
|
27
|
+
*/
|
|
28
|
+
declare function detectBestInstaller(): Installer | undefined;
|
|
29
|
+
export { checkInstaller, checkAllInstallers, getAvailableInstallers, isInstallerAvailable, detectBestInstaller, };
|
package/dist/detect-installer.js
CHANGED
|
@@ -46,24 +46,23 @@ function getAvailableInstallers() {
|
|
|
46
46
|
.map((result) => result.installer);
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* Check if a specific installer is available.
|
|
50
|
+
*/
|
|
51
|
+
function isInstallerAvailable(id) {
|
|
52
|
+
const installer = getInstaller(id);
|
|
53
|
+
return checkInstaller(installer).available;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Detect the best available installer based on `INSTALLER_PRIORITY`.
|
|
50
57
|
*
|
|
51
|
-
*
|
|
58
|
+
* Retained for library consumers; the CLI defaults to npm unless overridden.
|
|
52
59
|
*/
|
|
53
60
|
function detectBestInstaller() {
|
|
54
|
-
const available = new Set(getAvailableInstallers().map((installer) => installer.id));
|
|
55
61
|
for (const id of INSTALLER_PRIORITY) {
|
|
56
|
-
if (
|
|
57
|
-
|
|
58
|
-
|
|
62
|
+
if (!isInstallerAvailable(id))
|
|
63
|
+
continue;
|
|
64
|
+
return getInstaller(id);
|
|
59
65
|
}
|
|
60
66
|
return undefined;
|
|
61
67
|
}
|
|
62
|
-
|
|
63
|
-
* Check if a specific installer is available.
|
|
64
|
-
*/
|
|
65
|
-
function isInstallerAvailable(id) {
|
|
66
|
-
const installer = getInstaller(id);
|
|
67
|
-
return checkInstaller(installer).available;
|
|
68
|
-
}
|
|
69
|
-
export { checkInstaller, checkAllInstallers, getAvailableInstallers, detectBestInstaller, isInstallerAvailable, };
|
|
68
|
+
export { checkInstaller, checkAllInstallers, getAvailableInstallers, isInstallerAvailable, detectBestInstaller, };
|
package/dist/handle-install.d.ts
CHANGED
package/dist/handle-install.js
CHANGED
|
@@ -2,22 +2,24 @@
|
|
|
2
2
|
* Agent installation handler.
|
|
3
3
|
*/
|
|
4
4
|
import { AGENT_CLIS, getAgent, isValidAgentCli } from "axshared";
|
|
5
|
-
import {
|
|
5
|
+
import { isInstallerAvailable } from "./detect-installer.js";
|
|
6
6
|
import { executeInstall } from "./execute-install.js";
|
|
7
7
|
import { getAllInstallers, getInstaller } from "./installer-data.js";
|
|
8
8
|
import { resolveInstallerCommand } from "./resolve-installer-command.js";
|
|
9
9
|
import { INSTALLER_IDS } from "./types.js";
|
|
10
10
|
const INSTALLER_ID_SET = new Set(INSTALLER_IDS);
|
|
11
11
|
const INSTALLER_NAMES = INSTALLER_IDS.join(", ");
|
|
12
|
-
const INSTALLER_ENV_VARS = INSTALLER_IDS.map((id) => getInstaller(id).envVar).join(", ");
|
|
13
12
|
function isInstallerId(value) {
|
|
14
13
|
return INSTALLER_ID_SET.has(value);
|
|
15
14
|
}
|
|
16
15
|
function reportMissingInstaller(installer) {
|
|
17
16
|
const command = resolveInstallerCommand(installer);
|
|
18
17
|
console.error(`Error: Installer '${installer.id}' not available`);
|
|
19
|
-
|
|
18
|
+
// Escape control characters/newlines from env-var-controlled paths without
|
|
19
|
+
// adding surrounding quotes.
|
|
20
|
+
console.error(`Looked for: ${JSON.stringify(command).slice(1, -1)}`);
|
|
20
21
|
console.error(`Install ${installer.name} and try again.`);
|
|
22
|
+
console.error(`To use a different installer, pass --with <installer> (${INSTALLER_NAMES}) or set AXINSTALL_WITH=<installer>.`);
|
|
21
23
|
console.error(`Override path: ${installer.envVar}=/path/to/${installer.command}`);
|
|
22
24
|
console.error(`Run 'axinstall --status --only installers' to verify availability.`);
|
|
23
25
|
process.exitCode = 1;
|
|
@@ -28,35 +30,22 @@ export function handleInstall(agentCli, options) {
|
|
|
28
30
|
console.error(`Available: ${AGENT_CLIS.join(", ")}`);
|
|
29
31
|
console.error("Try 'axinstall --help' for usage information.");
|
|
30
32
|
process.exitCode = 1;
|
|
31
|
-
return;
|
|
33
|
+
return false;
|
|
32
34
|
}
|
|
33
35
|
const agent = getAgent(agentCli);
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
if (requestedInstaller) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
installer = getInstaller(requestedInstaller);
|
|
45
|
-
if (!isInstallerAvailable(requestedInstaller)) {
|
|
46
|
-
reportMissingInstaller(installer);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
36
|
+
const rawInstallerInput = options.with ?? process.env["AXINSTALL_WITH"];
|
|
37
|
+
const requestedInstaller = rawInstallerInput?.trim() || "npm";
|
|
38
|
+
if (!isInstallerId(requestedInstaller)) {
|
|
39
|
+
console.error(`Error: Unknown installer '${requestedInstaller}'`);
|
|
40
|
+
console.error(`Available: ${INSTALLER_IDS.join(", ")}`);
|
|
41
|
+
console.error("Try 'axinstall --help' for usage information.");
|
|
42
|
+
process.exitCode = 1;
|
|
43
|
+
return false;
|
|
49
44
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
console.error(`Install ${INSTALLER_NAMES} and try again.`);
|
|
55
|
-
console.error(`Override paths: ${INSTALLER_ENV_VARS}`);
|
|
56
|
-
console.error("Run 'axinstall --status --only installers' to verify availability.");
|
|
57
|
-
process.exitCode = 1;
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
45
|
+
const installer = getInstaller(requestedInstaller);
|
|
46
|
+
if (!isInstallerAvailable(requestedInstaller)) {
|
|
47
|
+
reportMissingInstaller(installer);
|
|
48
|
+
return false;
|
|
60
49
|
}
|
|
61
50
|
// Validate local installation support
|
|
62
51
|
if (options.local && !installer.localInstallArgs) {
|
|
@@ -67,7 +56,7 @@ export function handleInstall(agentCli, options) {
|
|
|
67
56
|
console.error(`Error: Installer '${installer.id}' does not support local installation`);
|
|
68
57
|
console.error(`Use a different installer: ${localInstallers}`);
|
|
69
58
|
process.exitCode = 1;
|
|
70
|
-
return;
|
|
59
|
+
return false;
|
|
71
60
|
}
|
|
72
61
|
const result = executeInstall({
|
|
73
62
|
agent,
|
|
@@ -77,7 +66,7 @@ export function handleInstall(agentCli, options) {
|
|
|
77
66
|
});
|
|
78
67
|
if (options.dryRun) {
|
|
79
68
|
console.log(result.command);
|
|
80
|
-
return;
|
|
69
|
+
return true;
|
|
81
70
|
}
|
|
82
71
|
if (result.ok) {
|
|
83
72
|
if (options.verbose) {
|
|
@@ -97,7 +86,7 @@ export function handleInstall(agentCli, options) {
|
|
|
97
86
|
console.error(`Run '${agent.cli}' to get started.`);
|
|
98
87
|
}
|
|
99
88
|
}
|
|
100
|
-
return;
|
|
89
|
+
return true;
|
|
101
90
|
}
|
|
102
91
|
console.error(`Error: Failed to install ${agent.name}`);
|
|
103
92
|
console.error(`Command: ${result.command}`);
|
|
@@ -105,4 +94,5 @@ export function handleInstall(agentCli, options) {
|
|
|
105
94
|
console.error(`Details: ${result.error.message}`);
|
|
106
95
|
}
|
|
107
96
|
process.exitCode = 1;
|
|
97
|
+
return false;
|
|
108
98
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { INSTALLER_IDS } from "./types.js";
|
|
7
7
|
export type { Installer, InstallerId, InstallerCheckResult } from "./types.js";
|
|
8
|
-
export { getInstaller, getAllInstallers, INSTALLERS,
|
|
9
|
-
export { checkInstaller, checkAllInstallers,
|
|
8
|
+
export { getInstaller, getAllInstallers, INSTALLERS, } from "./installer-data.js";
|
|
9
|
+
export { checkInstaller, checkAllInstallers, detectBestInstaller, getAvailableInstallers, isInstallerAvailable, } from "./detect-installer.js";
|
|
10
|
+
export { INSTALLER_PRIORITY } from "./installer-data.js";
|
|
10
11
|
export { checkAgent, checkAllAgents, getInstalledAgents, } from "./detect-agent.js";
|
|
11
12
|
export type { AgentCheckResult } from "./detect-agent.js";
|
|
12
13
|
export { buildInstallCommand, executeInstall } from "./execute-install.js";
|
package/dist/index.js
CHANGED
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
// Types
|
|
7
7
|
export { INSTALLER_IDS } from "./types.js";
|
|
8
8
|
// Installer data
|
|
9
|
-
export { getInstaller, getAllInstallers, INSTALLERS,
|
|
9
|
+
export { getInstaller, getAllInstallers, INSTALLERS, } from "./installer-data.js";
|
|
10
10
|
// Installer detection
|
|
11
|
-
export { checkInstaller, checkAllInstallers,
|
|
11
|
+
export { checkInstaller, checkAllInstallers, detectBestInstaller, getAvailableInstallers, isInstallerAvailable, } from "./detect-installer.js";
|
|
12
|
+
export { INSTALLER_PRIORITY } from "./installer-data.js";
|
|
12
13
|
// Agent detection
|
|
13
14
|
export { checkAgent, checkAllAgents, getInstalledAgents, } from "./detect-agent.js";
|
|
14
15
|
// Installation
|
package/dist/installer-data.d.ts
CHANGED
|
@@ -2,10 +2,19 @@
|
|
|
2
2
|
* Installer definitions and metadata.
|
|
3
3
|
*/
|
|
4
4
|
import type { Installer, InstallerId } from "./types.js";
|
|
5
|
+
/**
|
|
6
|
+
* Installer preference order used by `detectBestInstaller()` (library API).
|
|
7
|
+
*
|
|
8
|
+
* The CLI defaults to npm by design; this list is retained for programmatic
|
|
9
|
+
* consumers who want auto-detection.
|
|
10
|
+
*
|
|
11
|
+
* Note: Keep this order stable unless intentionally making a behavior change
|
|
12
|
+
* for library consumers.
|
|
13
|
+
*/
|
|
14
|
+
declare const INSTALLER_PRIORITY: readonly InstallerId[];
|
|
5
15
|
/** All installers indexed by ID */
|
|
6
16
|
declare const INSTALLERS: Record<InstallerId, Installer>;
|
|
7
|
-
/** Default priority order for auto-detection */
|
|
8
|
-
declare const INSTALLER_PRIORITY: readonly InstallerId[];
|
|
9
17
|
declare function getInstaller(id: InstallerId): Installer;
|
|
10
18
|
declare function getAllInstallers(): Installer[];
|
|
11
|
-
export { getInstaller, getAllInstallers, INSTALLERS
|
|
19
|
+
export { getInstaller, getAllInstallers, INSTALLERS };
|
|
20
|
+
export { INSTALLER_PRIORITY };
|
package/dist/installer-data.js
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Installer definitions and metadata.
|
|
3
3
|
*/
|
|
4
|
+
/**
|
|
5
|
+
* Installer preference order used by `detectBestInstaller()` (library API).
|
|
6
|
+
*
|
|
7
|
+
* The CLI defaults to npm by design; this list is retained for programmatic
|
|
8
|
+
* consumers who want auto-detection.
|
|
9
|
+
*
|
|
10
|
+
* Note: Keep this order stable unless intentionally making a behavior change
|
|
11
|
+
* for library consumers.
|
|
12
|
+
*/
|
|
13
|
+
const INSTALLER_PRIORITY = [
|
|
14
|
+
"npm",
|
|
15
|
+
"pnpm",
|
|
16
|
+
"bun",
|
|
17
|
+
"yarn",
|
|
18
|
+
"brew",
|
|
19
|
+
];
|
|
4
20
|
const npm = {
|
|
5
21
|
id: "npm",
|
|
6
22
|
name: "npm",
|
|
@@ -54,18 +70,11 @@ const INSTALLERS = {
|
|
|
54
70
|
yarn,
|
|
55
71
|
brew,
|
|
56
72
|
};
|
|
57
|
-
/** Default priority order for auto-detection */
|
|
58
|
-
const INSTALLER_PRIORITY = [
|
|
59
|
-
"npm",
|
|
60
|
-
"pnpm",
|
|
61
|
-
"bun",
|
|
62
|
-
"yarn",
|
|
63
|
-
"brew",
|
|
64
|
-
];
|
|
65
73
|
function getInstaller(id) {
|
|
66
74
|
return INSTALLERS[id];
|
|
67
75
|
}
|
|
68
76
|
function getAllInstallers() {
|
|
69
77
|
return Object.values(INSTALLERS);
|
|
70
78
|
}
|
|
71
|
-
export { getInstaller, getAllInstallers, INSTALLERS
|
|
79
|
+
export { getInstaller, getAllInstallers, INSTALLERS };
|
|
80
|
+
export { INSTALLER_PRIORITY };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
function resolveInstallerCommand(installer) {
|
|
2
2
|
const override = process.env[installer.envVar];
|
|
3
|
-
|
|
3
|
+
const trimmedOverride = override?.trim();
|
|
4
|
+
return trimmedOverride || installer.command;
|
|
4
5
|
}
|
|
5
6
|
export { resolveInstallerCommand };
|
package/dist/run-command.d.ts
CHANGED
package/dist/run-command.js
CHANGED
|
@@ -6,14 +6,14 @@ import { isStatusScope, printStatus, printSupportedAgents, } from "./print-statu
|
|
|
6
6
|
import { validateOptions } from "./validate-cli-options.js";
|
|
7
7
|
function reportUsageError(message) {
|
|
8
8
|
console.error(`Error: ${message}`);
|
|
9
|
-
console.error("Usage: axinstall [options]
|
|
9
|
+
console.error("Usage: axinstall [options] [agents...]");
|
|
10
10
|
console.error(" axinstall --list-agents");
|
|
11
11
|
console.error(" axinstall --status [--only <scope>]");
|
|
12
12
|
console.error("Try 'axinstall --help' for usage information.");
|
|
13
13
|
process.exitCode = 1;
|
|
14
14
|
}
|
|
15
|
-
export function runCommand(
|
|
16
|
-
const validation = validateOptions(
|
|
15
|
+
export function runCommand(agentClis, options) {
|
|
16
|
+
const validation = validateOptions(agentClis, options);
|
|
17
17
|
if (!validation.valid) {
|
|
18
18
|
reportUsageError(validation.message);
|
|
19
19
|
return;
|
|
@@ -25,15 +25,20 @@ export function runCommand(agentCli, options) {
|
|
|
25
25
|
if (options.status) {
|
|
26
26
|
const scopeInput = options.only?.toLowerCase() ?? "all";
|
|
27
27
|
if (!isStatusScope(scopeInput)) {
|
|
28
|
-
reportUsageError(`Invalid --only value '${options.only}'. Use agents or installers.`);
|
|
28
|
+
reportUsageError(`Invalid --only value '${options.only}'. Use all, agents, or installers.`);
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
31
|
printStatus(scopeInput);
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
if (!
|
|
35
|
-
reportUsageError("Missing required argument 'agent'.");
|
|
34
|
+
if (!agentClis || agentClis.length === 0) {
|
|
35
|
+
reportUsageError("Missing required argument 'agent(s)' (or use --list-agents/--status).");
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
for (const agentCli of agentClis) {
|
|
39
|
+
const installOk = handleInstall(agentCli, options);
|
|
40
|
+
if (!installOk) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
39
44
|
}
|
|
@@ -10,5 +10,5 @@ type ValidationSuccess = {
|
|
|
10
10
|
valid: true;
|
|
11
11
|
};
|
|
12
12
|
type ValidationResult = ValidationError | ValidationSuccess;
|
|
13
|
-
export declare function validateOptions(
|
|
13
|
+
export declare function validateOptions(agentClis: string[] | undefined, options: CliOptions): ValidationResult;
|
|
14
14
|
export {};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CLI option validation.
|
|
3
3
|
*/
|
|
4
|
-
export function validateOptions(
|
|
4
|
+
export function validateOptions(agentClis, options) {
|
|
5
|
+
const hasAgentArguments = Boolean(agentClis && agentClis.length > 0);
|
|
5
6
|
if (options.listAgents && options.status) {
|
|
6
7
|
return {
|
|
7
8
|
valid: false,
|
|
8
9
|
message: "Use either --list-agents or --status, not both.",
|
|
9
10
|
};
|
|
10
11
|
}
|
|
11
|
-
if ((options.listAgents || options.status) &&
|
|
12
|
+
if ((options.listAgents || options.status) && hasAgentArguments) {
|
|
12
13
|
return {
|
|
13
14
|
valid: false,
|
|
14
|
-
message: "Do not pass
|
|
15
|
+
message: "Do not pass agents when using --list-agents or --status.",
|
|
15
16
|
};
|
|
16
17
|
}
|
|
17
18
|
if ((options.listAgents || options.status) && options.with) {
|
package/package.json
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"name": "axinstall",
|
|
3
3
|
"author": "Łukasz Jerciński",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "1.
|
|
6
|
-
"description": "Universal installer for AI CLI agents
|
|
5
|
+
"version": "1.4.0",
|
|
6
|
+
"description": "Universal installer for AI CLI agents (defaults to npm)",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "git+https://github.com/Jercik/axinstall.git"
|
|
@@ -63,27 +63,27 @@
|
|
|
63
63
|
"automation",
|
|
64
64
|
"coding-assistant"
|
|
65
65
|
],
|
|
66
|
-
"packageManager": "pnpm@10.
|
|
66
|
+
"packageManager": "pnpm@10.28.1",
|
|
67
67
|
"engines": {
|
|
68
68
|
"node": ">=22.14.0"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"@commander-js/extra-typings": "^14.0.0",
|
|
72
|
-
"axshared": "^
|
|
73
|
-
"commander": "^14.0.
|
|
72
|
+
"axshared": "^5.0.0",
|
|
73
|
+
"commander": "^14.0.3"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
77
|
-
"@types/node": "^25.0
|
|
78
|
-
"@vitest/coverage-v8": "^4.0.
|
|
79
|
-
"eslint": "^
|
|
80
|
-
"eslint-config-axkit": "^1.
|
|
77
|
+
"@types/node": "^25.3.0",
|
|
78
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
79
|
+
"eslint": "^10.0.1",
|
|
80
|
+
"eslint-config-axkit": "^1.2.1",
|
|
81
81
|
"fta-check": "^1.5.1",
|
|
82
82
|
"fta-cli": "^3.0.0",
|
|
83
|
-
"knip": "^5.
|
|
84
|
-
"prettier": "3.
|
|
85
|
-
"semantic-release": "^25.0.
|
|
83
|
+
"knip": "^5.85.0",
|
|
84
|
+
"prettier": "3.8.1",
|
|
85
|
+
"semantic-release": "^25.0.3",
|
|
86
86
|
"typescript": "^5.9.3",
|
|
87
|
-
"vitest": "^4.0.
|
|
87
|
+
"vitest": "^4.0.18"
|
|
88
88
|
}
|
|
89
89
|
}
|