Repository navigation
[0.2.0] - 2026-07-26
This is a large hardening pass focused on security, robustness, and testing.
Security
- Templates are no longer rendered through the shell. Previously template
contents were run througheval, so a template (or a prompt / recorded
context interpolated into one) could execute arbitrary commands. Rendering is
now a strict allowlist substitution with JSON escaping and no shell
evaluation. -O KEY=VALUEno longer runs througheval. It is assigned directly and the
key is validated, closing a command-injection hole (-O 'X=$(cmd)').
Note: as a consequence of the safe, allowlist-only template renderer, variables
set via-Oare exported into the environment but are no longer substituted
into templates (the oldevalrenderer did expand them). Only the fixed
placeholder allowlist is rendered.- Config files are only sourced when trusted: owned by the current user (or
root) and not group-/world-writable. This blocks the "hostile.ellrcin the
current directory" arbitrary-code-execution vector. Refusals are now reported
at a visible log level. ELL_API_STYLEand template names are validated as single path segments, so
they cannot be used to source/load arbitrary files by path traversal.- The recorded terminal context (
SHELL_CONTEXT) now passes through the
post_inputhooks, so redaction applies to it too, not just the prompt. - The API key is kept out of the process table: it is passed to curl via a
--configfile (mode 0600, removed after use) instead of a--header
argument, and it is no longer logged at debug level. - ell refuses to send credentials to a plaintext
http://URL (loopback
excepted); override withELL_ALLOW_INSECURE_URL=true. Bracketed IPv6
loopback (http://[::1], with or without a port) is correctly recognised as
loopback and allowed. - When
ELL_API_KEYis empty the backends now send no auth header at all,
instead of an emptyAuthorization: Bearer/x-goog-api-key:. This matches
the preflight (which permits running with no key) and avoids the empty header
wrongly tripping the "refuse credential overhttp://" guard. - The auth header written to curl's
--configfile now escapes backslashes as
well as double quotes, so a key/header containing a backslash is passed to
curl intact instead of being mangled (a lone\tetc. was interpreted by
curl's config parser). - The bundled redaction plugin now ships disabled by default (its hook has a
.disabledsuffix); enable it by removing the suffix.
Fixed
- Streaming completions that finish abnormally (e.g.
length/MAX_TOKENS)
are now detected and reported as failures instead of silent success
(openai read the finish reason from the wrong path). - A value-taking option given with no argument (e.g.
ell -m) no longer causes
an infinite loop; it exits with a usage error. - Interactive mode exits cleanly on EOF (Ctrl-D) instead of looping forever, and
a final unterminated line is still processed. The exit hint now names Ctrl-D. -o/--outputis accepted as documented (previously only--output-file),
and output is no longer redirected to a file in record/interactive mode (an
always-true comparison was fixed).- The
--record"already enabled" guard now works, andELL_RECORDis
exported like the other flags. - Record mode re-execs ell by an absolute, shell-quoted path, so it works when
ell is run in place or is not onPATH. - Template resolution rejects path-traversal names and accepts an
ELL_TEMPLATE_PATHwith or without a trailing slash. Plugin hooks in paths
containing spaces/newlines are handled end to end: both discovered
(list_plugin_hooks) and executed --pipingnow shell-quotes a hook stage
whose path contains spaces instead of word-splitting it into a "No such file"
failure. - Missing
ELL_API_URLnow fails early with a clear, actionable message
(EX_CONFIG) instead of an opaque curl error; a missingELL_API_KEYwarns. - curl failures are reported with a human-readable explanation (DNS, connection
refused, timeout, TLS, …) rather than a bare exit code. The non-streaming path
now propagates curl's real exit code on a transport failure (as the streaming
path anddocs/Backends.mdalready promised) instead of collapsing it to1. - The interactive prompt is printed with
printfinstead ofecho -ne, whose
-n/-ehandling is unreliable across shells (ELL_PS1already holds real
escape bytes, matching howELL_PS2is printed). - Functions are exported with
export -frather than as empty variables. - Bash 4.1 compatibility is restored (the version gate, docs and CI now
consistently target 4.1). Plugin-hook discovery uses a here-string rather than
process substitution (< <(…)), which is a parse error underset -o posix
on bash 4.1; and the backend dispatcher resolves its directory correctly when
sourced directly (withBASE_DIRunset), not only when launched via ell.sh. - BSD/macOS toolchain fixes: the syntax-highlight plugin no longer spins into an
infinite loop under BSDawk(it usedawk -F '', a GNU-only extension) and
now uses bash builtins; the redaction plugin's word boundaries work under BSD
sed(which lacks\b); and record mode uses the BSDscript(1)command
syntax on macOS (script … file command) rather than the GNU-cform. - Windows (Git Bash / MSYS) fix: a
file://URL built from a POSIX path is
rewritten to thefile:///C:/…form the native curl understands, so the
bundledfile://backend and the offline tests work there.
Changed
- HTTP requests go through a shared
ell_curlwrapper with connection/overall
timeouts (ELL_CONNECT_TIMEOUT,ELL_MAX_TIME) and HTTP error handling
(--fail-with-body), so a stalled server no longer hangs and a 4xx/5xx no
longer surfaces as a vague "Unexpected format". - The openai and gemini backends share their non-streaming path, end-of-stream
reporting and PIPESTATUS handling viahelpers/backend_common.sh; each keeps
only its provider-specific streaming parser. helpers/http.shmoved out ofllm_backends/for consistency with the other
helpers.- The default log level is unified across entry points.
Performance
- The pure-bash JSON parser copies runs of ordinary string characters in one
operation and no longer forks a subshell per key lookup. - The gemini streaming parser tracks JSON object boundaries instead of
re-parsing the whole accumulated buffer per line (was O(n²)). - Streaming loops use bash builtins instead of a
grep/cut/trsubprocess
per line, and logging no longer forksdate/basenameper line. - The syntax-highlight and paginator plugins' per-character loops likewise use
bash pattern matching / parameter expansion instead of forkingecho | grep,
echo | cutorawkfor each character.
Added
- Documentation:
docs/Architecture.md,docs/Backends.md, expanded
docs/Templates.mdanddocs/Risk_Consideration.md, and this changelog. - Extensive test coverage: unit tests for argument parsing, config loading, path
resolution, the HTTP helper, template rendering, the JSON parser, logging, the
syntax-highlight and paginator plugins; and end-to-end tests for the request
pipeline, hook stages, interactive mode, output redirection, error paths, the
launcher, record mode, the bash version gate and terminal-size fallback. - CI now also runs the suite on macOS (BSD toolchain) and on Windows under both
Git Bash and a fuller MSYS2 environment. Tests that depend on a facility a
platform lacks (POSIX permission bits, real symlinks,script(1), an
isolablebash) detect that at runtime andSKIPinstead of failing. - The test suite no longer depends on
cmp(1)/diffutils for byte-exact
comparisons (it uses a pure-bash comparison), so it runs on minimal
environments; and CI does not install diffutils, keeping that guarantee under
test. - Documentation: a "Windows" section in
docs/Configuration.mdand a README
note spelling out Git Bash's limitations (the config-trust check and the
0600credential file are not enforceable there) and recommending WSL/MSYS2.
What's Changed
- Improve documentation by @simonmysun in #19
- add example of reading from stdin by @simonmysun in #21
- Documentation improvements by @simonmysun in #22
- Update scripts with better comments to improve readability. by @simonmysun in #23
- Add output option. Implements #15 by @simonmysun in #24
- Throw errors when executed with bash version before 4.2. Avoids #25 by @simonmysun in #26
- Allow setting TO_TTY from outside. Fixes #27 by @simonmysun in #28
- Add comment to explain why the if condition is separated by @simonmysun in #29
- Compatibility and Dependency improvements by @simonmysun in #31
- Smoke tests by @simonmysun in #34
- Make the code POSIX compliance, partially resolves #32 by @simonmysun in #35
- Docs improvements by @simonmysun in #36
- Bugfix wrong log levels by @simonmysun in #38
- [bugfix] read without -r will mangle backslashes. by @simonmysun in #39
- [Feat] redaction plugin by @simonmysun in #40
- #14 add tip in docs to remind user not to use commandline arguments i… by @simonmysun in #41
- #14 also add tip in usage output by @simonmysun in #42
- Typo fix in comment and usage text by @simonmysun in #44
- feat: read configuration from XDG base directory and new install instructions, etc by @simonmysun in #45
- fix: follow up to #45 by @simonmysun in #47
- feat: remove perl dependency by @simonmysun in #46
- feat: improve testing framework and add CI by @simonmysun in #48
- Fix/many problems identified by ai by @simonmysun in #49
- release: v0.2.0 by @simonmysun in #50
New Contributors
- @simonmysun made their first contribution in #19
Full Changelog: v0.1.1...v0.2.0