fed-field-editor fed

fed · terminal field editors

Terminal form fields.
As building blocks.

Discrete curses field editors — line, area, mask, list, check, radio — plus a form manager, a mockup converter, and a text companion. Call them from a shell script; they hand the value back on stdout. Zero dependencies beyond the Python 3 standard library.

9 tools zero dependencies Python 3 stdlib MIT
                  === Membership Survey ===

  Name:       Ada Lovelace                  Department:
                                            Sales             
  Email:      ada@example.com               Support           
                                            Engineering       
  Phone:      (555) 123-4567                Finance           

  Age:        36                            Plan:
                                            ○ Free            
  Acct #:     100042                        ○ Pro             
                                            ◉ Enterprise      
  Notes:                              
                                            Interests:
                                            □ Sports              
                                            ■ Music               
                                            □ Travel              
                                            ■ Reading             

why fed

Components, not an application.

Each editor does one job and gets out of the way. The calling script stays in control of the screen, the flow, and what every keypress means.

01

Subprocess-shaped

Invoke with positional args and flags; the value comes back on stdout, the exit reason on stderr, the action in the exit code (1–9).

02

Inline by design

The discrete editors draw their own field over your existing screen and never clear it. Your script owns the surrounding UI.

03

Whole forms too

fed form hosts every field type in one process from a dBASE-style @SAY/@GET definition — with validation and kv/json/shell output.

04

Nothing to install but Python

Standard-library curses only. No build step, no package manager, no runtime dependencies.

the field editors

Six inline editors.

Each renders only its own field. Give it a position, a size, and a value; it returns the edited text. Every screencap below is a real capture.

fed lineROW COL WIDTH MAXLEN

Single-line input with a horizontal viewport — a fixed-width window onto a longer string, scrolling to keep the cursor in view.

Ada Lovelace                
fed areaROW COL WIDTH ROWS MAXLEN

Multi-line editor with true word wrap and vertical scrolling. Soft-wraps on spaces; Enter for hard breaks.

The quick brown fox jumps over
the lazy dog.                 
                              
                              
fed maskROW COL MASK

Masked input: fixed pattern masks (phone, date, SSN, custom) where the cursor skips literals, or variable filter masks (int, float, hex, alpha).

(555) 123-4567
fed listROW COL WIDTH ROWS

Scrollable single-select list with character-jump search. Items inline (-i) or from a file. Returns the chosen item.

Apple                 
Banana                
Cherry                
Date                  
Fig                   
fed checkROW COL WIDTH

Checkbox group — Space toggles each item on and off. Returns the checked values, pipe-delimited.

□ Sports              
■ Music               
■ Travel              
□ Reading             
fed radioROW COL WIDTH

Radio group — Space selects, Enter selects-and-exits. Returns the single chosen value.

○ Free                
◉ Pro                 
○ Enterprise          

the rest of the kit

Sketch it, render it, decorate it.

One example, end to end: a text mockup becomes a form definition, which fed form renders into an interactive screen.

fed make — mockup to definition

Draw the form as a plain-text mockup — [...] brackets where the fields go, a short attributes section under a %% line. fed make reads the geometry and emits a ready fed form definition. Below is the real examples/profile.mockup and exactly what fed make produces from it.

$ cat examples/profile.mockup
              === Edit Profile ===

Name:    [__________________________]

Email:   [__________________________]

Phone:   [________________]

Plan:    [______________________________]

%%

DEF FOCUS  bright-white,blue
DEF SELECT bright-yellow,red

name   -v "Ada Lovelace"     --required
email  -v "ada@example.com"  --required
phone  -v "5551234567"       --mask phone:classic
plan   -v "Pro" --type radio --items "Free|Pro|Enterprise" --required

↓ fed make examples/profile.mockup ↓

# the emitted examples/profile.def
DEF FOCUS  bright-white,blue
DEF SELECT bright-yellow,red

@0,14 SAY "=== Edit Profile ==="
@2,0 SAY "Name:"
@4,0 SAY "Email:"
@6,0 SAY "Phone:"
@8,0 SAY "Plan:"

@2,9 GET name  LINE 28 28 -v "Ada Lovelace" --required
@4,9 GET email LINE 28 28 -v ada@example.com --required
@6,9 GET phone MASK phone:classic -v 5551234567
@8,9 GET plan  RADIO 32 -i "Free|Pro|Enterprise" --orient horizontal -v Pro --required

fed form — the form manager

Hosts every field type in one process from that @SAY/@GET definition (or JSON). Validates with --required / --range / --in / --regex, colors fields per-token or form-wide, and emits values as kv, json, or eval-safe shell. Unlike the inline editors, it owns the screen and restores it on exit.

Here it is rendering the profile.def from above — the same example, end to end. (The hero up top is the same tool on a larger form.)

              === Edit Profile ===

Name:    Ada Lovelace                

Email:   ada@example.com

Phone:   (555) 123-4567

Plan:    ○ Free  ◉ Pro  ○ Enterprise

fed say — the companion

Non-interactive positioned, colored text to stdout — like tput cup + setaf, but speaking fed's color names. Runs no curses session; use it inline to draw the labels and decoration around your fields.

 RED   GREEN  BLUE 
Saved.

fed box — frames & panels

The other non-interactive companion: draws boxes, panels, and dividers to stdout. Six border styles — single double ascii solid half-in half-out — an optional interior fill, and verbatim titles (top) and status (bottom). Frame a region, drop in fed say labels and the inline editors, and you have a screen.

╔══════════[ Account ]═══════════╗   ▗▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▖
║                                ║   ▐..................▌
Name: Ada Lovelace            ║   ▐..................▌
║                                ║   ▐..................▌
Plan: Pro                     ║   ▐..................▌
╚════════ Tab to advance ════════╝   ▝▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▘

install

Unpack and run the installer.

Download a bundle below, then:

  1. Unpack the archive and enter it, then run the bundled installer (it needs sudo to write under the prefix):
    tar xzf fed-field-editor-*.tgz
    cd fed-field-editor-*
    sudo ./install.sh            # prefix defaults to /usr/local
  2. What it lays down: the single fed<prefix>/bin/, man pages → share/man/man1/, tldr pages → share/tldr/pages/common/. Override the location with PREFIX=/opt/fed ./install.sh.
  3. Use it: fed line 0 0 30 60 -v "hello", fed form customer.def, man fed. Every tool has -h, --help, and --version.

download

Grab a bundle.

One archive holds the tools, the fed wrapper, man & tldr pages, examples, the license, and the installer.

Latest build · MIT licensed · Python 3, no dependencies · all releases · documentation