The shell for AI agents. Typed pipelines. Multi-modal. Protocol-native.
Documentation • Getting Started • Syntax • Benchmark • AI Agents • File Editing • Migration • Protocols • External Integrations • AI Context • TUI Guide
Agentic Benchmark
Measured, not asserted. The standalone agentic-eval crate
scores any program for agentic use across the four axes that determine an agent's cost
and trust — token efficiency, determinism, reliability, safety — and rolls them
into a composite on a 0–10 scale. Real GPT-4 cl100k tokenizer; reproduce with
cargo run --example shell_agentic_eval --features real-tokens.
| Shell | tok | scal | det | rel | err | saf | rev | Composite (0–10) |
|---|---|---|---|---|---|---|---|---|
| AetherShell | 10.0 | 10.0 | 10.0 | 7.0 | 10.0 | 10.0 | 10.0 | 9.6 |
| Nushell | 7.1 | 6.4 | 0.0 | 0.0 | 5.0 | 0.0 | 0.0 | 2.3 |
| PowerShell | 5.9 | 6.4 | 0.0 | 0.0 | 5.0 | 0.0 | 0.0 | 2.2 |
| Bash / Zsh / Fish | 3.6 | 2.6 | 0.0 | 0.0 | 5.0 | 0.0 | 0.0 | 1.4 |
Sub-metrics: tok total-token efficiency · scal output per-item scaling · det
determinism · rel pass/actionable · err error actionability · saf blast-radius
gated · rev reversibility. Each axis is the mean of its sub-metrics; the composite is
the mean of the four axes. tok/scal/saf are measured for every shell; det/rel/
err/rev are measured on AetherShell's engine and a structural capability for the rest
(traditional shells have no byte-stable output, branchable errors, or rollback).
AetherShell leads on token cost (~2.8× fewer than POSIX shells, 2.4–3× vs PowerShell's default JSON) and is the only shell with deterministic typed output, machine-branchable errors, effect-gated safety, and transactional rollback. Full methodology, per-task token tables, and capability matrices are in Benchmarks below.
Getting Started
Install
cargo install aethershell # from crates.io
Other ways
# Homebrew
brew install nervosys/tap/aethershell
# From source
git clone https://github.com/nervosys/AetherShell && cd AetherShell
cargo install --path . --bin ae
# Prebuilt binaries for Linux, macOS and Windows
# https://github.com/nervosys/AetherShell/releases
Editor support: code --install-extension admercs.aethershell, or
cursor --install-extension admercs.aethershell for Cursor, VSCodium and other
forks.
Run it
ae # REPL
ae script.ae # run a script
ae -c 'expr' # evaluate one expression
ae tui # full-screen interactive mode
Three flags matter more than the rest, and they are what make this shell different from the one you are using now:
ae --agent # default-deny: destructive effects need approval
ae --workspace ./sbx # confine writes and deletes to one directory
ae --deterministic # byte-stable canonical JSON, for diffs and snapshots
Your first five minutes
1 + 2 # 3
"hello" | upper # "HELLO"
[1, 2, 3] | map(fn(x) => x * 2) # [2, 4, 6]
ls() | len # 199
pwd() # "/home/you"
Two things to know straight away.
A builtin used as a value needs its parentheses. ls() returns an array of
records; bare ls returns null.
ls() | first | keys
# ["ext", "is_dir", "modified", "name", "path", "size"]
Pipelines carry typed values, not text. There is nothing to parse, so there is nothing to parse wrongly:
ls(".") | where(fn(f) => f.size > 1024) | map(fn(f) => f.name) | take(5)
What it is for
|
Agents that touch a real machine An effect gate, a workspace jail and a keyed audit chain, so an agent can be given a directory rather than a machine. |
Data work without text parsing
|
Scripts that behave the same everywhere One language on Linux, macOS and Windows, with transpilers for the Bash, Zsh and PowerShell you already have. |
Examples
Find the five largest files under src/
ls("src") | sort_by("size") | reverse | take(5) | map(fn(f) => f.name)
Fetch JSON and pull one field out
http_get("https://api.github.com/repos/nervosys/AetherShell")
| from_json
| keys
http_get returns {body, headers, status, url} — the status is a number you
can branch on, not a line you have to grep.
Write a file and read it back
file_write("notes.txt", "hello")
# {bytes: 5, lines: 1, path: "notes.txt", success: true}
cat("notes.txt") # "hello"
Run an agent against your own shell, safely
export AETHER_AI=ollama # or openai, compat, irongate
export AGENT_ALLOW_CMDS=ls,cat,grep # default-deny until you say otherwise
ae --agent --workspace ./sandbox
agent("Find every TODO under src/", ["ls", "grep", "cat"])
Orchestrate several steps
let t = workflow_pipeline("audit", [
{id: "scan", run: "grep", args: ["TODO", "src"], output: "$.hits"},
{id: "count", run: "len", input: "$.hits"}
])
workflow_execute(workflow_create(t, {input: null}))
Keep a tamper-evident record of what ran
export AETHER_AUDIT_LOG=./audit.log
export AETHER_AUDIT_KEY_FILE=./audit.key
ae --agent --workspace ./sandbox script.ae
Every operation is appended to an HMAC-SHA256 chain. A rewritten entry fails verification rather than passing quietly.
Syntax
Every snippet below is executable as written.
Values
42 # Int
3.14 # Float
"text" # String
true # Bool
[1, 2, 3] # Array
{name: "ae", version: 12} # Record
Bindings
let x = 42 # immutable
let mut n = 1 # mutable
n = n + 1 # 2
let name = "world"
"hello ${name}" # "hello world"
Operators
1 + 2 1 - 2 2 * 3 10 / 4 # 2.5 — division is exact
10 % 3 # 1
1 == 1 1 != 2 1 < 2 2 >= 2
true && false # false
true || false # true
!true # false
&&, || and ! are the boolean operators. There is no and / or.
Functions
let double = fn(x) => x * 2
double(21) # 42
let add = fn(a, b) => a + b
add(2, 3) # 5
Pipelines
The pipe passes a value, so each stage receives whatever the last one produced.
[1, 2, 3] | map(fn(x) => x * 2) # [2, 4, 6]
[1, 2, 3, 4] | where(fn(x) => x > 2) # [3, 4]
[1, 2, 3, 4] | reduce(fn(a, b) => a + b, 0) # 10
[3, 1, 2] | sort # [1, 2, 3]
[1, 2, 3] | sum # 6
[1, 2, 3] | len # 3
[1, 2, 3] | reverse # [3, 2, 1]
[1, 2, 2, 3] | unique # [1, 2, 3]
[1, 2, 3, 4] | take(3) # [1, 2, 3]
[1, 2, 3] | slice(1, 3) # [2, 3]
[[1, 2], [3]] | flatten # [1, 2, 3]
[1, 2, 3] | any(fn(x) => x > 2) # true
[1, 2, 3] | all(fn(x) => x > 0) # true
range(1, 5) # [1, 2, 3, 4]
Strings
"hello" | upper # "HELLO"
" padded " | trim # "padded"
"hello" | contains("ell") # true
"a-b" | replace("-", "+") # "a+b"
"a,b,c" | split(",") # ["a", "b", "c"]
["a", "b"] | join(", ") # "a, b"
Records
let p = {name: "ada", age: 36}
p.name # "ada"
p | keys # ["age", "name"]
Control flow
if 1 > 0 { "yes" } else { "no" } # "yes"
match n {
0 => "zero",
n if n > 0 => "positive",
_ => "negative"
}
let result = try { cat("missing.txt") } catch { "fallback" }
Modules
Related builtins are also reachable by a dotted name:
file.exists("config.toml") # {exists: true, is_file: true, is_dir: false, path: ...}
file.read("config.toml")
sys.hostname() # "heimdall"
crypto.uuid() # "62375508-c80a-4490-9824-6b6a883acc88"
str.upper("ab") # "AB"
math.sqrt(9.0) # 3
The system
pwd() # "/home/you"
hostname() # "heimdall"
platform() # "linux"
sys_info() # {arch: "x86_64", family: "unix", os: "linux", ...}
exists("/etc/hostname") # {exists: true, is_file: true, ...}
JSON
{a: 1} | to_json # "{\"a\":1}"
from_json("{\"a\":1}") # {a: 1} — a Record, not a string
help() lists every builtin. ontology_manifest() gives an agent the same
thing as a compact, categorised index.
🤖 AI Coding Assistants
AI coding tools like Claude Code, ChatGPT, Cursor, Windsurf, and VS Code Copilot can leverage AetherShell for reliable, cross-platform OS operations.
The Problem
When AI assistants need to perform system operations, they face platform fragmentation:
# Different commands per platform
ls -la # Linux/macOS
dir # Windows cmd
Get-ChildItem # PowerShell
# Different escaping rules, encoding issues, error handling...
This forces AI tools to detect the OS, generate platform-specific commands, and handle edge cases—leading to errors and inconsistent behavior.
The Solution: AetherShell as Universal Runtime
# Same command works everywhere: Windows, macOS, Linux
ls("./src") # => [{name, size, modified, ...}]
file.read("config.json") # => String content
file.write("output.txt", data) # => {success: true, bytes: 42}
sys.hostname() # => "my-machine"
proc.list() | where(fn(p) => p.cpu > 10) # => High CPU processes
Benefits for AI Coding Tools
| Capability | Without AetherShell | With AetherShell |
|---|---|---|
| Cross-platform | Generate 3+ variants | Single command |
| File editing | Escape hell (sed, heredocs) |
file.replace(), file.patch() |
| Structured output | Parse text with regex | Native records/arrays |
| Error handling | Exit codes only | {success, error, details} |
| Safe execution | Shell injection risks | Typed parameters |
| Batch operations | Script multiple commands | Atomic operations |
Integration Example
An AI assistant can execute AetherShell commands directly:
# AI discovers system state
sys.cpu_info() # => {cores: 8, model: "Apple M2"}
sys.mem_info() # => {total: 16384, used: 8192}
net.interfaces() # => [{name: "eth0", ip: "192.168.1.5", ...}]
# AI modifies files reliably (no escaping issues)
file.replace("src/config.rs",
'const DEBUG: bool = false',
'const DEBUG: bool = true')
# AI performs batch operations atomically
file.patch("Cargo.toml", [
{find: 'version = "0.2.0"', replace: 'version = "0.3.0"'},
{find: 'edition = "2018"', replace: 'edition = "2021"'}
])
# => {success: true, patches_applied: 2}
# AI creates complex pipelines
ls("./src")
| where(fn(f) => f.name | str.ends_with(".rs"))
| map(fn(f) => {file: f.name, lines: file.read(f.path) | lines | len})
# => [{file: "main.rs", lines: 142}, ...]
Tool Discovery
AI assistants can discover available operations:
mcp.tools() # List all 130+ MCP-compatible tools
help() # list every builtin (takes no arguments)
file # => {read, write, exists, copy, move, patch, ...}
This enables AI tools to understand what operations are available and use them correctly—without hardcoding platform-specific knowledge.
AI Agents
# Simple query
ai("Explain recursion in one sentence")
# With context
ai("Summarize this file", {context: file.read("README.md")})
# Multi-modal (images, audio, video)
ai("What's in this image?", {images: ["photo.jpg"]})
ai("Transcribe this", {audio: ["meeting.mp3"]})
# Autonomous agent with tool access
agent("Find all TODOs in the codebase", ["file.read", "grep", "ls"])
# Agent with config
agent({
goal: "Fix code style violations",
tools: ["file.read", "file.write", "grep"],
max_steps: 20
})
# Multi-agent swarm
swarm({
coordinator: "Perform security audit",
agents: [
{role: "scanner", goal: "Find vulnerable deps"},
{role: "reviewer", goal: "Check for injections"},
{role: "reporter", goal: "Generate report"}
],
tools: ["file.read", "grep", "http.get"]
})
Agentic-First: token economy, safety, transactions, self-healing
AetherShell is optimized end-to-end for AI agents. Four things matter to an agent that a human shell ignores: how many tokens the output costs, whether an action is safe, whether a mistake can be undone, and whether a failed call tells the agent enough to fix it.
Compact, lossless output (AECON)
Set AETHER_MODE=agent and every tabular result renders as AECON — a
header-once format that emits each column name once, factors constant columns into
a single @const line, dictionary-encodes string columns with repeats
(@dict), delta-encodes large slowly-varying integers (@delta), factors a
shared leading prefix out of path/URI/id columns into one @prefix line, factors a
shared trailing run (extensions, domain tails) into @suffix, elides a cell
identical to the one above it in run-structured columns (@same), and expands
record-valued columns into dotted columns (@nest) so every pass above reaches the
leaves instead of stopping at a JSON blob. On
realistic tabular results that's ~2.8× fewer output tokens than POSIX shells. Versus
PowerShell the ratio depends on which output an agent parses: ~1.4× vs its display
Format-Table (not reliably parseable), ~1.6× vs compact ConvertTo-Json -Compress,
and ~2.4–3× vs the default ConvertTo-Json an agent gets without flags (measured
with the real GPT-4 cl100k tokenizer; the gap widens with row count).
AETHER_MODE=agent ae -c '[{name:"a",size:1,kind:"x"},{name:"b",size:2,kind:"x"}]'
# name size
# @const kind=x
# a 1
# b 2
@prefix and @suffix compose on the same column — the suffix is searched in the
residue the prefix leaves, so the two runs can never overlap even where they consume
a value entirely. Which encoding a column gets is decided by exact character cost,
not by heuristics: raw, @dict and @prefix/@suffix are each costed as they will
actually be emitted (including the @same elision that follows), and the cheapest
wins. A table with nothing to factor emits no metadata lines at all. On a 30-row
grouped listing with paths, those additions take the result from 265 to 153
tokens — 42% fewer (real cl100k, same rows, encoder before vs. after:
cargo test --test aecon_factoring --features real-tokens -- --nocapture).
@nest is the larger win, because a record-valued cell previously serialized as whole
JSON on every row, keys included — exactly the cost this format exists to remove, and
unreachable by any of the column passes. Expanding it into meta.region / artifact.path
subjects each leaf to @const, @prefix and the rest. On a 30-row API-shaped payload
that is 583 → 258 tokens, a 2.26× reduction
(cargo test --test aecon_nesting --features real-tokens -- --nocapture). Only records
are expanded, so an array cell stays a single atom; a top-level key is expanded only when
nothing already occupies its dotted namespace.
It's lossless and reversible: aecon_decode reconstructs the original rows
(with on-demand @type tags so numeric-looking strings and integral floats
round-trip exactly). The same default applies on the HTTP Agent API and MCP server.
Companion builtins: pick (project fields before rendering), budget (token-bounded
paging), digest (constant-token structural summary), canonical (deterministic
JSON), tokens (cl100k estimate), and ontology_manifest/ontology_describe
(progressive discovery). --deterministic renders byte-stable canonical JSON for
snapshot tests, caching, and diffs.
A real safety model
An effect taxonomy (Pure → ReadLocal → WriteLocal → Destructive → Process →
Network → Exec → Privileged) drives a capability → policy → approval → audit
pipeline. Agent mode (--agent) default-denies dangerous effect classes behind
content-bound approval tokens; a workspace jail (--workspace) confines writes
and deletes; a hash-chained audit log records every effecting action tamper-evidently;
RBAC grants bypass approval but never the jail (and can be loaded from a config
file at startup via AETHER_RBAC_CONFIG); every failure surfaces as a structured,
branchable E_* error — not just argument errors, but anything that fails, down to a
catch-all E_UNKNOWN — rendered as legible prose for humans. safety_status() reports
the live envelope.
Effect tags are enforced at a single guard() chokepoint, and the tagging itself is
checked in CI rather than trusted — by two lints that disagree on purpose. The first
(tests/effect_coverage.rs) reads names: a builtin whose name advertises a side
effect may not classify as Pure. It found 61 mis-tagged, among them ssh_exec,
terraform_destroy, kubectl_delete and every package installer (npm_install and
friends, which fetch remote code and run its install scripts). Nine high-blast-radius
executors are now approval-gated in agent mode.
But a name-based lint is the same reasoning that produced the mistakes — four builtins
were tagged as executing purely because they were called *_exec, when their bodies
execute nothing. So the second lint (tests/effect_ratchet.rs) reads bodies,
following calls four levels deep: if a function constructs a process, writes a file,
opens a socket or kills a process, it cannot be Pure whatever it is called. It found
306 more.
Coverage is reported, not asserted: 799 of the 1,318 names in the dispatch table carry an
explicit effect (tests/effect_coverage.rs prints the current figure). Three independent
checks say nothing dangerous hides in the remaining 519 — zero act
while classified Pure, zero read local s