jackwener/OpenCLI · error · ArgumentError
dblp paper key is required
Error message
dblp paper key is required
What it means
Thrown by requireRecordKey when the paper/record key argument is missing or empty. Fetching a specific dblp record requires its key (e.g. conf/nips/VaswaniSPUJGKP17).
Source
Thrown at clis/dblp/utils.js:115
}
if (n > maxValue) {
throw new ArgumentError(`dblp ${label} must be <= ${maxValue}`);
}
return n;
}
export function requireQuery(value, label = 'query') {
const q = String(value ?? '').trim();
if (!q) {
throw new ArgumentError(`dblp ${label} cannot be empty`);
}
return q;
}
export function requireRecordKey(value) {
const key = String(value ?? '').trim();
if (!key) {
throw new ArgumentError('dblp paper key is required');
}
if (!KEY_PATTERN.test(key)) {
throw new ArgumentError(`dblp paper key "${value}" is not a valid record key`, 'Expected something like "conf/nips/VaswaniSPUJGKP17" — copy the `key` column from `dblp search`.');
}
return key;
}
/** Decode the small set of XML entities dblp emits in record bodies. */
export function decodeXmlEntities(text) {
if (!text) return '';
return String(text)
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/'/g, "'")
.replace(/"/g, '"')
.replace(/&#x([0-9a-fA-F]+);/g, (_, h) => String.fromCodePoint(parseInt(h, 16)))
.replace(/&#(\d+);/g, (_, d) => String.fromCodePoint(parseInt(d, 10)));View on GitHub (pinned to 49907e53dc)
Solutions
- Pass the record key as the argument, e.g. dblp paper conf/nips/VaswaniSPUJGKP17
- Copy the key from the `key` column of a previous `dblp search`
- Check that the shell variable or pipe supplying the key is non-empty
Example fix
// before node cli.js dblp paper // after node cli.js dblp paper conf/nips/VaswaniSPUJGKP17
Defensive patterns
Strategy: validation
Validate before calling
const key = (process.argv[3] ?? '').trim();
if (!key) {
console.error('Usage: dblp paper <record-key> e.g. conf/nips/VaswaniSPUJGKP17');
process.exit(2);
} Type guard
function isNonEmptyString(v) { return typeof v === 'string' && v.trim().length > 0; } Try / catch
try {
const row = await dblpPaper(rawKey);
} catch (err) {
if (/paper key is required/.test(err.message)) {
console.error('Pass a record key from `dblp search` (key column)');
process.exitCode = 2;
} else throw err;
} Prevention
- Capture the key from `dblp search` output before running `dblp paper`
- Check pipes/scripts that supply the key actually produce output
- Default unset shell variables explicitly before use
- Show usage text when the positional argument is missing
When it happens
Trigger: Running a dblp paper/record command with no key argument, an empty string, or a shell variable that expanded to nothing.
Common situations: Omitting the positional key; scripting with an unset variable; piping intended to supply the key that produced no input.
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
- dblp ${label} must be a positive integer
- dblp ${label} cannot be empty
- ${label} is required
- ${label} must be a positive integer
- ${label} must be <= ${maxValue}
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/1d71db0f443554be.
Report an issue: GitHub.