char 0.0.1-nightly.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,34 @@
1
+ # char
2
+
3
+ Install the Char CLI from npm.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g char
9
+ ```
10
+
11
+ For nightly builds:
12
+
13
+ ```bash
14
+ npm install -g char@nightly
15
+ ```
16
+
17
+ ## Platforms
18
+
19
+ The npm package currently installs prebuilt binaries for:
20
+
21
+ - macOS Apple Silicon
22
+ - macOS Intel
23
+
24
+ ## Usage
25
+
26
+ ```bash
27
+ char --help
28
+ ```
29
+
30
+ ## Links
31
+
32
+ - App: https://char.com
33
+ - Repository: https://github.com/fastrepl/char
34
+ - Issues: https://github.com/fastrepl/char/issues
package/bin/run.js ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawn } = require("node:child_process");
4
+ const { join } = require("node:path");
5
+
6
+ const bin = join(__dirname, "char");
7
+ const child = spawn(bin, process.argv.slice(2), { stdio: "inherit" });
8
+
9
+ child.on("error", (err) => {
10
+ console.error(err);
11
+ process.exit(1);
12
+ });
13
+
14
+ child.on("exit", (code, signal) => {
15
+ if (signal) {
16
+ process.kill(process.pid, signal);
17
+ } else {
18
+ process.exit(code ?? 1);
19
+ }
20
+ });
package/install.js ADDED
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execSync } = require("node:child_process");
4
+ const { existsSync, mkdirSync } = require("node:fs");
5
+ const { join } = require("node:path");
6
+
7
+ const REPO = "fastrepl/char";
8
+
9
+ const TARGETS = {
10
+ "darwin-arm64": "aarch64-apple-darwin",
11
+ "darwin-x64": "x86_64-apple-darwin",
12
+ };
13
+
14
+ const target = TARGETS[`${process.platform}-${process.arch}`];
15
+ if (!target) {
16
+ console.error(`Unsupported platform: ${process.platform}-${process.arch}`);
17
+ process.exit(1);
18
+ }
19
+
20
+ const version = require("./package.json").version;
21
+ const tag = `cli_v${version}`;
22
+ const archive = `char-${version}-${target}.tar.xz`;
23
+ const url = `https://github.com/${REPO}/releases/download/${tag}/${archive}`;
24
+
25
+ const binDir = join(__dirname, "bin");
26
+ if (!existsSync(binDir)) {
27
+ mkdirSync(binDir, { recursive: true });
28
+ }
29
+
30
+ const dest = join(binDir, "char");
31
+ if (existsSync(dest)) {
32
+ process.exit(0);
33
+ }
34
+
35
+ console.error(`Downloading char from ${url}`);
36
+ const tmp = join(require("node:os").tmpdir(), archive);
37
+ execSync(`curl -fsSL -o "${tmp}" "${url}"`, { stdio: "inherit" });
38
+ execSync(`tar -xf "${tmp}" -C "${binDir}"`, { stdio: "inherit" });
39
+ execSync(`rm -f "${tmp}"`);
40
+ execSync(`chmod +x "${dest}"`);
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "char",
3
+ "version": "0.0.1-nightly.4",
4
+ "description": "Live transcription and audio tools",
5
+ "license": "GPL-3.0",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/fastrepl/char.git",
9
+ "directory": "apps/cli/npm"
10
+ },
11
+ "homepage": "https://char.com",
12
+ "bugs": {
13
+ "url": "https://github.com/fastrepl/char/issues"
14
+ },
15
+ "keywords": [
16
+ "char",
17
+ "cli",
18
+ "transcription",
19
+ "notes"
20
+ ],
21
+ "bin": {
22
+ "char": "bin/run.js"
23
+ },
24
+ "scripts": {
25
+ "postinstall": "node install.js"
26
+ },
27
+ "files": [
28
+ "bin/",
29
+ "install.js"
30
+ ],
31
+ "engines": {
32
+ "node": ">=18"
33
+ }
34
+ }