jackwener/OpenCLI · error · ArgumentError

openreview venue cannot be empty

Error message

openreview venue cannot be empty

What it means

The venue command's func validates args.venue itself (it has no default) and throws ArgumentError when the trimmed value is empty. An empty venue would generate an API query with no filter, which is never intended.

Source

Thrown at clis/openreview/venue.js:31

cli({
    site: 'openreview',
    name: 'venue',
    access: 'read',
    description: 'List papers at an OpenReview venue (e.g. "ICLR 2024 oral" or full invitation id)',
    domain: 'openreview.net',
    strategy: Strategy.PUBLIC,
    browser: false,
    args: [
        { name: 'venue', positional: true, required: true, help: 'Venue name ("ICLR 2024 oral") or invitation ("ICLR.cc/2025/Conference/-/Submission")' },
        { name: 'limit', type: 'int', default: 25, help: 'Max results (max 200)' },
        { name: 'offset', type: 'int', default: 0, help: 'Pagination offset' },
    ],
    columns: ['rank', 'id', 'title', 'authors', 'keywords', 'primary_area', 'pdate', 'pdf', 'url'],
    func: async (args) => {
        const value = String(args.venue ?? '').trim();
        if (!value) {
            throw new ArgumentError('openreview venue cannot be empty');
        }
        const limit = requireBoundedInt(args.limit, 25, 200);
        const offset = requireNonNegativeInt(args.offset, 0);
        const isInvitation = value.includes('/-/');
        const filter = isInvitation
            ? `invitation=${encodeURIComponent(value)}`
            : `content.venue=${encodeURIComponent(value)}`;
        const path = `/notes?${filter}&limit=${limit}&offset=${offset}`;
        const json = await openreviewFetch(path, `openreview venue ${value}`);
        const notes = Array.isArray(json?.notes) ? json.notes : [];
        if (!notes.length) {
            const hint = isInvitation
                ? 'Check the invitation id (e.g. "ICLR.cc/2025/Conference/-/Submission").'
                : 'Try a venue text like "ICLR 2024 oral" or pass a full invitation id.';
            throw new EmptyResultError('openreview', `No papers found at venue "${value}". ${hint}`);
        }
        return notes.slice(0, limit).map((note, i) => {
            const row = noteToRow(note);

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Provide a venue text like 'ICLR 2024 oral' or a full invitation id like 'ICLR.cc/2025/Conference/-/Submission'.
  2. Check quoting so the argument is not swallowed by the shell.
  3. See the command's help for the venue argument.

Example fix

// before
cli venue "$VENUE"
// after
cli venue "${VENUE:?venue text or invitation id required}"
Defensive patterns

Strategy: validation

Validate before calling

const venue = String(process.argv[3] ?? '').trim();
if (!venue) { console.error('usage: cli venue <venue-text-or-invitation-id>'); process.exit(2); }

Type guard

const hasVenue = (v) => typeof v === 'string' && v.trim().length > 0;

Try / catch

try { await venueCmd(args); } catch (e) { if (e instanceof ArgumentError) { console.error(e.message); process.exit(2); } throw e; }

Prevention

When it happens

Trigger: Running the venue command without the venue argument, or with '' / whitespace only.

Common situations: User ran the venue command with no argument; shell variable holding the venue name is empty; quoting mistake passed an empty string (e.g. venue "").

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


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