jackwener/OpenCLI · error · CliError
ARGUMENT
ARGUMENT
Error message
An email address is required.
What it means
The paperreview `submit` command needs an email address for the submission payload. The CLI trims kwargs.email and throws CliError with code ARGUMENT (with hint 'Pass --email <address>') when it is empty. The check happens after the PDF is read but before any submission proceeds.
Source
Thrown at clis/paperreview/submit.js:35
{ name: 'prepare-only', type: 'bool', default: false, help: 'Request an upload slot but stop before uploading the PDF' },
{ name: 'timeout', type: 'int', required: false, default: 120, help: 'Max seconds for the overall command (default: 120)' },
],
columns: ['status', 'file', 'email', 'venue', 'token', 'review_url', 'message'],
footerExtra: (kwargs) => {
if (kwargs['dry-run'] === true)
return 'dry run only';
if (kwargs['prepare-only'] === true)
return 'prepared only';
return undefined;
},
func: async (kwargs) => {
const pdfFile = await readPdfFile(kwargs.pdf);
const email = String(kwargs.email ?? '').trim();
const venue = normalizeVenue(kwargs.venue);
const dryRun = kwargs['dry-run'] === true;
const prepareOnly = kwargs['prepare-only'] === true;
if (!email) {
throw new CliError('ARGUMENT', 'An email address is required.', 'Pass --email <address>');
}
if (dryRun) {
return summarizeSubmission({
pdfFile,
email,
venue,
message: 'Input validation passed. No remote request was sent.',
dryRun: true,
});
}
const { response: uploadUrlResponse, payload: uploadUrlPayload } = await requestJson('/api/get-upload-url', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
filename: pdfFile.fileName,
venue,
}),
});View on GitHub (pinned to 49907e53dc)
Solutions
- Re-run with --email you@example.com as the hint suggests.
- Validate the email variable in wrapper scripts before calling the CLI.
- Note email is required even for --dry-run/--prepare-only since it is part of the prepared payload.
Example fix
// before cli submit --pdf paper.pdf // after cli submit --pdf paper.pdf --email author@example.com
Defensive patterns
Strategy: validation
Validate before calling
const email = process.env.SUBMIT_EMAIL;
if (!email || !/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(email.trim())) {
throw new Error('Provide a valid --email address');
} Type guard
function isEmail(v) {
return typeof v === 'string' && /^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(v.trim());
} Try / catch
try {
await cli.submit({ pdf: pdfPath, email: '' });
} catch (err) {
if (err.code === 'ARGUMENT' && /email/i.test(err.message)) console.error('Pass --email <address>');
else throw err;
} Prevention
- Always include --email even for --dry-run/--prepare-only.
- Validate the email format in wrapper scripts.
- Set a default email in CI config and assert it exists.
When it happens
Trigger: Running submit without --email, or with an empty/whitespace-only value.
Common situations: Forgetting the flag on first use; scripts with unset EMAIL variables; confusing --dry-run/--prepare-only flows where email still must be supplied.
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
- symbol is required
- Either --product-id or --url is required
- --city is required (numeric city ID from `ctrip search` or `
- --${name} is required (e.g. 北京 / 上海)
- hotel id is required (numeric id from `ctrip hotel-suggest`,
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/e72dcefd9d1a3b0c.
Report an issue: GitHub.