aparta-cli 0.3.0
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/cli.js +36 -0
- package/package.json +31 -0
package/cli.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Thin launcher for the aparta Python CLI: runs the matching PyPI version
|
|
3
|
+
// through uvx (preferred) or pipx, so `npx aparta` works in Node-first setups.
|
|
4
|
+
|
|
5
|
+
const { spawnSync } = require("node:child_process");
|
|
6
|
+
const { version } = require("./package.json");
|
|
7
|
+
|
|
8
|
+
const args = process.argv.slice(2);
|
|
9
|
+
|
|
10
|
+
function tryRun(cmd, cmdArgs) {
|
|
11
|
+
const result = spawnSync(cmd, cmdArgs, { stdio: "inherit" });
|
|
12
|
+
if (result.error && result.error.code === "ENOENT") return null;
|
|
13
|
+
return result.status ?? 1;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let status = tryRun("uvx", [`aparta==${version}`, ...args]);
|
|
17
|
+
if (status === null) status = tryRun("pipx", ["run", `aparta==${version}`, ...args]);
|
|
18
|
+
|
|
19
|
+
if (status === null) {
|
|
20
|
+
console.error(
|
|
21
|
+
[
|
|
22
|
+
"aparta is a Python CLI and needs uv or pipx to run.",
|
|
23
|
+
"",
|
|
24
|
+
"Install uv (recommended):",
|
|
25
|
+
" curl -LsSf https://astral.sh/uv/install.sh | sh",
|
|
26
|
+
"",
|
|
27
|
+
"Or install aparta directly:",
|
|
28
|
+
" pip install aparta",
|
|
29
|
+
"",
|
|
30
|
+
"Then run `aparta` (or `npx aparta` again).",
|
|
31
|
+
].join("\n")
|
|
32
|
+
);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
process.exit(status);
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "aparta-cli",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Isolate your dev accounts (git, gh, gcloud, SSH) per project folder and make terminal AI agents use the right identity, always.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"aparta": "cli.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"cli.js"
|
|
10
|
+
],
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=18"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"git",
|
|
16
|
+
"gh",
|
|
17
|
+
"gcloud",
|
|
18
|
+
"identity",
|
|
19
|
+
"profiles",
|
|
20
|
+
"claude-code",
|
|
21
|
+
"codex",
|
|
22
|
+
"direnv"
|
|
23
|
+
],
|
|
24
|
+
"author": "Lucas Carvalhal",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/lucascarvalhal/aparta.git"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/lucascarvalhal/aparta#readme"
|
|
31
|
+
}
|