@anycap/cli 0.0.0 → 0.0.7

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.
Files changed (2) hide show
  1. package/bin/anycap +38 -0
  2. package/package.json +34 -4
package/bin/anycap ADDED
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const { platform, arch } = require("os");
5
+ const { spawnSync } = require("child_process");
6
+
7
+ const PLATFORM_PACKAGES = {
8
+ "darwin-arm64": "@anycap/cli-darwin-arm64",
9
+ "darwin-x64": "@anycap/cli-darwin-x64",
10
+ "linux-arm64": "@anycap/cli-linux-arm64",
11
+ "linux-x64": "@anycap/cli-linux-x64",
12
+ "win32-arm64": "@anycap/cli-win32-arm64",
13
+ "win32-x64": "@anycap/cli-win32-x64",
14
+ };
15
+
16
+ function getBinaryPath() {
17
+ const key = `${platform()}-${arch()}`;
18
+ const pkg = PLATFORM_PACKAGES[key];
19
+ if (!pkg) {
20
+ console.error(`Error: Unsupported platform ${key}.\nAnyCap CLI supports: ${Object.keys(PLATFORM_PACKAGES).join(", ")}`);
21
+ process.exit(1);
22
+ }
23
+ const binName = platform() === "win32" ? "anycap.exe" : "anycap";
24
+ try {
25
+ return require.resolve(`${pkg}/bin/${binName}`);
26
+ } catch (e) {
27
+ console.error(`Error: Could not find the AnyCap binary for ${key}.\nThe platform package "${pkg}" does not appear to be installed.\nTry reinstalling: npm install -g @anycap/cli`);
28
+ process.exit(1);
29
+ }
30
+ }
31
+
32
+ const binary = getBinaryPath();
33
+ const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
34
+ if (result.error) {
35
+ console.error(`Error: Failed to execute AnyCap CLI: ${result.error.message}`);
36
+ process.exit(1);
37
+ }
38
+ process.exit(result.status !== null ? result.status : 1);
package/package.json CHANGED
@@ -1,9 +1,39 @@
1
1
  {
2
2
  "name": "@anycap/cli",
3
- "version": "0.0.0",
4
- "description": "AnyCap CLI - AI Agent capability runtime (placeholder)",
3
+ "version": "0.0.7",
4
+ "description": "AnyCap CLI - AI Agent capability runtime",
5
5
  "license": "MIT",
6
- "repository": { "type": "git", "url": "https://github.com/anycap-ai/anycap" },
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/anycap-ai/anycap"
9
+ },
7
10
  "homepage": "https://anycap.ai",
8
- "keywords": ["anycap", "ai", "agent", "cli"]
11
+ "bin": {
12
+ "anycap": "bin/anycap"
13
+ },
14
+ "files": [
15
+ "bin/"
16
+ ],
17
+ "optionalDependencies": {
18
+ "@anycap/cli-darwin-arm64": "0.0.7",
19
+ "@anycap/cli-darwin-x64": "0.0.7",
20
+ "@anycap/cli-linux-arm64": "0.0.7",
21
+ "@anycap/cli-linux-x64": "0.0.7",
22
+ "@anycap/cli-win32-arm64": "0.0.7",
23
+ "@anycap/cli-win32-x64": "0.0.7"
24
+ },
25
+ "engines": {
26
+ "node": ">=16"
27
+ },
28
+ "keywords": [
29
+ "anycap",
30
+ "ai",
31
+ "agent",
32
+ "agent-skill",
33
+ "agent-skills",
34
+ "claude-code",
35
+ "coding-agent",
36
+ "cli",
37
+ "capability"
38
+ ]
9
39
  }