Skip to content

Shell Overview

Endo is not just a programming language -- it is a fully interactive shell designed for daily use. It combines the familiarity of Bash with the expressive power of F#-inspired functional programming.

What Makes Endo Different?

Dual-Mode Prompt

At the same prompt, you can type traditional shell commands or F# expressions. Endo detects which mode to use based on the syntax:

# Shell mode -- runs external commands
ls -la
git status && echo "clean"

# F# mode -- triggered by `let`, `match`, list literals, etc.
let files = [1; 2; 3] |> map (_ * 2)
match (env "EDITOR") with
| Some e -> println $"Editor: {e}"
| None   -> println "No editor set"

There is no mode switch command. The parser recognizes the context automatically.

Structured Pipelines

Traditional shells pipe raw text between processes. Endo adds a second pipeline operator (|>) that passes typed values between functions:

# Shell pipe: bytes between OS processes
cat access.log | grep 404 | wc -l

# Forward pipe: typed values between functions
[10; 25; 3; 42] |> filter (_ > 10) |> map (_ * 2)

You can even transition from shell to functional in a single pipeline:

ps |> filter (contains _.command "nginx") |> length

See the FAQ for a detailed comparison of | vs |>.

Structured Output Recognition

When a command appears before |> and a matching output definition exists, Endo automatically parses the command output into typed records:

# docker ps output is automatically parsed into records
docker ps |> filter (_.status |> contains "Up") |> map _.names

See Structured Output for details.

Interactive Features

Syntax Highlighting

Endo highlights your input in real-time as you type. Keywords, strings, numbers, operators, constructors, and builtins each have distinct colors.

Context-Aware Completions

Press Tab or Ctrl+Space to trigger completions. Endo offers:

  • Command completion -- builtins and executables from $PATH
  • File path completion -- with tilde expansion
  • Variable completion -- environment variables and F# bindings
  • F# dot-access completion -- Option.map, record fields, method-style calls
  • History-based suggestions -- fish-style ghost text (dimmed, press Right to accept)

Rich Text Editing

The input field supports:

  • Multiline editing -- Alt+Enter or Shift+Enter for newlines
  • Selection -- Shift+arrows, Ctrl+A, double-click word, triple-click line
  • Clipboard -- Ctrl+C copy, Ctrl+V paste, Ctrl+X cut (via OSC 52)
  • Undo/Redo -- Ctrl+Z / Ctrl+Y
  • Mouse support -- click to position cursor, drag to select

Tooltips and Hover

Hover the mouse over a token to see contextual information:

  • Command path for external executables
  • Documentation for builtins and keywords
  • Type information for F# bindings
  • Error details for underlined diagnostics

Customizable Prompt

Endo ships with 10 built-in prompt presets and a modular prompt system:

set_prompt_preset "endo-signature"
set_prompt_layout "two-line"

See Configuration for full prompt customization options.

Key Bindings

Key Action
Enter Submit command
Alt+Enter / Shift+Enter Insert newline
Tab Trigger completion
Ctrl+Space Trigger completion (always shows popup)
Up / Down History navigation
Ctrl+C Copy selection (or interrupt if no selection)
Ctrl+V Paste
Ctrl+X Cut
Ctrl+Z Undo
Ctrl+Y Redo
Ctrl+A / Ctrl+E Smart cursor to line start / end
Ctrl+K / Ctrl+U Kill to end / start of line
Ctrl+W Delete word backward
Ctrl+D Delete character (or EOF on empty line)
Ctrl+L Clear screen
Ctrl+R History search
Right / End / Ctrl+E Accept ghost text suggestion

Use the bind builtin to customize key bindings at runtime. See Configuration: Key Bindings for the full list of default bindings and available actions.

Further Reading