ela
Contents

ManualShell

Binary

In the terminalela --spec binary

  • One binary, ela, is both shell and script runner.
  • ela with no arguments starts the interactive shell.
  • ela deploy.ela runs a script, and ela -c 'code' [args] runs the code given as one.
  • ela --login is a login shell, as is an ela started as -ela: it reads login.ela first, then does what the rest of its command line says (Login shell).
  • The shell and scripts share one interpreter, so behaviour is identical.

What ela tells about itself, for a person or an AI agent learning it:

OptionPrintsProc
--explain 'message'the rule behind an error message, why ela has it, a wrong and a right way to write it, and the spec section; every message ela gives has one, and its start, past its first value, is enoughela.explain(message)
--spec [topic]the section of this spec or the language spec for a topic (pipes, strings, catch, prompt), or the part of one a ### heading starts (null, switch, env.remove); no topic lists them. The specs, the editors' setup and the agent guide are built into the binary; at a terminal a section is laid out as md.render does it, elsewhere it is the Markdown it is written inela.spec(topic), ela.spec()
--builtins [--json]every built-in proc, package proc and shell built-in, with its parameters and what it does, in two columns as wide as $COLUMNS says, else the terminal, else 80: a long call breaks after a comma, its later lines indented under it, and what it does wraps in its own column. --json gives each whole, name, kind, call, params and doesela.builtins()
--lint [--json] filewhat can be found wrong without running anything, file:line:col: error: or warning:; only errors exit 1. A file of - is the script on stdin, said as stdin:line:colela.lint(path)
--check [--json] filethe first parse error, each import, relative or lib:, that finds no file or takes a built-in package's name, and each call that names no proc; or nothing. A file of - is the script on stdin
--translate bash [--report] scriptthe bash script, a line of bash or stdin (-) written as ela, what has no ela form kept as a # bash: comment and named on stderr, exiting 1; --report prints the counts and the list instead, for one script or several (From bash)
--fmt [--check] [file...]nothing: it lays each script out in place, as LANGUAGE.md, Layout has it, and leaves one that does not parse as it is, with its error; --check changes nothing, prints the files that would change and exits 1; no file lays stdin out to stdoutela.fmt(text)
--doctor [--json]the shell's setup, belowela.doctor()
--versionthe release, commit, build day and platform, then a line naming the licence, BSD-3-Clause; ela --license for the texts of what is built inela.version()
--licenseela's licence and those of what is linked into it: a line each, then each distinct text once, under a heading naming every part it covers
--agent [--save [folder] | --hooks [folder] | hook | commands [--json] line]the agent guide, AGENT.md; --save writes it as a skill and an AGENTS.md, --hooks the hook config, hook is the hook that lets ela through and refuses the rest with its ela form, commands every command a shell line would runela.commands(line)

--json gives file, ok and findings (line, col, severity, message) for --check and --lint, and status and checks (check, result, message) for --doctor.

The procs in the last column give what their options give, as data, from the same code (PACKAGES.md, The ela package).

What --lint finds #

ela --lint reads a script, and every file it imports, without running a line. Only an error makes it exit 1.

It reports as errors what the run would stop at:

  • a variable nothing assigns, or one read above every line that assigns it;
  • a proc reading a script variable, a constant assigned, env or keyring taken as a name;
  • a proc, package proc, struct field or enum value that doesn't exist, and a variable's field read without its $ (${g.runs} for ${$g.runs});
  • + between two strings, or a field read on one ("app-$VERSION.tar.gz"), where the script makes the value text;
  • a call with the wrong number of arguments, an argument named for no parameter or given twice, and a parameter without a default left out;
  • an argument a typed parameter refuses where the script shows its type (shout(42) for text: string, or a call's declared result);
  • an assignment of more or fewer values than its call gives, and a call that gives several values or none used as one or indexed (re.find(...)[1], with the try that catches it);
  • a condition whose call declares a result that is no bool, and try $( ) with one name;
  • what try gave compared with a number or text, try cmd == 0 or $err != "" on a name only try assigns, which is null or an Error;
  • a secret written in a keyring.store line, and a bare number to kill.

It warns of what may be meant:

  • $env.NAME of a variable neither set here nor by the script;
  • a secret from the keyring or ask.secret in a command's arguments, naming secret_file;
  • a command not on PATH here, and print;
  • a variable never read, and a change to a loop's item that nothing reads;
  • a catch signal block covering nothing, and a line after exit, return, break or continue;
  • a name off the naming style, with the name to write (LANGUAGE.md, Naming style), and pid(N) with N below 300.