@opengsd/gsd-cloud 1.7.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/README.md +34 -0
- package/bin/gsd-cloud.js +27 -0
- package/package.json +38 -0
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# @opengsd/gsd-cloud
|
|
2
|
+
|
|
3
|
+
Connect a local GSD runtime to [GSD Cloud](https://cloud.opengsd.net) so you can
|
|
4
|
+
monitor and control your GSD projects from any browser.
|
|
5
|
+
|
|
6
|
+
This is a thin wrapper over `@opengsd/daemon`'s cloud runtime commands. Its only
|
|
7
|
+
added behavior is defaulting the gateway to `https://cloud.opengsd.net` for the
|
|
8
|
+
`login` and `pair` commands, so you never have to type `--gateway`. All
|
|
9
|
+
device-flow, pairing, and connection logic is provided by the daemon.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Browser-based pairing against GSD Cloud (recommended). Opens an approval URL,
|
|
15
|
+
# polls for authorization, then auto-connects. No --gateway needed.
|
|
16
|
+
npx @opengsd/gsd-cloud login
|
|
17
|
+
|
|
18
|
+
# Show current cloud runtime configuration and connection status.
|
|
19
|
+
npx @opengsd/gsd-cloud status
|
|
20
|
+
|
|
21
|
+
# Start the daemon using a previously paired device token.
|
|
22
|
+
npx @opengsd/gsd-cloud connect
|
|
23
|
+
|
|
24
|
+
# Remove cloud runtime configuration from the local config file.
|
|
25
|
+
npx @opengsd/gsd-cloud disconnect
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`login` (and `pair`) default to `https://cloud.opengsd.net`. To target a
|
|
29
|
+
different gateway, pass `--gateway <url>` explicitly — the explicit flag always
|
|
30
|
+
wins. The `status`, `connect`, and `disconnect` commands do not use a gateway.
|
|
31
|
+
|
|
32
|
+
## Requirements
|
|
33
|
+
|
|
34
|
+
- Node.js >= 22
|
package/bin/gsd-cloud.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Project/App: Open GSD
|
|
3
|
+
// File Purpose: gsd-cloud CLI entry — inject the default gateway then delegate to the daemon.
|
|
4
|
+
import { existsSync } from 'node:fs';
|
|
5
|
+
import { dirname, join } from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
|
|
8
|
+
const binDir = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const target = join(binDir, '..', 'dist', 'inject-gateway.js');
|
|
10
|
+
|
|
11
|
+
if (!existsSync(target)) {
|
|
12
|
+
process.stderr.write('gsd-cloud: build output missing. Run `pnpm --filter @opengsd/gsd-cloud run build`.\n');
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const { injectDefaultGateway } = await import('../dist/inject-gateway.js');
|
|
17
|
+
const { handleCloudRuntimeCommand } = await import('@opengsd/daemon');
|
|
18
|
+
|
|
19
|
+
const argv = injectDefaultGateway(process.argv.slice(2));
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
await handleCloudRuntimeCommand(argv, { binaryName: 'gsd-cloud' });
|
|
23
|
+
} catch (err) {
|
|
24
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
25
|
+
process.stderr.write(`gsd-cloud: fatal: ${msg}\n`);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@opengsd/gsd-cloud",
|
|
3
|
+
"version": "1.7.0",
|
|
4
|
+
"description": "Thin CLI wrapper that connects a local GSD runtime to GSD Cloud (cloud.opengsd.net)",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/open-gsd/gsd-pi.git",
|
|
9
|
+
"directory": "packages/gsd-cloud"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"bin": {
|
|
16
|
+
"gsd-cloud": "./bin/gsd-cloud.js"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "node ../../scripts/clean-package-dist.cjs && tsc",
|
|
20
|
+
"test": "pnpm run build && node --test dist/inject-gateway.test.js"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@opengsd/daemon": "^1.7.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/node": "^24.12.0",
|
|
27
|
+
"typescript": "^5.4.0"
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=22.0.0"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"README.md",
|
|
34
|
+
"bin",
|
|
35
|
+
"dist",
|
|
36
|
+
"!dist/**/*.test.*"
|
|
37
|
+
]
|
|
38
|
+
}
|