Skip to content

cfl page create silently launches $EDITOR when no content source is provided #380

@rianjs

Description

@rianjs

What happened

Running cfl page create -s <space> -t "<title>" with no -f/--file, no --editor, and no stdin redirected — i.e. forgetting to provide content — does not produce a validation error. Instead, the command silently falls through to \$EDITOR (Vim by default) and opens it on a temp file. In a non-TTY context this produces a screenful of garbled escape codes followed by Error: editor failed: exit status 1.

Reproduction

$ cfl page create -s confluence -t "[Test] no-content"
Vim: Warning: Output is not to a terminal
Vim: Warning: Input is not from a terminal
<ESC[?1049h ... hundreds of escape codes ...>
Vim: Error reading input, exiting...
Vim: Finished.
Error: editor failed: exit status 1

Expected

Either:

  • Require an explicit content source (one of -f, --editor, or piped stdin) and emit a clear validation error like page content cannot be empty: use --file, --editor, or pipe content via stdin; OR
  • Suppress the editor fallthrough when stdin is not a TTY.

The same behavior likely affects cfl page edit <id> when no --title, --parent, -f, --editor, or stdin is given.

Discovered during evidence-backed surface inventory; raw capture at /tmp/cfl-outputs-60314/raw/page.create.no-content.txt.

cfl version: 1.0.47 (commit 16e7373)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions