jackwener/OpenCLI · error · ArgumentError

Description too long: ${description.length} chars (max ${DES

Error message

Description too long: ${description.length} chars (max ${DESCRIPTION_MAX})

What it means

This ArgumentError is thrown by parseListCreateArgs when the --description value exceeds DESCRIPTION_MAX = 100 characters (after trimming). Twitter/X caps list descriptions at 100 chars, so the CLI rejects it up front rather than letting the API fail. The message reports the actual and maximum lengths.

Source

Thrown at clis/twitter/list-create.js:32

    responsive_web_profile_redirect_enabled: false,
    rweb_tipjar_consumption_enabled: false,
    verified_phone_label_enabled: false,
    responsive_web_graphql_skip_user_profile_image_extensions_enabled: false,
    responsive_web_graphql_timeline_navigation_enabled: true,
};

export function parseListCreateArgs(kwargs) {
    const name = String(kwargs.name || '').trim();
    const description = String(kwargs.description || '').trim();
    const modeRaw = String(kwargs.mode || 'public').trim().toLowerCase();
    if (!name) {
        throw new ArgumentError('List name is required', 'Example: opencli twitter list-create "My List"');
    }
    if (name.length > NAME_MAX) {
        throw new ArgumentError(`List name too long: ${name.length} chars (max ${NAME_MAX})`);
    }
    if (description.length > DESCRIPTION_MAX) {
        throw new ArgumentError(`Description too long: ${description.length} chars (max ${DESCRIPTION_MAX})`);
    }
    if (modeRaw !== 'public' && modeRaw !== 'private') {
        throw new ArgumentError(`Invalid mode: ${JSON.stringify(kwargs.mode)}. Expected "public" or "private".`);
    }
    return { listName: name, listDescription: description, listMode: modeRaw, privateFlag: modeRaw === 'private' };
}

function requireCreateListResult(result, expectedName, expectedMode) {
    if (!result || typeof result !== 'object') {
        throw new CommandExecutionError(`Unexpected result from twitter list-create: ${JSON.stringify(result)}`);
    }
    if (result.httpStatus === 401 || result.httpStatus === 403) {
        throw new AuthRequiredError('x.com', `Twitter CreateList returned HTTP ${result.httpStatus}`);
    }
    if (!result.ok) {
        const snippet = String(result.bodyText || '').slice(0, 300);
        throw new CommandExecutionError(`HTTP ${result.httpStatus} from CreateList: ${snippet}`);
    }

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Trim the description to 100 characters or fewer
  2. Check length before calling: description.trim().length <= 100
  3. Omit --description entirely (defaults to empty string) and edit it later

Example fix

// before
const description = "A curated list of accounts covering AI research, industry news, policy analysis, open source, and community events worldwide."; // 128 chars
// after
const description = "A curated list of accounts covering AI research, industry news, policy analysis, and open source."; // 98 chars
Defensive patterns

Strategy: validation

Validate before calling

const description = String(descArg || '').trim();
if (description.length > 100) {
  throw new Error(`Description must be <= 100 chars (got ${description.length})`);
}

Type guard

function isValidListDescription(desc) {
  return desc == null || (typeof desc === 'string' && desc.trim().length <= 100);
}

Try / catch

try {
  await opencli.twitter.listCreate({ name, description, mode });
} catch (e) {
  if (e instanceof ArgumentError && /Description too long/.test(e.message)) {
    console.error('Shorten the description to <= 100 characters.');
  } else { throw e; }
}

Prevention

When it happens

Trigger: Calling `opencli twitter list-create "Name" --description "..."` with a description string longer than 100 characters after trimming.

Common situations: Pasting a paragraph as the list description; generating descriptions programmatically from templates that exceed 100 chars; confusion with other platforms' larger bio/description limits.

Related errors


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