atlascloud-cli 0.1.4 → 0.1.6
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 +0 -2
- package/bin/run.js +2 -1
- package/install.js +40 -7
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -10,8 +10,6 @@ npm install -g atlascloud-cli
|
|
|
10
10
|
|
|
11
11
|
The postinstall step downloads the prebuilt `atlas` binary for your platform from the public GitHub release and verifies the archive against `checksums.txt`.
|
|
12
12
|
|
|
13
|
-
Supported npm platforms: macOS and Linux on x64 or arm64. Windows package-manager support will be added separately.
|
|
14
|
-
|
|
15
13
|
## Usage
|
|
16
14
|
|
|
17
15
|
```bash
|
package/bin/run.js
CHANGED
|
@@ -21,7 +21,8 @@ function readInstallMetadata(vendorDir) {
|
|
|
21
21
|
|
|
22
22
|
module.exports = function run(binaryName) {
|
|
23
23
|
const vendorDir = path.join(__dirname, "..", "vendor");
|
|
24
|
-
const
|
|
24
|
+
const executable = process.platform === "win32" ? `${binaryName}.exe` : binaryName;
|
|
25
|
+
const bin = path.join(vendorDir, executable);
|
|
25
26
|
|
|
26
27
|
if (!fs.existsSync(bin)) {
|
|
27
28
|
console.error(
|
package/install.js
CHANGED
|
@@ -12,7 +12,8 @@ const VERSION = process.env.ATLAS_CLI_VERSION || pkg.version;
|
|
|
12
12
|
|
|
13
13
|
const PLATFORM_MAP = {
|
|
14
14
|
darwin: "darwin",
|
|
15
|
-
linux: "linux"
|
|
15
|
+
linux: "linux",
|
|
16
|
+
win32: "windows"
|
|
16
17
|
};
|
|
17
18
|
const ARCH_MAP = {
|
|
18
19
|
x64: "amd64",
|
|
@@ -26,7 +27,7 @@ if (!platform || !arch) {
|
|
|
26
27
|
console.error(
|
|
27
28
|
`atlascloud-cli: unsupported platform ${process.platform}/${process.arch}`
|
|
28
29
|
);
|
|
29
|
-
console.error("Supported: darwin|linux x x64|arm64");
|
|
30
|
+
console.error("Supported: darwin|linux|win32 x x64|arm64");
|
|
30
31
|
process.exit(1);
|
|
31
32
|
}
|
|
32
33
|
|
|
@@ -38,7 +39,9 @@ if (VERSION === "0.0.0") {
|
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
const tag = `v${VERSION}`;
|
|
41
|
-
const
|
|
42
|
+
const archiveExt = platform === "windows" ? "zip" : "tar.gz";
|
|
43
|
+
const archiveName = `cli_${VERSION}_${platform}_${arch}.${archiveExt}`;
|
|
44
|
+
const binaryName = platform === "windows" ? "atlas.exe" : "atlas";
|
|
42
45
|
const releaseBase = `https://github.com/${REPO}/releases/download/${tag}`;
|
|
43
46
|
const archiveURL = `${releaseBase}/${archiveName}`;
|
|
44
47
|
const checksumsURL = `${releaseBase}/checksums.txt`;
|
|
@@ -125,6 +128,36 @@ function verifyChecksum() {
|
|
|
125
128
|
}
|
|
126
129
|
}
|
|
127
130
|
|
|
131
|
+
function extractArchive() {
|
|
132
|
+
if (platform === "windows") {
|
|
133
|
+
execFileSync(
|
|
134
|
+
"powershell.exe",
|
|
135
|
+
[
|
|
136
|
+
"-NoLogo",
|
|
137
|
+
"-NoProfile",
|
|
138
|
+
"-NonInteractive",
|
|
139
|
+
"-ExecutionPolicy",
|
|
140
|
+
"Bypass",
|
|
141
|
+
"-Command",
|
|
142
|
+
"Expand-Archive -LiteralPath $env:ATLAS_ARCHIVE -DestinationPath $env:ATLAS_VENDOR -Force"
|
|
143
|
+
],
|
|
144
|
+
{
|
|
145
|
+
stdio: "inherit",
|
|
146
|
+
env: {
|
|
147
|
+
...process.env,
|
|
148
|
+
ATLAS_ARCHIVE: archivePath,
|
|
149
|
+
ATLAS_VENDOR: vendorDir
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
execFileSync("tar", ["-xzf", archivePath, "-C", vendorDir], {
|
|
157
|
+
stdio: "inherit"
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
128
161
|
(async () => {
|
|
129
162
|
fs.mkdirSync(vendorDir, { recursive: true });
|
|
130
163
|
|
|
@@ -133,10 +166,10 @@ function verifyChecksum() {
|
|
|
133
166
|
await download(checksumsURL, checksumsPath);
|
|
134
167
|
verifyChecksum();
|
|
135
168
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
169
|
+
extractArchive();
|
|
170
|
+
if (platform !== "windows") {
|
|
171
|
+
fs.chmodSync(path.join(vendorDir, binaryName), 0o755);
|
|
172
|
+
}
|
|
140
173
|
|
|
141
174
|
fs.writeFileSync(
|
|
142
175
|
metadataPath,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atlascloud-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "AtlasCloud CLI — call LLM, image, and video models from your terminal.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"atlas": "bin/atlas.js"
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
},
|
|
19
19
|
"os": [
|
|
20
20
|
"darwin",
|
|
21
|
-
"linux"
|
|
21
|
+
"linux",
|
|
22
|
+
"win32"
|
|
22
23
|
],
|
|
23
24
|
"cpu": [
|
|
24
25
|
"x64",
|