@mangostudio/cli 0.1.0-canary.39c66ba

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,56 @@
1
+ # @mangostudio/cli
2
+
3
+ Install [MangoStudio](https://github.com/juliopolycarpo/mangostudio) — an
4
+ AI-powered image generation and chat studio — as a single command.
5
+
6
+ ## Install
7
+
8
+ ```bash
9
+ npm install -g @mangostudio/cli
10
+ # or: bun add -g @mangostudio/cli
11
+ ```
12
+
13
+ This pulls the prebuilt standalone binary for your platform (via a
14
+ platform-specific optional dependency) and puts `mangostudio` on your PATH.
15
+ No Node.js or Bun runtime is required to run it.
16
+
17
+ ## Usage
18
+
19
+ `mangostudio` is a CLI that manages one local server:
20
+
21
+ ```bash
22
+ mangostudio serve [host|port|host:port] # foreground (default localhost:3001)
23
+ mangostudio serve lan:3001 -d # background (logs to ~/.mango/logs/)
24
+ mangostudio status # show the running instance
25
+ mangostudio stop # graceful shutdown
26
+ mangostudio doctor # environment diagnostics
27
+ mangostudio --version # print the installed version
28
+ ```
29
+
30
+ Run `mangostudio` with no arguments for the full command list.
31
+
32
+ Configure it with environment variables:
33
+
34
+ | Variable | Purpose |
35
+ | -------------------- | ---------------------------------------------------------- |
36
+ | `BETTER_AUTH_SECRET` | Auth signing secret, at least 32 characters |
37
+ | `GEMINI_API_KEY` | Google Gemini API key |
38
+ | `API_HOST` | Host to listen on (default: `localhost`) |
39
+ | `API_PORT` | Port to listen on (default: `3001`) |
40
+ | `DATABASE_PATH` | SQLite database path (default: `~/.mango/database.sqlite`) |
41
+ | `UPLOADS_DIR` | Upload directory (default: `~/.mango/uploads`) |
42
+
43
+ On first run, `mangostudio serve` can generate a strong auth secret and ask
44
+ whether to store it in `~/.mango/.env` or `~/.mango/config.toml`.
45
+
46
+ The database is created and migrated automatically on first run.
47
+
48
+ ## Supported platforms
49
+
50
+ `linux-x64`, `linux-arm64`, `darwin-x64`, `darwin-arm64`, `win32-x64`,
51
+ `win32-arm64`. Other targets (including musl builds) are available as direct
52
+ downloads on the [releases page](https://github.com/juliopolycarpo/mangostudio/releases).
53
+
54
+ ## License
55
+
56
+ MIT
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ // Locates the prebuilt MangoStudio binary published as a platform-specific
5
+ // optional dependency and execs it, forwarding args, stdio, and the exit code.
6
+ // npm installs only the optional dependency matching the host os/cpu, so the
7
+ // right binary resolves with no install-time download.
8
+
9
+ const { spawnSync } = require('node:child_process');
10
+ const { dirname, join } = require('node:path');
11
+
12
+ const PLATFORM_PACKAGES = {
13
+ 'linux-x64': '@mangostudio/cli-linux-x64',
14
+ 'linux-arm64': '@mangostudio/cli-linux-arm64',
15
+ 'darwin-x64': '@mangostudio/cli-darwin-x64',
16
+ 'darwin-arm64': '@mangostudio/cli-darwin-arm64',
17
+ 'win32-x64': '@mangostudio/cli-win32-x64',
18
+ 'win32-arm64': '@mangostudio/cli-win32-arm64',
19
+ };
20
+
21
+ function resolveBinaryPath() {
22
+ const key = `${process.platform}-${process.arch}`;
23
+ const packageName = PLATFORM_PACKAGES[key];
24
+ if (!packageName) {
25
+ throw new Error(`MangoStudio does not ship a prebuilt binary for ${key}.`);
26
+ }
27
+
28
+ let manifestPath;
29
+ try {
30
+ manifestPath = require.resolve(`${packageName}/package.json`);
31
+ } catch {
32
+ throw new Error(
33
+ `MangoStudio platform package "${packageName}" is not installed. ` +
34
+ 'Reinstall with optional dependencies enabled.'
35
+ );
36
+ }
37
+
38
+ const binaryName = process.platform === 'win32' ? 'mangostudio.exe' : 'mangostudio';
39
+ return join(dirname(manifestPath), binaryName);
40
+ }
41
+
42
+ function main() {
43
+ const result = spawnSync(resolveBinaryPath(), process.argv.slice(2), { stdio: 'inherit' });
44
+ if (result.error) {
45
+ throw result.error;
46
+ }
47
+ process.exit(result.status === null ? 1 : result.status);
48
+ }
49
+
50
+ try {
51
+ main();
52
+ } catch (error) {
53
+ console.error(error instanceof Error ? error.message : String(error));
54
+ process.exit(1);
55
+ }
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@mangostudio/cli",
3
+ "version": "0.1.0-canary.39c66ba",
4
+ "description": "MangoStudio — AI image generation and chat studio. Installs the prebuilt standalone binary for your platform and exposes the `mangostudio` command.",
5
+ "license": "MIT",
6
+ "type": "commonjs",
7
+ "bin": {
8
+ "mangostudio": "bin/mangostudio.js"
9
+ },
10
+ "files": [
11
+ "bin/mangostudio.js",
12
+ "README.md"
13
+ ],
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/juliopolycarpo/mangostudio.git",
17
+ "directory": "packages/cli"
18
+ },
19
+ "homepage": "https://github.com/juliopolycarpo/mangostudio#readme",
20
+ "bugs": {
21
+ "url": "https://github.com/juliopolycarpo/mangostudio/issues"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "engines": {
27
+ "node": ">=18"
28
+ },
29
+ "keywords": [
30
+ "mangostudio",
31
+ "ai",
32
+ "image-generation",
33
+ "chat",
34
+ "cli"
35
+ ],
36
+ "optionalDependencies": {
37
+ "@mangostudio/cli-linux-x64": "0.1.0-canary.39c66ba",
38
+ "@mangostudio/cli-linux-arm64": "0.1.0-canary.39c66ba",
39
+ "@mangostudio/cli-darwin-x64": "0.1.0-canary.39c66ba",
40
+ "@mangostudio/cli-darwin-arm64": "0.1.0-canary.39c66ba",
41
+ "@mangostudio/cli-win32-x64": "0.1.0-canary.39c66ba",
42
+ "@mangostudio/cli-win32-arm64": "0.1.0-canary.39c66ba"
43
+ }
44
+ }