CLI Reference › Commands & Flagsv0.1
CLI Reference

Commands & Flags

Complete reference for the pseudo command-line interface.

Commands

CommandDescription
pseudo run <file>Run a .pseudo or .psu file
pseudo validate <file>Validate a source or .pmap file without running
pseudo explain <line>Show what a line of pseudo maps to
pseudo initCreate a custom.pmap and local pseudo.config
pseudo versionPrint the installed version

pseudo run - Flags

FlagTypeDefaultDescription
--lang <file>path-Use a specific .pmap file instead of auto-detected
-i <input>string/file-Inline input or input file (repeatable). Use \n for multiple values
--analyzeflagoffShow Big-O complexity analysis after run
--explainflagoffWith --analyze: show reasoning for complexity
--summaryflagoffWith --analyze: one-line output
--timeout <N>float5.0Execution timeout in seconds (0 = unlimited)
--max-iter <N>int10,000,000Maximum loop iterations before halting
--dry-runflagoffShow mapping resolution - do not execute
--stepflagoffStep through line-by-line (educational debugger)
--no-auto-printflagoffDisable automatic printing of standalone expressions

Examples

Basic run

bash
pseudo run algorithm.pseudo

Pass input values

bash
pseudo run greet.pseudo -i "Alice"
pseudo run greet.pseudo -i "Alice\n25"   # multiple inputs
pseudo run greet.pseudo -i inputs.txt    # from file

Use a custom pmap

bash
pseudo run algo.pseudo --lang custom.pmap
pseudo run algo.pseudo --lang ~/my_lang.pmap

Dry run - inspect mapping

bash
pseudo run sort.pseudo --dry-run
Output
Line 1: "func bubbleSort(arr)" → FUNC_DEF: name=bubbleSort, args=[arr] Line 2: " for i from 0 to len(arr)" → FOR_LOOP: var=i, start=0, end=len(arr) No errors found. Safe to run.

Complexity analysis

bash
pseudo run sort.pseudo --analyze
Output
Time: O(n²) Space: O(1)

Explain a mapping

bash
pseudo explain "for i from 0 to n"
pseudo explain --list FOR_LOOP
Output
Using: default.pmap Matched pattern : 'for {var:name} from {start:expr} to {end:expr}' Canonical form : FOR_LOOP Captures : {var} = 'i' {start} = '0' {end} = 'n'

Validate a pmap file

bash
pseudo validate custom.pmap
Output
Validating custom.pmap... ✓ 12 patterns loaded. No errors found.

pmap Resolution Order

When running a file, Pseudo picks the .pmap to use in this order:

  1. --lang flag - explicitly specified pmap wins
  2. pseudo.config - local project config in current directory
  3. ~/.pseudo/custom/custom.pmap - your global custom pmap
  4. ~/.pseudo/core/default.pmap - the bundled default (English)