comwit-cli 0.1.4

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,70 @@
1
+ # comwit CLI
2
+
3
+ Command-line client for the **comwit.io** cloud platform — create databases, manage
4
+ apps, and deploy, against `https://api.cloud.comwit.io`.
5
+
6
+ ## Install
7
+
8
+ Use npm without installing:
9
+
10
+ ```sh
11
+ npx comwit-cli version
12
+ ```
13
+
14
+ Or install the `comwit` command globally:
15
+
16
+ ```sh
17
+ npm install -g comwit-cli
18
+ comwit version
19
+ ```
20
+
21
+ You can also use the standalone installer:
22
+
23
+ ```sh
24
+ curl -fsSL https://raw.githubusercontent.com/burrr-ai/comwit-cli/main/install.sh | sh
25
+ ```
26
+
27
+ This downloads the binary for your OS/arch from the latest [release](https://github.com/burrr-ai/comwit-cli/releases),
28
+ verifies its checksum, and installs it to `/usr/local/bin` (or `~/.local/bin`).
29
+
30
+ ## GitHub Actions
31
+
32
+ Use the setup action to install `comwit` and add it to `PATH` for later steps:
33
+
34
+ ```yaml
35
+ steps:
36
+ - uses: actions/checkout@v4
37
+ - uses: burrr-ai/comwit-cli@v0
38
+ with:
39
+ version: v0.1.4 # optional; omit to install the latest release
40
+
41
+ - run: comwit version
42
+ ```
43
+
44
+ Or with Go:
45
+
46
+ ```sh
47
+ go install github.com/burrr-ai/comwit-cli/cmd/comwit@latest
48
+ ```
49
+
50
+ ## Usage
51
+
52
+ ```sh
53
+ comwit login --token <cwt_token> # authenticate (token from the dashboard)
54
+ comwit projects list
55
+ comwit databases create --project <id> --name <name>
56
+ comwit databases list --project <id>
57
+ comwit apps ... # see `comwit --help`
58
+ comwit update # self-update to the latest release
59
+ comwit version
60
+ ```
61
+
62
+ Get a `cwt_` token from the platform dashboard, or use `comwit login` (device flow).
63
+
64
+ ## Releasing
65
+
66
+ ```sh
67
+ ./release.sh v0.1.0
68
+ ```
69
+
70
+ Builds darwin/linux × amd64/arm64, writes `checksums.txt`, and publishes a GitHub Release.
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const { spawnSync } = require("node:child_process");
5
+ const { existsSync } = require("node:fs");
6
+ const path = require("node:path");
7
+
8
+ const targets = {
9
+ "darwin-x64": "comwit-darwin-x64",
10
+ "darwin-arm64": "comwit-darwin-arm64",
11
+ "linux-x64": "comwit-linux-x64",
12
+ "linux-arm64": "comwit-linux-arm64",
13
+ "win32-x64": "comwit-win32-x64.exe",
14
+ "win32-arm64": "comwit-win32-arm64.exe"
15
+ };
16
+
17
+ const target = `${process.platform}-${process.arch}`;
18
+ const binaryName = targets[target];
19
+
20
+ if (!binaryName) {
21
+ console.error(`comwit-cli does not ship a binary for ${target}.`);
22
+ process.exit(1);
23
+ }
24
+
25
+ const packageRoot = path.resolve(__dirname, "..");
26
+ const binaryPath = path.join(packageRoot, "dist", binaryName);
27
+
28
+ if (!existsSync(binaryPath)) {
29
+ console.error(`comwit-cli package is missing ${path.relative(packageRoot, binaryPath)}.`);
30
+ process.exit(1);
31
+ }
32
+
33
+ const result = spawnSync(binaryPath, process.argv.slice(2), {
34
+ stdio: "inherit",
35
+ env: process.env
36
+ });
37
+
38
+ if (result.error) {
39
+ console.error(`failed to start comwit: ${result.error.message}`);
40
+ process.exit(1);
41
+ }
42
+
43
+ if (result.signal) {
44
+ process.kill(process.pid, result.signal);
45
+ }
46
+
47
+ process.exit(result.status === null ? 1 : result.status);
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "comwit-cli",
3
+ "version": "0.1.4",
4
+ "description": "Comwit Cloud command-line interface.",
5
+ "keywords": [
6
+ "comwit",
7
+ "cloud",
8
+ "cli",
9
+ "deploy",
10
+ "database"
11
+ ],
12
+ "license": "UNLICENSED",
13
+ "homepage": "https://cloud.comwit.io",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/burrr-ai/comwit-cli.git"
17
+ },
18
+ "bin": {
19
+ "comwit": "./npm/bin/comwit.js",
20
+ "comwit-cli": "./npm/bin/comwit.js"
21
+ },
22
+ "files": [
23
+ "npm/bin",
24
+ "npm/dist",
25
+ "README.md"
26
+ ],
27
+ "scripts": {
28
+ "build:npm": "node npm/scripts/build.mjs",
29
+ "prepack": "npm run build:npm"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "engines": {
35
+ "node": ">=16"
36
+ }
37
+ }