swytchcode 2.1.5 → 2.2.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 +38 -17
- package/bin/swytchcode.js +11 -0
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -2,46 +2,67 @@
|
|
|
2
2
|
|
|
3
3
|
Execution authority for agentic API integrations.
|
|
4
4
|
|
|
5
|
-
Swytchcode sits between AI agents and production APIs
|
|
5
|
+
Swytchcode sits between AI agents and production APIs — ensuring every tool call is explicit, auditable, and controlled by your project configuration.
|
|
6
6
|
|
|
7
|
-
## Try
|
|
7
|
+
## Try it instantly
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
npx swytchcode stripe.create_payment
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
No
|
|
13
|
+
No installation, no API keys, no project setup. Runs in demo mode and returns a real sandbox response from Stripe's test environment.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Not sure what a command does? Add `--explain`:
|
|
16
16
|
|
|
17
|
-
```
|
|
18
|
-
|
|
17
|
+
```bash
|
|
18
|
+
npx swytchcode stripe.create_payment --explain
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
## Install
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
**macOS / Linux:**
|
|
24
24
|
|
|
25
|
-
```
|
|
26
|
-
swytchcode
|
|
25
|
+
```bash
|
|
26
|
+
curl -fsSL https://cli.swytchcode.com/install.sh | sh
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
**Windows (PowerShell):**
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
```powershell
|
|
32
|
+
irm https://cli.swytchcode.com/install.ps1 | iex
|
|
33
|
+
```
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
**npm (all platforms):**
|
|
34
36
|
|
|
37
|
+
```bash
|
|
38
|
+
npm install -g swytchcode
|
|
35
39
|
```
|
|
36
|
-
curl -fsSL https://cli.swytchcode.com/install.sh | sh
|
|
37
|
-
```
|
|
38
40
|
|
|
39
|
-
Windows
|
|
41
|
+
The correct binary for your platform (macOS, Linux, Windows — x64 and arm64) is selected automatically.
|
|
42
|
+
|
|
43
|
+
## Usage
|
|
40
44
|
|
|
41
45
|
```
|
|
42
|
-
|
|
46
|
+
swytchcode exec <canonical-id> Execute a tool
|
|
47
|
+
swytchcode list List available tools
|
|
48
|
+
swytchcode search <query> Search tools by keyword or intent
|
|
49
|
+
swytchcode info <canonical-id> Show tool details
|
|
50
|
+
swytchcode init Set up a project
|
|
51
|
+
swytchcode --help Show all commands
|
|
43
52
|
```
|
|
44
53
|
|
|
54
|
+
## Official language runtimes
|
|
55
|
+
|
|
56
|
+
Use these packages to call `swytchcode exec` directly from your code without shell boilerplate:
|
|
57
|
+
|
|
58
|
+
| Language | Package | Install |
|
|
59
|
+
|----------|---------|---------|
|
|
60
|
+
| TypeScript / JavaScript | [`swytchcode-runtime`](https://www.npmjs.com/package/swytchcode-runtime) | `npm install swytchcode-runtime` |
|
|
61
|
+
| Python | [`swytchcode-runtime`](https://pypi.org/project/swytchcode-runtime) | `pip install swytchcode-runtime` |
|
|
62
|
+
| Go | [`gitlab.com/swytchcode/go-runtime`](https://gitlab.com/swytchcode/go-runtime) | `go get gitlab.com/swytchcode/go-runtime` |
|
|
63
|
+
|
|
64
|
+
All runtimes resolve the `swytchcode` binary from `$PATH` by default. Set `SWYTCHCODE_BIN=/path/to/binary` to override — useful in CI, Docker, or environments where the global symlink is not available.
|
|
65
|
+
|
|
45
66
|
## Links
|
|
46
67
|
|
|
47
68
|
- [swytchcode.com](https://swytchcode.com)
|
package/bin/swytchcode.js
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
|
|
4
4
|
const { spawnSync } = require('child_process');
|
|
5
5
|
|
|
6
|
+
// Explicit override: set SWYTCHCODE_BIN=/path/to/binary to bypass platform package resolution.
|
|
7
|
+
const explicitBin = (process.env.SWYTCHCODE_BIN || '').trim();
|
|
8
|
+
if (explicitBin) {
|
|
9
|
+
const result = spawnSync(explicitBin, process.argv.slice(2), { stdio: 'inherit' });
|
|
10
|
+
if (result.error) {
|
|
11
|
+
process.stderr.write(`swytchcode: failed to launch SWYTCHCODE_BIN="${explicitBin}": ${result.error.message}\n`);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
process.exit(result.status ?? 1);
|
|
15
|
+
}
|
|
16
|
+
|
|
6
17
|
const PLATFORM_PACKAGES = {
|
|
7
18
|
'darwin-arm64': 'swytchcode-cli-darwin-arm64',
|
|
8
19
|
'darwin-x64': 'swytchcode-cli-darwin-x64',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "swytchcode",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "Execution layer for API integrations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"README.md"
|
|
24
24
|
],
|
|
25
25
|
"optionalDependencies": {
|
|
26
|
-
"swytchcode-cli-darwin-arm64": "2.1
|
|
27
|
-
"swytchcode-cli-darwin-x64": "2.1
|
|
28
|
-
"swytchcode-cli-linux-arm64": "2.1
|
|
29
|
-
"swytchcode-cli-linux-x64": "2.1
|
|
30
|
-
"swytchcode-cli-win32-arm64": "2.1
|
|
31
|
-
"swytchcode-cli-win32-x64": "2.1
|
|
26
|
+
"swytchcode-cli-darwin-arm64": "2.2.1",
|
|
27
|
+
"swytchcode-cli-darwin-x64": "2.2.1",
|
|
28
|
+
"swytchcode-cli-linux-arm64": "2.2.1",
|
|
29
|
+
"swytchcode-cli-linux-x64": "2.2.1",
|
|
30
|
+
"swytchcode-cli-win32-arm64": "2.2.1",
|
|
31
|
+
"swytchcode-cli-win32-x64": "2.2.1"
|
|
32
32
|
}
|
|
33
33
|
}
|