jackwener/OpenCLI · error · CommandExecutionError

${result?.message || 'Could not add muted word.'}

Error message

${result?.message || 'Could not add muted word.'}

What it means

CommandExecutionError thrown when the in-page add-muted-keyword script definitively failed (result.ok is false and result.unconfirmed is false). The first argument is the error message surfaced from the page script (or a generic fallback), and the second argument advises that nothing was changed and the user should complete the action manually in the browser. Unlike the timeout case, the write did NOT start, so retrying in-CLI is safe.

Source

Thrown at clis/twitter/mute-word.js:176

                    if (hasNewExactKeywordRow(beforeRows)) {
                        return { ok: true, message: 'Muted word added.' };
                    }
                }
                return { ok: false, unconfirmed: true, message: 'Muted word submission did not show confirmation.' };
            } catch (error) {
                return { ok: false, unconfirmed: writeStarted, message: String(error?.message || error) };
            }
        })()`);

        if (result?.unconfirmed) {
            throw new TimeoutError(
                'twitter mute-word confirmation',
                5,
                `${result.message} Check muted words before retrying; the word may already have been added.`,
            );
        }
        if (!result?.ok) {
            throw new CommandExecutionError(
                result?.message || 'Could not add muted word.',
                'Nothing changed. Open Twitter/X muted word settings in the browser and retry.',
            );
        }

        return [{
            keyword,
            status: 'success',
            message: result.message || 'Muted word added.',
        }];
    },
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Open https://x.com/settings/add_muted_keyword in a normal browser and add the keyword manually — nothing was changed by the failed run.
  2. Verify the browser session is logged in and can actually reach the muted-keyword settings page (not a login redirect).
  3. Check whether X changed the add-keyword UI; update the opencli twitter CLI to a version with current selectors.
  4. Validate the keyword is acceptable to X (length/characters) and that your account tier supports muted keywords.
Defensive patterns

Strategy: fallback

Validate before calling

const res = await page.goto('https://x.com/settings/add_muted_keyword');
if (!res || !res.url().includes('add_muted_keyword')) {
  throw new Error('Cannot reach muted-keyword settings; session may be logged out');
}

Try / catch

try {
  await run(['twitter', 'mute-word', kw]);
} catch (err) {
  if (err.message.includes('Could not add muted word')) {
    console.warn('Nothing was changed. Add manually: https://x.com/settings/add_muted_keyword');
  } else throw err;
}

Prevention

When it happens

Trigger: The in-page script returned { ok: false, message } without writeStarted — selectors for the add-keyword form/button were not found, the page did not load the add_muted_keyword settings route, or Twitter rejected the input (e.g. invalid/duplicate keyword rejected by the UI before any write).

Common situations: X.com UI redesign breaking the selectors the script relies on; the session landing on a login wall instead of settings; running against an account type (e.g. some restricted/premium contexts) where muted keywords are unavailable; invalid keyword input rejected client-side.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/83e55b3e6b6efdde. Report an issue: GitHub.