@moldesk/cli 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Pourya Kalantari
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerDoctorCommand(program: Command): void;
@@ -0,0 +1,22 @@
1
+ import { getSystemReport, VERSION } from "@moldesk/core";
2
+ import { checkmark, section } from "../utils/format.js";
3
+ export function registerDoctorCommand(program) {
4
+ program
5
+ .command("doctor")
6
+ .description("Check system compatibility for running models")
7
+ .action(async () => {
8
+ const report = await getSystemReport();
9
+ const { hardware, python, docker } = report;
10
+ console.log(`MoleculeDesk ${VERSION}`);
11
+ console.log(section("System"));
12
+ console.log(` OS ${hardware.platform} (${hardware.arch})`);
13
+ console.log(` CPU ${hardware.cpuModel} (${hardware.cpuCores} cores)`);
14
+ console.log(` Memory ${hardware.totalMemoryGb} GB`);
15
+ console.log(` ${checkmark(hardware.isAppleSilicon)} Apple Silicon${hardware.isAppleSilicon ? "" : " not detected"}`);
16
+ console.log(section("Compute"));
17
+ console.log(` ${checkmark(python.found)} Python ${python.found ? python.version : "not found"}`);
18
+ console.log(` ${checkmark(docker.installed)} Docker ${docker.installed ? (docker.running ? `${docker.version} (running)` : `${docker.version} (not running)`) : "not installed"}`);
19
+ console.log(section("Models"));
20
+ console.log(" No models installed yet. Run `moldesk list` to see what's available.");
21
+ });
22
+ }
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerInstallCommand(program: Command): void;
@@ -0,0 +1,17 @@
1
+ import { listAvailableModels } from "@moldesk/core";
2
+ export function registerInstallCommand(program) {
3
+ program
4
+ .command("install <model>")
5
+ .description("Install a model (coming soon)")
6
+ .action((model) => {
7
+ const available = listAvailableModels();
8
+ const manifest = available.find((m) => m.name === model);
9
+ if (!manifest) {
10
+ console.error(`Unknown model "${model}". Run \`moldesk list\` to see available models.`);
11
+ process.exitCode = 1;
12
+ return;
13
+ }
14
+ console.log(`Installing "${model}" is not yet supported.`);
15
+ console.log("Track progress at https://github.com/pooriyapfn/moldesk");
16
+ });
17
+ }
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerListCommand(program: Command): void;
@@ -0,0 +1,20 @@
1
+ import { listAvailableModels, listInstalledModels } from "@moldesk/core";
2
+ export function registerListCommand(program) {
3
+ program
4
+ .command("list")
5
+ .description("List available and installed models")
6
+ .action(() => {
7
+ const available = listAvailableModels();
8
+ const installed = listInstalledModels();
9
+ const installedNames = new Set(installed.map((m) => m.name));
10
+ if (available.length === 0) {
11
+ console.log("No models found in the registry.");
12
+ return;
13
+ }
14
+ console.log("Available models:\n");
15
+ for (const model of available) {
16
+ const status = installedNames.has(model.name) ? "installed" : "not installed";
17
+ console.log(` ${model.name.padEnd(12)} ${model.version.padEnd(10)} ${status}`);
18
+ }
19
+ });
20
+ }
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerRunCommand(program: Command): void;
@@ -0,0 +1,9 @@
1
+ export function registerRunCommand(program) {
2
+ program
3
+ .command("run <model> <input>")
4
+ .description("Run a model against an input file (coming soon)")
5
+ .action((model, input) => {
6
+ console.log(`Running "${model}" on "${input}" is not yet supported.`);
7
+ console.log("Track progress at https://github.com/pooriyapfn/moldesk");
8
+ });
9
+ }
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from "commander";
3
+ import { VERSION } from "@moldesk/core";
4
+ import { registerDoctorCommand } from "./commands/doctor.js";
5
+ import { registerListCommand } from "./commands/list.js";
6
+ import { registerInstallCommand } from "./commands/install.js";
7
+ import { registerRunCommand } from "./commands/run.js";
8
+ const program = new Command();
9
+ program
10
+ .name("moldesk")
11
+ .description("Install and run computational biology models")
12
+ .version(VERSION);
13
+ registerDoctorCommand(program);
14
+ registerListCommand(program);
15
+ registerInstallCommand(program);
16
+ registerRunCommand(program);
17
+ program.parse();
@@ -0,0 +1,2 @@
1
+ export declare function checkmark(ok: boolean): string;
2
+ export declare function section(title: string): string;
@@ -0,0 +1,6 @@
1
+ export function checkmark(ok) {
2
+ return ok ? "✓" : "○";
3
+ }
4
+ export function section(title) {
5
+ return `\n${title}`;
6
+ }
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@moldesk/cli",
3
+ "version": "0.0.1",
4
+ "description": "MoleculeDesk CLI — install and run computational biology models",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/pooriyapfn/moldesk.git",
10
+ "directory": "apps/cli"
11
+ },
12
+ "publishConfig": {
13
+ "access": "public",
14
+ "provenance": true
15
+ },
16
+ "bin": {
17
+ "moldesk": "./dist/index.js"
18
+ },
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "dependencies": {
23
+ "commander": "^12.1.0",
24
+ "@moldesk/core": "0.0.1"
25
+ },
26
+ "devDependencies": {
27
+ "typescript": "^5.6.3",
28
+ "tsx": "^4.19.1",
29
+ "@types/node": "^20.16.11"
30
+ },
31
+ "scripts": {
32
+ "dev": "tsx src/index.ts",
33
+ "build": "tsc -p tsconfig.json",
34
+ "typecheck": "tsc --noEmit"
35
+ }
36
+ }