Skip to content

Strands Shell commands

Strands Shell reimplements a curated subset of POSIX and coreutils in Rust, targeting the operations agents reach for most rather than a complete toolset. This page is the reference for what is supported and where behavior diverges from GNU or BSD: missing flags, unsupported features, and known gaps.

This page covers the external commands the shell reimplements. They group into text processing, file contents, file management, path and system utilities, networking, JSON, and search. The shell language and builtins have their own page, Shell language and builtins; lua is covered in Lua scripting.

These notes apply across commands:

  • Regex uses the Rust regex crate. Backreferences and lookaround are unavailable, so grep -P is unsupported and GNU BRE escapes are not translated.
  • jq is backed by jaq, a jq subset.
  • Unsupported flags are rejected, not ignored. Idioms like cp -p, set -o pipefail, or ln -sf produce an error rather than succeeding with incorrect behavior.
  • Multiple file arguments are not uniformly supported. cut and uniq read only the first file; head and tail return a hard error; cat, sort, and wc handle multiple files correctly.
  • Malformed numeric input passes silently. test, [, and arithmetic $(( )) treat non-numeric or empty operands as 0 without an error.
  • Stdin under strands-shell -c is not connected to commands (bad fd 0). Use an in-shell pipe instead.
CommandNotable gaps
grepNo -P, backreferences, lookaround, or -f. -o on empty-matching patterns emits blank lines.
sedNo branching (b, t, :label) or multiline (N, D, P); no -f. s///N replaces the incorrect match; range c emits per line.
trMissing [:punct:], [:cntrl:], and [c*n] repeats. -c two-set translate uses the incorrect replacement character.
cutNo -b or --complement. Reads only the first file when given several.
sortNo -c, -o, -V, or -h (-h incorrectly prints help). Keyed-tie order is non-deterministic. Loads all input into memory.
uniqNo -w or -D. Reads only the first file when given several.
wcNo -m (char count) or -L. Counts are correct; column padding differs from coreutils.
CommandNotable gaps
catNo -b, -s, -A, -e, or -t; no - stdin operand.
headNo -c, negative -n, or head -5 shorthand. Multiple files produce a hard error (no ==> headers).
tailNo -c, -f or -F follow, or shorthand. Multiple files produce a hard error.
teeNo -i. Standard usage (stdout plus files, -a) is supported.
CommandNotable gaps
cp-r works, including nested directories; no -p, -a, -f, or -i. cp f f silently succeeds.
mvRename, move, and cross-mount operations work; no -f, -i, -n, or -v.
rm-r, -f, and symlink non-follow behave correctly; no -d or -i.
mkdirNo -m. An invalid-option path returns exit 0.
rmdirNo -p.
touchFile creation and timestamp update only; no -t, -d, -c, or -r (cannot set a specific time).
ln-s only; hard links are refused by design; no -f, so ln -sf fails.
chmodFull support. Octal and symbolic modes; no -R.
CommandNotable gaps
ls-l omits owner, group, and link count; -a omits . and ... No -t, -S, -d, -F, or -h. Output is always single-column.
basenameNo -a or -s. basename / and "" diverge from coreutils.
dirnameSingle operand only. A trailing slash is mishandled (/usr/lib/ becomes /usr/lib).
readlinkPlain read only; no -f, -e, or -m canonicalization.
mktempNo -u or -t.
date%s is not expanded; unknown specifiers pass through literally; no -d or -r. UTC only.
envPrint-only. env VAR=v cmd, -i, and -u are not supported; use the shell-prefix form instead.
echoExpands escapes by default; -e and -E are printed literally (escape expansion cannot be disabled).
pwdFull support, including -L and -P.
sleepNo unit suffixes (0.1s). Respects the shell timeout.
true, falseFull support.
CommandNotable gaps
curlGET, POST, JSON, headers, auth, redirects, and -w are supported. No --max-time, --connect-timeout, or --retry (risk of an indefinite hang); no -I, -F, -A, -G, or cookie jar. SSRF and credential controls are enforced.

The SSRF guard and credential injection on curl are security features, covered in the security model. They are not optional and cannot be disabled per command.

CommandNotable gaps
jq (jaq)Broad filter coverage. A missing nested key throws an error, which breaks the .a.b // default pattern; no --arg, --argjson, or -S; inputs and setpath are absent.
CommandNotable gaps
find-name, -type, -maxdepth, -exec, and -print0 are supported. No -delete, -size, -mtime, -prune, or -regex. Children are sorted alphabetically, not in readdir order.
xargsSpace-separated -n, -I, -0, and -d are supported; attached forms (-n1, -I{}) and -t, -r, -L, -P are not. Implicitly behaves as -r.

lua runs a sandboxed Lua 5.4 interpreter for logic that would otherwise sprawl across a chain of pipes: multi-step transforms, structured-data manipulation, or calling nested MCP servers as Lua modules. See Lua scripting.

The shell language itself (pipelines, redirections, conditionals, loops, functions, and expansions) and the builtins (test, printf, read, set, and the rest) are documented in Shell language and builtins.