jackwener/OpenCLI · error · ArgumentError
<title> is required
Error message
<title> is required
What it means
parseCreateTitle validates the <title> positional argument for the notebooklm create command. An empty, whitespace-only, or missing title throws this ArgumentError. Titles are required because they are sent directly in the CreateProject RPC payload.
Source
Thrown at clis/notebooklm/create.js:14
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)View on GitHub (pinned to 49907e53dc)
Solutions
- Pass a non-empty title: `notebooklm create "My Notebook"`.
- In scripts, guard the variable: [ -n "$TITLE" ] || exit before invoking.
- Quote the title so shell word-splitting doesn't drop it.
Example fix
// before
create("")
// after
create("Research Notes") Defensive patterns
Strategy: validation
Validate before calling
const title = String(rawTitle ?? '').trim();
if (!title) throw new Error('Title is required before calling create'); Type guard
function isValidTitle(v) {
return typeof v === 'string' && v.trim().length > 0;
} Try / catch
try {
await create(rawTitle);
} catch (e) {
if (String(e.message) === '<title> is required') {
console.error('Usage: notebooklm create <title>');
process.exitCode = 2;
return;
}
throw e;
} Prevention
- Quote positional args in shell to prevent them being dropped.
- Guard script variables for non-empty values before invoking.
- Default to a fallback title when input is optional in automation.
When it happens
Trigger: Running `create` with no <title> argument, or with an empty/whitespace value like `create " "`.
Common situations: Script variable expanding to empty ($TITLE unset); shell quoting dropping the argument; forgetting the positional arg after flags.
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
- Pass exactly one of --url, --content, --file (got:
- Title must be at most ${MAX_TITLE_LEN} characters (got ${tit
- --length must be a positive integer
- --title is required
- --title must be at most ${MAX_TITLE_LEN} characters (got ${t
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/5705b4b4b5a50682.
Report an issue: GitHub.