@tinyfiles/cli 0.1.2

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 (3) hide show
  1. package/README.md +32 -0
  2. package/bin/at1.cjs +42 -0
  3. package/package.json +37 -0
package/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # @tinyfiles/cli
2
+
3
+ The **AT-1 / TinyFiles** command-line tool as a native binary — no Python required.
4
+
5
+ ```bash
6
+ npm install -g @tinyfiles/cli # or: pnpm add -g @tinyfiles/cli / yarn global add @tinyfiles/cli
7
+ at1 compress qcolumnar data.csv data.at1 # verified-lossless, queryable
8
+ at1 sql data.at1 "SELECT id WHERE ts BETWEEN 100 AND 200" # query without decompressing
9
+ at1 decompress data.at1 data.out # byte-for-byte identical
10
+ ```
11
+
12
+ AT-1 is structure-aware **lossless** compression you can **query in place**, with a SHA-256
13
+ integrity trailer on every archive. See **https://tinyfiles.io/docs** for the full guide,
14
+ and **https://tinyfiles.io/docs/start-here** if you're new.
15
+
16
+ ## How it installs
17
+
18
+ This package contains only a tiny launcher. The actual engine ships as a **prebuilt,
19
+ compiled binary** in a per-platform package (`@tinyfiles/cli-win32-x64`, `@tinyfiles/cli-darwin-arm64`,
20
+ …) listed under `optionalDependencies`. Your package manager fetches **only** the one
21
+ matching your OS/arch (via the packages' `os`/`cpu` fields) — there is **no install
22
+ script**, so it works cleanly under npm, pnpm, yarn, and bun.
23
+
24
+ Supported: `win32-x64`, `darwin-x64`, `darwin-arm64`, `linux-x64`. On other platforms,
25
+ install via pip instead: `pip install at1-compression`.
26
+
27
+ ## Notes
28
+
29
+ - **Decoding** an `.at1` is always free and needs no account. Heavy **encoding** is metered
30
+ against your AT-1 account (set `AT1_LICENSE_KEY`, or `at1 login`) — same as the pip/desktop
31
+ clients. See https://tinyfiles.io/pricing.
32
+ - Decode-only in the browser/Node? Use [`@tinyfiles/decoder`](https://www.npmjs.com/package/@tinyfiles/decoder).
package/bin/at1.cjs ADDED
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ /**
4
+ * @tinyfiles/cli launcher. Execs the prebuilt, COMPILED AT-1 binary for this platform.
5
+ *
6
+ * No IP leak: the engine ships only as a compiled binary (PyInstaller; engine modules are
7
+ * Cython-compiled — no readable .py/.pyc) inside a per-platform optionalDependency
8
+ * (@tinyfiles/cli-<platform>-<arch>). This launcher contains zero engine logic. The per-platform
9
+ * packages carry `os`/`cpu` fields, so the package manager installs only the matching one —
10
+ * and because the binary travels inside that dependency, there is NO postinstall script,
11
+ * which is what makes this work cleanly under pnpm's default script-blocking.
12
+ */
13
+ const { spawnSync } = require("node:child_process");
14
+
15
+ function resolveBinary() {
16
+ const platform = process.platform; // 'win32' | 'darwin' | 'linux'
17
+ const arch = process.arch; // 'x64' | 'arm64'
18
+ const binName = platform === "win32" ? "at1.exe" : "at1";
19
+ try {
20
+ return require.resolve(`@tinyfiles/cli-${platform}-${arch}/bin/${binName}`);
21
+ } catch {
22
+ return null;
23
+ }
24
+ }
25
+
26
+ const bin = resolveBinary();
27
+ if (!bin) {
28
+ process.stderr.write(
29
+ `AT-1: no prebuilt binary for ${process.platform}-${process.arch}.\n` +
30
+ `Supported: win32-x64, darwin-x64, darwin-arm64, linux-x64.\n` +
31
+ `If you're on one of those, reinstall so the platform package is fetched ` +
32
+ `(e.g. npm i -g @tinyfiles/cli). Otherwise use pip: pip install at1-compression.\n`
33
+ );
34
+ process.exit(1);
35
+ }
36
+
37
+ const res = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
38
+ if (res.error) {
39
+ process.stderr.write(`AT-1: failed to launch binary: ${res.error.message}\n`);
40
+ process.exit(1);
41
+ }
42
+ process.exit(res.status === null ? 1 : res.status);
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@tinyfiles/cli",
3
+ "version": "0.1.2",
4
+ "description": "AT-1 / TinyFiles CLI — verified-lossless, queryable compression. Native prebuilt binary, no Python required.",
5
+ "bin": {
6
+ "at1": "bin/at1.cjs"
7
+ },
8
+ "files": [
9
+ "bin",
10
+ "README.md"
11
+ ],
12
+ "optionalDependencies": {
13
+ "@tinyfiles/cli-win32-x64": "0.1.2",
14
+ "@tinyfiles/cli-linux-x64": "0.1.2"
15
+ },
16
+ "engines": {
17
+ "node": ">=16"
18
+ },
19
+ "keywords": [
20
+ "compression",
21
+ "lossless",
22
+ "queryable",
23
+ "at1",
24
+ "tinyfiles",
25
+ "archive",
26
+ "cli"
27
+ ],
28
+ "license": "UNLICENSED",
29
+ "homepage": "https://tinyfiles.io",
30
+ "bugs": {
31
+ "url": "https://github.com/AT1-Tinyfiles/AT-1-Public/issues"
32
+ },
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/AT1-Tinyfiles/AT-1-Public.git"
36
+ }
37
+ }