@opennous/cli 0.19.1 → 0.19.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opennous/cli",
3
- "version": "0.19.1",
3
+ "version": "0.19.2",
4
4
  "description": "Ownable CLI — set up Ownable, connect it to your coding agent, and read the Context API from your terminal",
5
5
  "type": "module",
6
6
  "bin": {
package/src/index.js CHANGED
@@ -695,9 +695,10 @@ runnerCmd
695
695
  .option("--api-key", "read on your own Anthropic or OpenAI API key instead of your plan (asked for once, kept only on this machine)")
696
696
  .option("--workspace <id>", "the workspace to read; the app's command fills this in")
697
697
  .option("--url <url>", "API base URL (default: https://api.opennous.cloud)")
698
- .action(async (opts) => {
698
+ .action(async (own, cmd) => {
699
699
  const { detectAgents, installedAgents, NO_AGENT } = await import("./backfill.js");
700
- const { installService } = await import("./runner.js");
700
+ const { installService, withParentOpts } = await import("./runner.js");
701
+ const opts = withParentOpts(cmd, own);
701
702
  const agent = await pickAgent(opts.agent, opts.apiKey ? installedAgents : detectAgents, NO_AGENT);
702
703
  // Your own API key (GET-1310): from the environment, or asked for now, and kept in ~/.nous (yours only).
703
704
  if (opts.apiKey) await saveModelKey(agent);
package/src/runner.js CHANGED
@@ -261,3 +261,14 @@ export function serviceStatus({ run = spawnSync, os = platform(), home = homedir
261
261
  : run("systemctl", ["--user", "is-active", "opennous-runner.service"], { encoding: "utf8" });
262
262
  return { installed: true, running: r.status === 0, ...where };
263
263
  }
264
+
265
+ /**
266
+ * A subcommand's options plus its parent's. `runner` and `runner install` both take --agent,
267
+ * --workspace, --api-key and --url, and commander gives a flag to the parent when both define it,
268
+ * so `runner install --agent codex --workspace X` reached install with neither (GET-1345).
269
+ */
270
+ export function withParentOpts(cmd, opts = cmd.opts()) {
271
+ const parent = cmd.parent?.opts?.() ?? {};
272
+ const own = Object.fromEntries(Object.entries(opts).filter(([, v]) => v !== undefined));
273
+ return { ...parent, ...own };
274
+ }