Work the same way as in rust. Given the predicate, check if all the elements of the list satisfy it.
The swiss army knife to deal with colored text. Supports raw strings along with some short names and such. Also allows you to specify the shortcodes and such.
You can also specify it in a record, as follows:
let colors = {fg: "#001100", bg: "#FFFFFF", attr: b}
Attributes can be one of bold:bo, blink:bl, blink_fast:bf, normal:n dimmed:d italic:i underline:u reverse:re hidden:h strike:s double_underline:du
ansi reset resets it.
ansi gradient creates a gradient, with the standard
options of --(fg/bg)(start/end) to set the corresponding
colors.
ansi strip strips all the ansi markers out of the
text.
ansi link allows you to create a link for the terminal
from the URL piped into it and link text specified in the
--text flag.
prepends/appends the specified value to the piped input.
bits have or, and, not, rol, ror, shl, shr, xor subcommands. All of
them take the value of the thing to act on as the piped input and the
number by which to operate as the argument, and a way to specify the
number of bytes using the --number-bytes flag and
signedness using --signed.
This set of commands works with the bytestream type
add adds it to the start of the stream. Can be
changed with --index and --end flags. The two
can be combined to add to index from the end.
at just indexes it. Give it a range. Also supports
negative indices ala python.
build builds it up from a list, list of lists, or
just numbers as arg.
collect collects from a list as
input.
ends-with/starts-with check for the
basic stuff.
index-of gives you the indices: --all,
--end, and so on. --end only searches from the
end, indices are still from the front.
length,remove,replace,reverse,split:
standard. Replace takes --all
Interesting command. Prints a calendar. For the specified
--full-year, defaults to a single month, unless
--full-year is specified.
Prints characters from --integer or
--unicode codepoints
The first splits a range or a list based on the predicate, the second does it based on fixed size.
Collects a stream into a value. That's pretty much it.
create a list out of the column names/values.
Make the list shorter by removing all the elements that are null.
Date command: works with dates and such. Can convert from human time
to a datetime using date from-human. This is amazing as it
supports multiple formats. date humanize also converts it
to a time relative to now.
Decodes/encodes bytes into various encodings. base64
will do a base64 decoding which can be made url-safe by using
--url. decode/encode hex will convert a hex
string into bytestream/vice-versa.
Sets the default values. Can set it for a column in a table or any value in general. Can also use closures.
drop drops the last x rows, similarly
skip does that for the first x rows.
first and last keep the first few rows
respectively.
drop supports dropping the nth rows, and
can also drop column. skip can skip
until or while.
There's also select and reject that can
work on the columns. select and reject can
also do it for cells in a record. They both feature the
--optional flag. take is the same as
drop in behaviour.
The swiss army knife of filesizes. Has the --min-size
flag to ignore really small files, --exclude paths,
--long to recurse directories.
each is like rust map, and
each while basically the closure can return
null and the iterator stops. The last one is parallel.
Enumerate adds a $index to each of the
$item.
Makes an error the same way nushell's internal errors do.
Shows (or --skips) every nth row.
Allows you to explore the table. --peek allows you to
print the cell Your cursor was on.
explore regex is insane, it lets you interactively
develop the regex interactively, and it's awesome for that.
Does a regex find basically. Has all the flags relevant for regex.
Has explicit support for regex using --regex, and
--multiline for multiline matching, --dotall
for . to match all, --case-insensitive to do a
case insensitive match, --invert to match all that doesn't
meet the criteria, and --rfind to find the matches from the
reverse but only the first one.
Flattens a record or a list into a table or a list. Optionally takes
column names to flatten along those too. Can also flatten recursively
with the --all flag.
Name says it all. Has a lot of stuff in it.
bits: Formats integer/string/bytes like input into bits
with --endianness optionally specified.date: Formats a date, with --list listing
the cheatsheet.duration: Formats the input with the specified
unit.filesize: Format it into the given unit and optionally
for the cell paths specified.number: Gives a record containing multiple formats.
Remove prefix with --no-prefix flag.pattern: Format the columns based on the pattern
specified.Convert from something/into something else
Takes in a closure, where the argument for the closure is the previous value. Also takes in an initial value.
If an input stream is supplied, the closure takes two arguments, the in and the previous. The next becomes the previous for the closure.
Gets the value from the cell path. It can have case insensitive path
like --ignore-case and also optional
--optional. This can also be enforced at a cell level using
! and ? suffixes.
Lets you search the files and folders in a way similar to how bash
globs work. ? replaces one character. *
searches for multiple chars, and ** searches for nestings
as well.
--depth restricts depth, --no-file and
--no-symlink do what you think they do. So does
--exclude and --follow-symlinks.
reclaim the bash style ls output using this!
This lets you group things by their values/columns. If not anything,
groups by their raw values themselves. They preserve the original
structure as well, so you would want to call an
update cells on the result after if you want to remove it.
--to-table returns a table with the group and the items
column.
Has md5 and sha256 variants, that let you
output either plain hex or binary representation of the hash.
Use the first row of the table as column names
Hides an environment variable/load from a record
Creates a histogram of the input table.
Allows you to read input. Yeah. Has a --numchar option
that reads specific number of characters, and a --default
option that backs the variable by a default value. Default works when
the input is empty. Multiline can be entered using
--reedline flag.
Has a subcommand called list, that makes an interactive
selection. --multi allows you to select multiple of these,
--fuzzy allows you to select fuzzy using input, and
--index returns the index instead of the item itself.
Takes in a piped stream (optional), and uses the closures to generate the output and interleave them in arbitrary fashion.
go figure
Iterate over both keys and values in a record.
Relates to background tasks. It can create jobs, list them, find the job, kill, send and receive data over comm channels, tag them, and unfreeze them.
split the input incoming into lines. Can optionally
--skip-empty
Has a bunch of math functions. Mostly I've used sum and
avg subcommands.
merges two records/tables based on the values they provide. Column
values are overwritten if needed. Can do it recursively using
deep.
move columns here and there. Need to use one of
--before, --after, --first,
--last.
Parse command can parse the input, often automatically, and assign
columns based on the format string you provide. Columns can be ignored
with {_}, and suppors some fancy regex, where each capture
group becomes a column name. The actual regex itself is pretty
complicated tbh.
Bunch of commands to work with paths.
existsbasenamedirnameexpand: expand to absolutejoin: join the parts into a full path (takes input, or
through args)self: Gives the path of the script/module at parse
timerelative-toparse: Parses it into parent, stem and extension, and
--extension can be manually provided as wellsplit: Completely splits it. Including the root
/type: file, dir, symlinkReduce works the same way fold does in OCaml. Initial value is
usually the default for the type of stream coming into it. Can specify
initial value with --fold
The first one reverses the table columns (and also list). Rotate
literally rotates the table clockwise (like a matrix rotation). Can
optionally specify --ccw. roll rolls the
rows/columns when given up or down/left or right. Specify by how much
using the --by flag (default 1). The last is the regular
matrix transpose.
Creates a sequence. char will do it for chars,
date will do it for dates.
seq takes 3 arguments, begin, step, and end. Or just
begin and end. The character variant only takes 2, the last format.
The date variant has a lot of flags. --begin-date and
-end-date along with --increment for a
specific range. Alternately, you can specify one of the first two along
with --days argument. Apart from it, you can also specify
one of the first two, and increment, and the --periods that
you want the increment for. Can handle --input-format and
--output-format as well.
Returns the selected rows (takes a range).
Sorts data. --natural sorts by the number value if it's
part of a string. --ignore-case, well, does exactly that
for strings. --values sorts by values instead.
--reverse sorts in reverse.
The latter takes the cell path to sort by, and also takes in comparators for programmatic sorting.
Has multiple subcommands
cell-path works with cell paths and splits them,
checking if they are optional or insensitive.chars splits on characters and unicode codepoints, but
can split on --grapheme-clusters just for
completeness.column/row split into columns/rows based
on the delimiter provided. An optional max number can also be supplied
and --collapse-empty, and optionally it could be
--regex as well.list splits the list based on a separator
provided.words splits on words, and is used with
--min-word-length and
--grapheme-clusters.Has a bunch of commands to work with, most of them working on the
strings and such. Nothing significant as such, with the exception of
expand, distance, expand,
join, replace (can use regex and closures),
substring, and trim. There's a bunch of others
like starts-with and ends-with, and
reverse and replace and others.
Has a bunch of interesting commands for the system statistics and stuff
Time the closure
This is interesting because this takes the --timestamp
as a datetime, and --reference to use a file's datetime as
a reference.
Also possible to change only --modified and
--access time. Can let you --no-deref symlinks
and --no-create files.
returns --repeated, --count,
--uniqur and optionally --ignore-case. The
latter works how sort-by works.
Inserts things. That's pretty much it. Can take a closure too. If it's a table, inserts a new column.
The second updates the values at a particular index, or at a certain
column. upsert may also insert if missing.
Watches the file contents and runs a closure (or returns a stream of events if no closure).
Creates a sliding window over a list. With the size, the
--stride, and optionally the remainder.
Wraps the given value in a column.
zips two streams. Can also take a closure to generate the second stream from the input.