swytchcode 2.1.1

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 ADDED
@@ -0,0 +1,50 @@
1
+ # swytchcode
2
+
3
+ Execution authority for agentic API integrations.
4
+
5
+ Swytchcode sits between AI agents and production APIs, ensuring execution is explicit, controlled, and never implicit or prompt-driven.
6
+
7
+ ## Try without installing
8
+
9
+ ```bash
10
+ npx swytchcode stripe.create_payment
11
+ ```
12
+
13
+ No setup. No API keys. Real sandbox response.
14
+
15
+ ## Install
16
+
17
+ ```
18
+ npm install -g swytchcode
19
+ ```
20
+
21
+ Works on macOS, Linux, and Windows (x64 and arm64). The correct binary for your platform is selected automatically at install time.
22
+
23
+ ## Usage
24
+
25
+ ```
26
+ swytchcode [command] [flags]
27
+ ```
28
+
29
+ Run `swytchcode --help` for available commands.
30
+
31
+ ## Alternative install methods
32
+
33
+ macOS / Linux:
34
+
35
+ ```
36
+ curl -fsSL https://cli.swytchcode.com/install.sh | sh
37
+ ```
38
+
39
+ Windows (PowerShell):
40
+
41
+ ```
42
+ irm https://cli.swytchcode.com/install.ps1 | iex
43
+ ```
44
+
45
+ ## Links
46
+
47
+ - [swytchcode.com](https://swytchcode.com)
48
+ - [Documentation](https://docs.swytchcode.com)
49
+ - [Wiki](https://gitlab.com/swytchcode/cli/-/wikis/home)
50
+ - [Releases](https://gitlab.com/swytchcode/cli/-/releases)
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const { spawnSync } = require('child_process');
5
+
6
+ const PLATFORM_PACKAGES = {
7
+ 'darwin-arm64': 'swytchcode-cli-darwin-arm64',
8
+ 'darwin-x64': 'swytchcode-cli-darwin-x64',
9
+ 'linux-arm64': 'swytchcode-cli-linux-arm64',
10
+ 'linux-x64': 'swytchcode-cli-linux-x64',
11
+ 'win32-arm64': 'swytchcode-cli-win32-arm64',
12
+ 'win32-x64': 'swytchcode-cli-win32-x64',
13
+ };
14
+
15
+ const platform = process.platform;
16
+ const arch = process.arch;
17
+ const key = `${platform}-${arch}`;
18
+ const pkg = PLATFORM_PACKAGES[key];
19
+
20
+ if (!pkg) {
21
+ process.stderr.write(
22
+ `swytchcode: unsupported platform "${key}".\n` +
23
+ `Supported: ${Object.keys(PLATFORM_PACKAGES).join(', ')}\n` +
24
+ `Install via curl instead: https://cli.swytchcode.com\n`
25
+ );
26
+ process.exit(1);
27
+ }
28
+
29
+ const isWindows = platform === 'win32';
30
+ const binName = isWindows ? 'swytchcode.exe' : 'swytchcode';
31
+
32
+ let binPath;
33
+ try {
34
+ binPath = require.resolve(`${pkg}/bin/${binName}`);
35
+ } catch (_) {
36
+ process.stderr.write(
37
+ `swytchcode: could not find the binary for "${key}".\n` +
38
+ `Try reinstalling: npm install -g swytchcode\n`
39
+ );
40
+ process.exit(1);
41
+ }
42
+
43
+ const result = spawnSync(binPath, process.argv.slice(2), { stdio: 'inherit' });
44
+
45
+ if (result.error) {
46
+ process.stderr.write(`swytchcode: failed to launch binary: ${result.error.message}\n`);
47
+ process.exit(1);
48
+ }
49
+
50
+ process.exit(result.status ?? 1);
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "swytchcode",
3
+ "version": "2.1.1",
4
+ "description": "Execution layer for API integrations",
5
+ "keywords": [
6
+ "api",
7
+ "integration",
8
+ "cli",
9
+ "execution",
10
+ "ai",
11
+ "agents"
12
+ ],
13
+ "homepage": "https://cli.swytchcode.com",
14
+ "license": "MIT",
15
+ "bin": {
16
+ "swytchcode": "./bin/swytchcode.js"
17
+ },
18
+ "engines": {
19
+ "node": ">=14"
20
+ },
21
+ "files": [
22
+ "bin/swytchcode.js",
23
+ "README.md"
24
+ ],
25
+ "optionalDependencies": {
26
+ "swytchcode-cli-darwin-arm64": "2.1.1",
27
+ "swytchcode-cli-darwin-x64": "2.1.1",
28
+ "swytchcode-cli-linux-arm64": "2.1.1",
29
+ "swytchcode-cli-linux-x64": "2.1.1",
30
+ "swytchcode-cli-win32-arm64": "2.1.1",
31
+ "swytchcode-cli-win32-x64": "2.1.1"
32
+ }
33
+ }