What the catalog is

The command catalog is the single source of command signatures. The binder, the built-in help, the model description, the reference documentation, the tool definitions and the conformance suite all read it, as the catalog specification defines. It consists of TOML files in the format nurt-catalog/1: core.toml for the core commands, one file for each optional group, and an index (_index.toml) that lists the files and the expected number of commands.

Each command entry states its name, its category (source, transform, check, change, run, system, journal or help), its reversibility (read, reversible, reversible_if_preserved or irreversible), the input and output record kinds, and its parameters with type, position, default and a summary. A command can belong to one operating system; on another system binding answers with E_OS_ONLY.

[[command]]
name = "set"
category = "change"
reversibility = "reversible"
effect = "local"
implementation = "builtin"
input = ["none", "entry"]
output = ["effect"]
summary = "Set values at key paths, preserving layout."

Changes made by a command are recorded in the journal according to the reversibility stated here.

Core commands and optional groups

The 34 core commands are always described to a model. They cover files (list, find, info, read, lines, write, copy, move, remove, rename, create, attributes), text (search, replace, insert, edit), records (filter, select, sort, first, last, skip, count), checks (assert, verify), programs (run, jobs, stop, retry), the journal (history, undo, redo), continuation of a shortened response (next) and help. The other commands belong to optional groups, described on request.

Group Commands Covers Documentation
core 34 files, text, records, programs, the journal and help command pages
documents 3 structured documents by key and SQLite databases set
text 11 differences, patches, hashes, encodings, expressions and record operations diff
code 13 symbols, definitions, references, diagnostics, renaming, repository profile code.symbols
notebook 10 cells of Jupyter notebooks notebook.cells
git 22 Git repositories group git
archive 5 archives and compression archive.list
system 11 processes, ports, disks, host, environment, system logs, suspension group system
administration 34 services, accounts, groups, mounts, kernel parameters, power, disks, the registry provider, CIM, the firewall, routes, DNS and the clock group administration
package 5 system package managers group package
network 5 HTTP requests, downloads, name resolution, ping, interfaces group network
schedule 7 schedules of pipelines group schedule
journal 5 the journal: space, limits, state, pinned entries, purge journal.status
program 4 installed programs: lookup, search, descriptions group program
verify 8 tests and code analysis through typed wrappers test.run

The group pages describe scope, records, platform differences and reversibility; the other groups are described on the pages of their commands. The administration group holds 34 commands since 0.1.1.

How a command page is built

Every command of the catalog has one page, and every page belongs to a command. A page has a fixed order of sections, set out in the conventions of the command documentation:

Section Source
Synopsis generated from the catalog
Description written
Parameters (name, type, default, description) generated, descriptions can be extended
Input and output generated
Effect (category, reversibility and its conditions) generated, notes written
Examples (at least three) written
Errors and Related written

The first three examples are the ones that help <command> shows.

How the build checks the pages

The documentation build verifies that:

  • every command has a page and every page belongs to a command;
  • the front matter (command, group, summary) equals the catalog;
  • a generated section equals the text generated from the catalog;
  • a page has at least three nurt example blocks;
  • every example parses, binds, runs on a virtual file system and yields the expected fragment;
  • a command or parameter name in backticks exists in the catalog.

The test suite checks every file of catalog/: names are valid and unique, every type expression parses, a required parameter has no default, and the index lists every file with the right number of commands, summing to its total.

How names, parameters and types are validated

Binding runs before any effect. A program that cannot be valid is refused with a code that names the problem, and the error lists the nearest names or the accepted types, so the correction is part of the answer.

Code Problem
E_UNKNOWN_COMMAND, E_UNKNOWN_PARAM unknown name; expected lists up to eight nearest names
E_MISSING_PARAM a required parameter is missing
E_PARAM_CONFLICT parameters that exclude each other were given together
E_TYPE a value or a record stream has a type the place does not accept
E_UNKNOWN_VALUE an enumeration value that does not exist

Types are written as expressions such as path | list<path>, enum(report|force|abort) or stream<entry>. A quoted text is converted to path, glob, instant, key, size or duration in a place of that type. Each bound tree records a catalog_rev, the SHA-256 of the canonical catalog, so any change of a command, parameter or description changes the revision.

Every command

The index below lists every command with its summary. Each name leads to the page of the command, with its synopsis, parameters, effects, errors and examples.

Core68 commands

  • accounts List user accounts and groups.
  • assert Stop the program with E_ASSERT unless the records meet one condition.
  • attributes Change permissions, account, times and extended attributes of entries.
  • compress Compress files individually with gzip, zstd, xz, bzip2 or lz4.
  • convert Convert the text encoding, line endings or byte order mark of files.
  • copy Copy files and directories.
  • count Count the records.
  • create Create files, directories, links, junctions, named pipes, device nodes or temporary entries.
  • decompress Decompress individually compressed files.
  • describe List the fields of the input records with their types and an example value.
  • diff Compare two files, or the input with a file or named result, and return the differences as hunks.
  • disable Stop the input services from starting automatically.
  • disks List mounted volumes with capacity and free space.
  • distinct Keep one record of each distinct value with the number of occurrences.
  • edit Apply a list of changes to one file, all or none.
  • enable Make the input services start automatically at boot or login.
  • environment List environment variables with their values.
  • evaluate Evaluate an expression with arithmetic, times, sizes and built-in functions.
  • filter Keep the records that meet a condition.
  • find Find entries under a directory by name pattern and attributes.
  • first Keep the first records.
  • group Group records by a field or expression and count each group.
  • hash Compute digests of file contents.
  • help Describe commands, groups, errors, guides, the syntax and corrections.
  • history List operations of the journal.
  • host Describe the operating system, hardware, current account and home and temporary directories.
  • info Describe paths, including paths that do not exist.
  • insert Insert text before or after lines, matches or nodes, or at the start or end of files.
  • jobs Read the state, output or result of background jobs.
  • last Keep the last records.
  • lines Produce the lines of a file or of the input content.
  • list List the entries of a directory.
  • logs Read events from the system log: systemd journal, Windows Event Log or macOS unified log.
  • mount Mount a device or volume.
  • move Move files and directories.
  • next Read the next part of a shortened result.
  • open_files List the processes that hold a file or directory open.
  • parse Extract fields from text with the named groups of a regular expression.
  • patch Apply a unified or git diff to files under a root directory.
  • ports List network ports and the processes that hold them.
  • processes List running processes.
  • query Select and transform document values with a jq filter.
  • read Read text, images, PDF pages, notebooks or document keys.
  • redo Apply an undone operation again.
  • remove Remove files, directories, registry keys and values, lines, matches, document items, syntax nodes or finished jobs.
  • rename Rename entries by pattern or to a new name.
  • replace Replace text in files or in the found text.
  • restart Restart the input services.
  • resume Resume suspended jobs or processes.
  • retry Run the command of a job again with the same working directory and environment.
  • run Run a program without a shell; after wait it continues as a background job.
  • search Search file content for text, regular expressions or syntax patterns.
  • select Keep the given fields of each record and add computed fields.
  • services List system or user services with their state and start type.
  • set Set values at key paths of a JSON, YAML, TOML, XML, INI, CSV, properties, env or plist document, preserving its layout.
  • skip Drop the first records.
  • sleep Wait for a duration.
  • sort Sort the records by fields.
  • split Split lines into columns at a delimiter.
  • sql Run SQL statements on an SQLite database file; a statement that changes anything makes the call a change.
  • start Start the input services.
  • stop Stop jobs, processes or services.
  • summarize Compute count, sum, minimum, maximum and average of fields, optionally per group.
  • suspend Suspend the input jobs or processes until they are resumed.
  • undo Undo operations from the journal.
  • unmount Unmount a mount point.
  • verify Check a change with a pipeline and roll the change back when the check fails.
  • write Write text, bytes or records to a file.

accounts4 commands

analyze4 commands

  • analyze.check Check code with type checkers, linters, format checks, complexity and duplication analysis, and return a verdict.
  • analyze.format Format source files with the formatter configured for each language.
  • analyze.show Show the findings of an earlier analysis.
  • analyze.tools List the analysis tools detected for a project and whether they are installed.

archive3 commands

  • archive.create Create an archive from the input entries.
  • archive.extract Extract an archive into a directory, skipping entries that resolve outside it.
  • archive.list List the entries of a zip, tar, compressed tar, 7z, jar, whl or apk archive.

clock3 commands

code13 commands

  • code.actions List the code actions a language server offers for a range of lines.
  • code.call_hierarchy List the callers and callees of a function.
  • code.definition Find the definition of the symbol at a position or with a name.
  • code.diagnostics Report errors and warnings in source files.
  • code.hover Show the signature and documentation of the symbol at a position.
  • code.implementations Find implementations of an interface or types derived from the symbol.
  • code.languages List supported languages with file extensions, grammar versions and language server state.
  • code.outline List the symbols of a file as an outline.
  • code.profile Profile a repository: build and test commands, entry points, change hotspots from history and manifests.
  • code.references Find references to the symbol at a position, with a name or from the input.
  • code.rename Rename a symbol and its references across files in one operation.
  • code.symbols Find symbol definitions by name across a repository.
  • code.type_definition Find the definition of the type of the symbol.

disks2 commands

firewall4 commands

  • firewall.allow Allow traffic on a port.
  • firewall.deny Drop traffic on a port.
  • firewall.remove Remove the firewall rules that match a port, protocol, source, direction and zone.
  • firewall.rules List the rules of the firewall with their action, protocol, port, source, direction and zone.

git22 commands

  • git.blame Show the commit and author that last changed each line of a file.
  • git.branch List branches, or create, rename, switch or delete them.
  • git.checkpoint Create, list, compare, restore or delete checkpoints of the working tree and index kept outside branches.
  • git.clone Clone a repository over HTTPS or SSH into a new directory.
  • git.commit Record a commit and report its branch and files.
  • git.diff Show differences between revisions, the index and the working tree.
  • git.fetch Fetch objects and references from a remote over HTTPS or SSH.
  • git.log List commits of a revision, optionally limited to files, authors, dates or content.
  • git.merge Merge a branch into the current branch, or continue or abort a merge.
  • git.pull Fetch from a remote and integrate the changes into the current branch.
  • git.push Update references on a remote with local commits.
  • git.rebase Replay the commits of the current branch onto another revision, or continue, skip or abort a rebase.
  • git.reset Move the current branch to a revision, optionally resetting the index and working tree.
  • git.restore Restore files or selected hunks in the working tree or index from a revision.
  • git.review Check changes before a commit for conflict markers, whitespace errors, large or binary files, secrets, missing tests and subject format.
  • git.show Show commits with their changes, or the content of a file at a revision.
  • git.stage List, stage or unstage changes down to selected hunks and lines.
  • git.stash Save uncommitted changes in the stash, or list, show, apply, pop, drop or clear stash entries.
  • git.status Show the state of the working tree and index of one or more repositories.
  • git.switch Switch the working tree to a branch.
  • git.tag List tags, or create or delete a tag.
  • git.worktree Add, list or remove linked working trees.

groups4 commands

http2 commands

  • http.download Download a file over HTTP, resuming a partial download when possible.
  • http.request Send an HTTP request and return the response, optionally as text or Markdown.

journal5 commands

  • journal.limits Show the active expiry limits, or change them and report how many entries will expire.
  • journal.pin Protect journal entries from expiry by steps, age and size, or release that protection.
  • journal.purge Release journal entries and the space they hold.
  • journal.space Report free space, space reclaimable from the journal and the reserve of each volume.
  • journal.status Report the number of entries, space used, oldest entry and active limits with their sources.

modules2 commands

network6 commands

  • network.dns_set Set the DNS servers and search domains of an interface; an empty list of servers returns to automatic servers.
  • network.interfaces List network interfaces with addresses, MAC address, state and MTU.
  • network.ping Send ICMP echo requests to a host and report round-trip times.
  • network.resolve Resolve DNS records of a name.
  • network.route_add Add a route to the routing table.
  • network.route_remove Remove the routes that match a destination, next hop, interface and metric.

notebook10 commands

package5 commands

power3 commands

program4 commands

  • program.catalog Browse programs by category: categories, then subcategories or programs.
  • program.describe Describe a program with its version, source, description and usage guide.
  • program.find Locate programs in PATH, in the order the system resolves them.
  • program.search Search installed programs, package databases, system applications and configured program catalogs.

schedule7 commands

sysctl1 commands

test4 commands

  • test.failed Run again only the tests that failed in an earlier run.
  • test.list List earlier test runs.
  • test.run Run the tests of a project and return typed results with a fingerprint of the code state.
  • test.show Show the results of an earlier test run.

windows1 commands

  • windows.cim Query CIM instances through WMI on Windows, or call a method of the selected instances with invoke.

Where to go next

The features page groups the commands by what they work on, and the language page explains how a program is checked. The cookbook and the command pages hold the programs.