can1357/oh-my-pi · error · Error

Invalid boolean value: ${rawValue}. Use true/false, yes/no,

Error message

Invalid boolean value: ${rawValue}. Use true/false, yes/no, on/off, or 1/0

What it means

`omp config set` validates boolean settings against an accepted token list (true/1/yes/on, false/0/no/off, case-insensitive). If the raw value string doesn't match any token, parseAndSetValue throws this error telling the user the accepted forms. Nothing is written to settings.json on failure.

Source

Thrown at packages/coding-agent/src/cli/config-cli.ts:188

			return "(string)";
	}
}

// =============================================================================
// Schema-Driven Value Parsing
// =============================================================================

function parseAndSetValue(path: SettingPath, rawValue: string): void {
	const schemaType = getType(path);
	let parsedValue: unknown;

	const trimmed = rawValue.trim();
	switch (schemaType) {
		case "boolean": {
			const lower = trimmed.toLowerCase();
			if (["true", "1", "yes", "on"].includes(lower)) parsedValue = true;
			else if (["false", "0", "no", "off"].includes(lower)) parsedValue = false;
			else throw new Error(`Invalid boolean value: ${rawValue}. Use true/false, yes/no, on/off, or 1/0`);
			break;
		}
		case "number":
			parsedValue = Number(trimmed);
			if (!Number.isFinite(parsedValue)) throw new Error(`Invalid number: ${rawValue}`);
			break;
		case "enum": {
			const valid = getEnumValues(path);
			if (valid && !valid.includes(trimmed)) {
				throw new Error(`Invalid value: ${rawValue}. Valid values: ${valid.join(", ")}`);
			}
			parsedValue = trimmed;
			break;
		}
		case "array": {
			let parsed: unknown;
			try {
				parsed = JSON.parse(trimmed);

View on GitHub (pinned to 9690622007)

Solutions

  1. Re-run with an accepted token: `omp config set <key> true` (or false/1/0/yes/no/on/off).
  2. Check for stray shell quotes: use `omp config set theme dark` not `omp config set theme "'dark'"`-style quoting mistakes for booleans.
  3. Run `omp config get <key>` first to confirm the key is actually a boolean setting.
  4. Run `omp config list` to see valid keys and their types.

Example fix

// before
$ omp config set autocommit enabled
// after
$ omp config set autocommit true
Defensive patterns

Strategy: validation

Validate before calling

const BOOL_TOKENS = new Set(["true", "false", "1", "0", "yes", "no", "on", "off"]);
function setBool(key: string, raw: string) {
  if (!BOOL_TOKENS.has(raw.trim().toLowerCase())) throw new Error(`Use true/false, yes/no, on/off, or 1/0 for ${key}`);
  return Bun.$`omp config set ${key} ${raw.trim().toLowerCase()}`;
}

Prevention

When it happens

Trigger: Running `omp config set <boolean-key> <value>` where <value> is not one of the accepted truthy/falsy tokens — e.g. `true ` with quotes, `enabled`, `True!`, `y`, or an empty string.

Common situations: Users passing words like `enable`/`yes!`/`y` out of habit; shell quoting mishaps leaving stray quotes in the value; copy-pasting values with trailing whitespace or invisible characters.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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