Getting started
Introduction
Tenon is a command-line toolkit for your Flex models and the components you build against them. It checks and diagrams your models, proves that their protocols behave, tests your components against their specifications, and traces requirements to the evidence, and it runs the same way on your machine as it does in CI. With Tenon, you can:
- Check Flex sources and draw diagrams of their protocols.
- Model-check protocols to prove they behave as specified.
- Test a component you’ve built against its Flex specification.
- Trace requirements to the evidence that supports them.
- Save the checks your project needs as a workflow, then run it on your machine or in CI.
If you’re new to Tenon, the Quickstart takes you from an install to a verified run in CI.
tenon inittenon workflow new Systemtenon workflow run SystemInstall
install.sh, in the bundle Tangram sends you, installs
Tenon on your machine. There’s one bundle for each platform, macOS on
Apple silicon and Linux on x86-64, and on Windows you install the Linux
bundle inside WSL2. Before you install, check the download against the
.sha256 file that comes with it.
The installer puts tenon on your PATH, in
~/.local/bin unless Tenon is already installed somewhere
else, with its report tools and these docs
beside it in ~/.local/share/tenon. It also loads Tenon’s
image into Docker, where component tests run, and sets up licensing for your organization’s
license server. Running it again is safe: it upgrades an earlier install
in place and keeps your settings.
Docker must be running when you install, and whenever you test a
component. HTML reports and dashboards also need python3;
without it, every check still runs.
Command:
./install.sh [--push-image <registry/repo>]
Options
TENON_CLI_BINDIR=<dir>-
Install to
<dir>instead of~/.local/bin. TENON_CLI_REPLACE_ROOT=1- Replace a different trust root that’s already installed, without asking. Without it, the installer asks, or keeps yours when it can’t ask.
--push-image <registry/repo>-
Install nothing on this machine. Instead, push Tenon’s image to your
container registry as
<registry/repo>:<version>, for your CI jobs to run in. See Run Tenon in CI.
shasum -a 256 -c tenon-1.6.1-acme-macos-arm64.tar.gz.sha256tar xzf tenon-1.6.1-acme-macos-arm64.tar.gzcd tenon-1.6.1-acme-macos-arm64./install.shtenon --versionTENON_CLI_BINDIR=/usr/local/bin ./install.sh./install.sh --push-image registry.example.com/tenonSet up licensing
tenon license configure connects Tenon to your
organization’s license server. It installs your trust root, sets the
server’s address, and then shows your license status, asking for
anything that’s missing. The installer runs it for you when your bundle
names a license server, so you’ll run it yourself only to change the
server or the trust root, and it’s safe to run again.
Every tenon flex and tenon verify command
needs a seat from the license server: a short-lived lease that Tenon
renews while it works. On your machine, Tenon keeps the seat between
commands, so the next one starts straight away. Tenon checks every seat
against your trust root, a public key that comes with your bundle.
Command:
tenon license configure [options]
Options
--server <url>- The license server’s address.
--root-pubkey <file>-
The trust root to install. Tenon copies it to your licensing home
(
~/.flex). Without this option, Tenon uses the trust root already there. -y, --yes- Replace a different trust root without asking. Needed when there’s no terminal to ask in.
tenon license configuretenon license statustenon license configure --yes \ --server https://licensing.example.com \ --root-pubkey root-pub.pemUpgrade
tenon upgrade installs a newer Tenon from a bundle
Tangram sends you. It checks the bundle against the .sha256
file beside it, unpacks it, and runs its installer, the same as running
./install.sh from the unpacked bundle would. Your license
settings, your seat, and anything Tenon still has to send to the license
server are all kept.
Because tenon upgrade needs no seat, it works even after
your license has expired. It doesn’t run in CI, where you upgrade a
pipeline by pushing the new release’s image and pointing your jobs at it
instead (see Run Tenon in CI).
Command:
tenon upgrade <file-or-URL> [options]
Arguments
<file-or-URL>- The bundle to install, as a file or a URL. Tenon downloads a URL first.
Options
-y, --yes- Install without asking. Needed when there’s no terminal to ask in.
--check,--list,<version>- Ask a version index for the newest version, list every version, or install one by number. These work only when your install has a version index. Without one, give a file or URL.
tenon upgrade ./tenon-1.6.1-acme-macos-arm64.tar.gztenon upgrade -y \ https://files.example.com/tenon/tenon-1.6.1-acme-linux-amd64.tar.gzRead the docs
tenon docs opens these docs in your browser, from the
copy that the installer put beside Tenon. They’re plain pages on disk,
so they work without a network connection, and they’re always the docs
for the version you have installed. Tenon also prints the first page’s
file:// address, so you can open it yourself when Tenon
can’t open a browser for you.
tenon docs --text prints every page instead, as plain
text in reading order, for a pager or an AI agent. Neither command needs
a seat. Tenon opens the docs in the browser that BROWSER
names, if it’s set, and otherwise in your system’s default browser. If
your install has no docs, Tenon says so and exits with code
11, and installing a bundle again puts them back. For the
Flex language itself, use tenon flex docs.
Command: tenon docs [--text]
Options
--text- Print every page as plain text, instead of opening a browser.
tenon docstenon docs --text | lessUninstall
Tenon has no uninstaller, so you remove it by deleting what the installer put in place: its programs, its data and settings folders, and Tenon’s image in Docker. Any seat the machine holds frees itself when it expires.
Your licensing home, ~/.flex, holds your license
settings and trust root. Keep it if you plan to reinstall, or remove it
too for a clean machine.
rm -f ~/.local/bin/tenon ~/.local/bin/flexc ~/.local/bin/flexlrm -rf ~/.local/share/tenon ~/.config/tenondocker image rm tenon:1.6.1rm -rf ~/.flexGlobal options
These options work with tenon on its own and with every
command. Printing help never needs a license seat.
Options
-h, --help-
Print help for Tenon or any command.
tenon help <command>prints the same. -V, --version [--all]-
Print Tenon’s version. With
--all, also print the version of each of Tenon’s parts, as each one reports it, which Tangram may ask for when you report a problem.
tenon workflow run --helptenon help workflow runtenon --versionEnvironment variables
These environment variables change how Tenon runs, for a single command or for every command in a shell or CI job.
TENON_CLI_SEAT_HOLDER=<name>-
The name the license server records for your seat. Defaults to your user
name, or
tenon-ciin CI. TENON_CLI_ACTIONS=off- Don’t record what each licensed command was used for. See Security and data.
TENON_CLI_VERBOSE=1- Print extra diagnostics.
TENON_CLI_DOCKER_USER=<uid:gid>- The user that component tests run as in Docker, on Linux. Defaults to you. Set it empty to use the image’s own user.
TENON_CLI_REPORT_TOOLS=<dir>- Where Tenon’s report tools are. Defaults to where the installer put them.
TENON_CLI_DOCS=<dir>-
Where
tenon docsfinds the docs. Defaults to where the installer put them. TENON_CLI_UPGRADE_HEADER=<header>-
One HTTP header that
tenon upgradesends when it downloads, such as an access token for your file server:"PRIVATE-TOKEN: <token>". BROWSER=<command>-
The browser that
tenon docsopens the docs in. Defaults to your system’s default browser. FLEX_HOME=<dir>-
Your licensing home, which holds your license settings and trust root.
Defaults to
~/.flex.
export TENON_CLI_SEAT_HOLDER="$CI_PROJECT_PATH"Exit codes
Tenon’s commands exit with these codes, so that scripts and CI jobs can act on the result.
| Code | Meaning |
|---|---|
0 |
Success |
1 |
Findings: the model doesn’t check, or the component isn’t conformant |
3 |
The model uses something component tests don’t support |
10 |
No license seat: none free, the license has expired, or this machine isn’t registered for one |
11 |
A configuration or usage error |
12 |
Tenon couldn’t carry out the run, or couldn’t trust its results |
13 |
The license server can’t be reached |
130 |
Cancelled |
tenon flex commands, tenon verify model and
tenon verify requirements have some codes of their own,
which each command’s section lists. tenon verify model, for
example, exits 2 when a protocol can’t be proven either
way.
tenon verify component || exit $?