(args)
| 41 | } |
| 42 | |
| 43 | async function connect(args) { |
| 44 | const studioUrl = requiredArg(args, "studio-url").replace(/\/$/, ""); |
| 45 | const hostId = requiredArg(args, "host-id"); |
| 46 | const hostToken = requiredArg(args, "host-token"); |
| 47 | const configPath = args["config"] || defaultConfigPath; |
| 48 | const config = { |
| 49 | createdAt: new Date().toISOString(), |
| 50 | hostId, |
| 51 | hostToken, |
| 52 | studioUrl, |
| 53 | workRoot: args["work-root"] || defaultWorkRoot, |
| 54 | }; |
| 55 | await writeJsonFile(configPath, config, 0o600); |
| 56 | console.log(`Saved SimDeck Studio provider config to ${configPath}`); |
| 57 | console.log("Run `simdeck provider run` to start the provider."); |
| 58 | } |
| 59 | |
| 60 | async function status(args) { |
| 61 | const config = await loadConfig(args); |
no test coverage detected