jackwener/OpenCLI · error · ArgumentError
Title must be at most ${MAX_TITLE_LEN} characters (got ${tit
Error message
Title must be at most ${MAX_TITLE_LEN} characters (got ${title.length}) What it means
parseCreateTitle enforces a maximum notebook title length of 200 characters (MAX_TITLE_LEN). Titles longer than that are rejected with this ArgumentError, reporting both the limit and the actual length, to match NotebookLM backend constraints before an RPC round-trip.
Source
Thrown at clis/notebooklm/create.js:16
import { cli, Strategy } from '@jackwener/opencli/registry';
import { ArgumentError, CommandExecutionError } from '@jackwener/opencli/errors';
import { NOTEBOOKLM_DOMAIN, NOTEBOOKLM_SITE } from './shared.js';
import { callNotebooklmRpc } from './rpc.js';
import { buildNotebooklmNotebookUrl, ensureNotebooklmHome, requireNotebooklmExecute, requireNotebooklmSession, verifyNotebooklmNotebookExists } from './utils.js';
const NOTEBOOKLM_CREATE_PROJECT_RPC_ID = 'CCqFvf';
const DEFAULT_EMOJI = '📒';
const MAX_TITLE_LEN = 200;
const NOTEBOOK_UUID_RE = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i;
export function parseCreateTitle(value) {
const title = String(value ?? '').trim();
if (!title) throw new ArgumentError('<title> is required');
if (title.length > MAX_TITLE_LEN) {
throw new ArgumentError(`Title must be at most ${MAX_TITLE_LEN} characters (got ${title.length})`);
}
return title;
}
export function parseCreateEmoji(value) {
const emoji = String(value ?? '').trim();
if (!emoji) return DEFAULT_EMOJI;
return emoji;
}
export function parseCreateProjectResult(result) {
let current = result;
while (Array.isArray(current) && current.length === 1 && Array.isArray(current[0])) {
current = current[0];
}
const id = Array.isArray(current)
? (typeof current[2] === 'string' && current[2])
|| (typeof current[0] === 'string' && current[0])View on GitHub (pinned to 49907e53dc)
Solutions
- Shorten the title to at most 200 characters before calling create.
- Truncate programmatically: title.slice(0, 200) (after trim).
- Move long content into sources (--content/--file) and keep the title a short label.
Example fix
// before const title = longDescription; // 350 chars create(title) // after const title = longDescription.trim().slice(0, 200); create(title)
Defensive patterns
Strategy: validation
Validate before calling
const title = String(rawTitle ?? '').trim();
if (title.length > 200) throw new Error(`Title too long (${title.length}/200); truncate before calling create`); Try / catch
try {
await create(rawTitle);
} catch (e) {
const m = String(e.message).match(/at most 200 characters \(got (\d+)\)/);
if (m) return create(rawTitle.trim().slice(0, 200));
throw e;
} Prevention
- Always slice(0, 200) programmatically derived titles.
- Keep long text in sources, not the notebook title.
- Unit-test title generation with worst-case long inputs.
When it happens
Trigger: Calling create with a title whose trimmed string length exceeds 200, e.g. pasting an entire document as the title.
Common situations: Programmatic use where a variable holding a long description is passed as title; multi-line pastes; generating titles from long prompts.
Related errors
- --title must be at most ${MAX_TITLE_LEN} characters (got ${t
- minimax music ${flag} must be at most ${max} characters
- Pass exactly one of --url, --content, --file (got:
- <title> is required
- --length must be a positive integer
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/3986be4607b48fa7.
Report an issue: GitHub.