can1357/oh-my-pi · error

cloud start requires --repo-id, --repo-url, and --environmen

Error message

cloud start requires --repo-id, --repo-url, and --environment

What it means

Thrown by handleCloudCommand's `start` case when any of the three required options — --repo-id, --repo-url, --environment — is missing. The parser leaves them undefined and the handler validates the combination before calling client.startScan, since a cloud scan cannot be configured without all three identifiers.

Source

Thrown at packages/coding-agent/src/slash-commands/helpers/security.ts:298

								[
									item.id,
									item.state ?? "unknown",
									item.currentStep ?? "unknown",
									`repo=${item.repositoryId}`,
									`environment=${item.environmentId}`,
									item.repositoryUrl,
									item.remainingScans === undefined ? "" : `${item.remainingScans} scan(s) remaining`,
								]
									.filter(Boolean)
									.join(" "),
							)
							.join("\n"),
			);
			return;
		}
		case "start": {
			if (!options.repositoryId || !options.repositoryUrl || !options.environmentId) {
				throw new Error("cloud start requires --repo-id, --repo-url, and --environment");
			}
			const configuration = await client.startScan({
				repositoryId: options.repositoryId,
				repositoryUrl: options.repositoryUrl,
				environmentId: options.environmentId,
				lookbackDays: options.lookbackDays,
			});
			await runtime.output(
				`Codex Security cloud scan ${configuration.id} started for ${configuration.repositoryUrl}. This consumes cloud scan allowance.`,
			);
			return;
		}
		case "status": {
			if (!options.configurationId) throw new Error("cloud status requires a configuration id");
			await runtime.output(JSON.stringify(await client.getStats(options.configurationId), null, 2));
			return;
		}
		case "pull": {

View on GitHub (pinned to 9690622007)

Solutions

  1. Supply all three: `--repo-id <id> --repo-url <url> --environment <id>`.
  2. Get valid repository/environment ids from the Codex Security cloud console or `/security cloud scans` output (repo= and environment= fields).
  3. Remember a start consumes cloud scan allowance — configure deliberately.

Example fix

// before
/security cloud start --repo-id r1 --repo-url https://github.com/org/repo
// after
/security cloud start --repo-id r1 --repo-url https://github.com/org/repo --environment env_42
Defensive patterns

Strategy: validation

Validate before calling

const missing = ["--repo-id", "--repo-url", "--environment"].filter(f => !cmd.includes(f));
if (missing.length) throw new Error(`cloud start missing: ${missing.join(" ")}`);

Prevention

When it happens

Trigger: Run `/security cloud start --repo-id r1 --repo-url https://github.com/org/repo` (missing --environment), or `/security cloud start` with no flags at all.

Common situations: Assuming the repo id can be resolved from the URL or cwd; forgetting --environment because local scans don't need one; flags dropped when constructing the command from a script.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/f7c8bed55b56614b. Report an issue: GitHub.