Getting started
With a coding agent
The Machine skill teaches a coding agent, such as Claude Code, Codex or Cursor, to work with Machine: install the client, sign it in with you, reproduce bugs and prove fixes. Install it for Claude Code and Cursor:
1 | mkdir -p ~/.claude/skills |
For Codex, use ~/.agents/skills in both places. Run the command again to
update the skill. Its source is in the
TestFlows Machine repository.
Then ask your agent what TestFlows Machine can do for your project.
To set up the client yourself, read on.
The client
You work with Machine through a client called machine. Install it with one
command:
1 | curl https://testflows.com/machine/install -fsS | bash |
The client is available only with a TestFlows account, so the installer first
signs you in, or creates your account, at the terminal: you give your email and
the code sent to it. If your account has not accepted the current Terms of
Service and Client EULA, the installer shows both and asks you to accept them
before anything is downloaded. The
installer signs out when it ends, so sign in with machine login afterwards.
Without a terminal, as in CI, the installer takes an API key from
TESTFLOWS_MACHINE_API_KEY instead, from an account that has accepted them.
The installer then downloads the client over HTTPS, checks it against the
SHA-256 checksum published next to it, and puts machine and machine-env in
~/.local/bin. If the checksum doesn’t match, nothing is installed. Where
another program named machine is already on your PATH, as
/usr/bin/machine is on a Mac, machine goes to ~/.local/share/machine/bin
instead, which is not on your PATH, and ~/.local/bin holds machine-env
alone. If ~/.local/bin isn’t on your PATH yet and your shell is bash or
zsh, the installer offers to add it to ~/.bashrc or ~/.zshrc. Otherwise,
or if you decline, it shows you the line to add yourself.
The installer also puts the Python SDK Core,
which the Python SDK runs on, in
~/.testflows/machine/sdk, checked the same way. Run the same command again
whenever you want to update.
Supported systems. The client runs on Linux, x86_64 and arm64, and on Macs
with Apple Silicon. It needs only the OpenSSH client, which macOS and most
Linux systems already have, and the installer never asks for root. If ssh is
missing, install it with your package manager, for example
sudo apt install openssh-client on Debian and Ubuntu. It doesn’t run on Intel Macs or natively on Windows; on Windows
you can use it inside WSL. On an ARM machine, a Mac with Apple Silicon
or arm64 Linux, the disks you build must still hold x86_64 programs; see
building disks on an ARM machine. If you
need another platform,
contact us and tell us which one. The
download page has the full list, and a way to check the
download yourself.
Behind a proxy that inspects TLS. The client trusts only Let’s Encrypt,
which issues the certificate of the Machine API, so a certificate from any other
CA is refused, including a proxy’s. The error names
TESTFLOWS_MACHINE_API_CA_FILE, an environment variable the client reads: set
it to a PEM file of the CAs to trust instead, such as your proxy’s.
1 | export TESTFLOWS_MACHINE_API_CA_FILE=/etc/ssl/certs/corporate-proxy-ca.pem |
The file replaces the Let’s Encrypt roots rather than adding to them. If the client must also connect without the proxy, add the Let’s Encrypt roots to the same file. The variable applies to the connection to the API alone: sessions are reached over SSH with certificates TestFlows issues, and image pulls use your system’s CAs. A file that is missing or holds no certificate is refused, and the error names the file. The Python SDK reads the same variable.
On a Mac, use machine-env. macOS ships its own /usr/bin/machine, which
prints the processor type, so typing machine may not run the client. Putting
the client first on your PATH would hide the system command for every other
program. machine-env, which the installer writes on every system, starts a
shell in which machine is the client and changes nothing else. The shell
loads your usual setup, and its prompt starts with (machine). machine-env
supports zsh and bash.
1 | $ machine-env |
While the prompt starts with (machine), machine is the client. exit returns you to the shell you were in. To run one command in this environment without starting a shell:
1 | machine-env -- machine --version |
This form suits scripts and CI. To see which machine you get, run which machine:
/usr/bin/machine is the system’s, and the client is
~/.local/share/machine/bin/machine on a Mac or ~/.local/bin/machine on
Linux. If
machine --version prints a processor type instead of a version, you are
running the system command. On Linux, if another command on your system is
also named machine, use machine-env the same way.
To read the installer first, install a specific version or into another folder, check the download by hand, or uninstall, see the download page.
Run machine with no arguments, or with --help, to see every command. Each
command has its own --help too, and that is the place to look when a flag here
is not enough.
1 | machine --help |
machine --version prints the client’s version and its license. Include the
version when you report a problem.
1 | machine --version |
1 | ---- o o o ---- |
If something does not work, machine ping checks that you can reach the
service and your sessions, and how long the round trip takes.
In machine-env, Tab already completes commands, options and their values,
and the names of your runs. Where machine is the client in every shell, as on
most Linux systems, add the line for your shell to its startup file to have
the same there. On a Mac, use machine-env instead: outside it, machine is
the system’s command, and the line would run that one.
1 | eval "$(machine completion bash)" # ~/.bashrc |
The client computes each completion itself from its own commands, so the line does not change when you update the client.
To try it in one terminal first, run the same line there instead. Tab completes in that shell until it exits, and no other shell changes.
Signing up
You create your account on the signup page, in a browser. We email you a link, and its page creates the account. Then sign in from the terminal.
1 | machine login |
Machine emails you a one-time code and asks for it. You stay signed in until
you sign out with machine logout. machine account show tells you who you
are signed in as.
For scripts and CI there is no need to sign in at all. Create an API key and
put it in the TESTFLOWS_MACHINE_API_KEY environment variable.
1 | machine account api-keys create ci --expiry 90 |
A coding agent signs the client in with your help, because its shell has no
terminal to type a code at. If you have no account yet, it gives you the
signup page, and you sign up there yourself. It then asks for your email
address and runs machine login --email you@example.com. You tell it the code
from the email. The agent signs in with the code and saves an API key for the
client, so the client stays signed in after the login ends:
1 | machine login --email you@example.com --code 482913 |
The client uses TESTFLOWS_MACHINE_API_KEY when it is set, then the login,
then the saved key. machine account whoami
says which account and which of them the client uses. Signing out with
machine logout leaves the saved key, and deleting the key with
machine account api-keys delete removes it from the client.
When you create your first session, Machine sets up your account’s storage
first, so that session takes longer to create. To do that step on its own
beforehand, run machine account provision.
Your first run
If you have not yet signed up and signed in, do that first: see Signing up.
This example creates a session, builds a disk, runs a program, creates a checkpoint and starts a branch from it. The program is one line of Python, and you need nothing installed but the client: no Docker and no compiler.
First, create a session. Machine makes it the one your commands use.
1 | machine sessions create first --cpus 2 |
1 | ✔ Session first is running. |
Next, save this as hello.py.
1 | print("hello, world") |
Build a disk named hello that runs it. --from names the public Python
image, --add puts your file in it, and what follows -- is the command the
machine runs.
1 | machine disks build --from python:3.12-slim --add hello.py hello -- python hello.py |
1 | ➤ Packing hello (1 service) |
Only your file is uploaded. The build pulls the image itself and writes it onto the disk, which takes about a minute for an image of this size. You build a disk once and create as many runs from it as you like.
A program you compile, an image of your own, or several services together build the same way from other sources. See Disks.
Create a run from the disk. By default, the machine then waits for your
commands. With --no-daemon, it would boot and run to the end by itself.
1 | machine create hello-run --disk hello |
1 | ✔ Started hello-run (wiceT2fDBSIct7ewdeiAb) |
Now the run is waiting. It only moves when you drive it, and machine run is how
you drive it. The --until tasks part means “keep going until Linux is up.”
1 | machine run hello-run --until tasks |
1 | iterations: 15647 run ic: 276752606 vtime: +0.785224370s checkpoints: 1 |
Read the last five lines the machine printed. --plain prints only the
lines. Without it, a terminal also shows the entry, the source and the number
of each line.
1 | machine output hello-run -n -5 --plain |
1 | NET: Registered PF_NETLINK/PF_ROUTE protocol family |
To see the full console log, use -n :. Ranges use the same colon as a Python slice. Lines are numbered from 1 and both ends count, so -n 1: is the first line through the last.
A negative number counts from the end, and -1 is the last line. -n -5 and -n -5: are the last five lines, and -n -10:-2 is the tenth line from the end through the second. Both ends of a range count from the same end.
Create a checkpoint of the machine’s state so you can come back to it, and start a branch from there.
1 | machine checkpoint hello-run booted |
1 | Checkpointing: writing state 100% 130ms |
The checkpoint is in your session. machine sync publishes the run, so the
checkpoint outlasts the session and another session can start from it.
Stopping the machine publishes it too.
1 | machine fork hello-run --at ^booted --name try-1 |
1 | Branching 170ms |
The branch starts exactly where booted was taken. Its full name,
hello-run/try-1, is the name of the root of its tree, a slash, and the name
you gave it. Look at the tree.
1 | machine branches hello-run |
1 | ● hello-run (wiceT2fDBSIct7ewdeiAb) [0, ∞) ← this run |
Linux is up on the branch and your program has not started yet. Drive the branch until the machine shuts down, which it does when the program exits.
1 | machine run hello-run/try-1 --until halted |
1 | iterations: 9168 run ic: 2810612750 vtime: +4.606870296s checkpoints: 1 |
Your program runs as a service named app, so each line it prints starts
with app |. When it exits, the machine says so on a line of its own. Find
these lines in the branch’s console.
1 | machine output hello-run/try-1 -n : | grep 'app ' |
1 | app | hello, world |
The parent hello-run is still at booted, with the program yet to run. You
can fork it again and get the same start every time.
When you are done, delete the runs and then the session. A run keeps its log and checkpoints until you delete it, and a session costs money until you do.
1 | machine delete hello-run --recursive --stop --yes |
That is the whole workflow. You built a disk, created a checkpoint in a run, forked a branch from it and ran a program to its end. Everything else in these docs is a variation on it.
Getting help
TestFlows Machine is in public beta, and reports from users directly influence what gets fixed and built next. Report bugs, request features and ask questions in the TestFlows Machine repository on GitHub.
To report a bug, search the issues first, then
open an issue with the commands you ran, what you
expected, what happened, and the output of machine --version. To request a
feature, open a feature request that describes what
you’re trying to do. To ask a question or share an idea, start a discussion in
Discussions. You can also send feedback through the
contact form.
✋ Issues and discussions are public. Never include an API key, a token, a password or other secrets in them.
For questions about your account or billing, email support@testflows.com.
For privacy-related questions, email privacy@testflows.com. Report
abuse to abuse@testflows.com. Report security vulnerabilities to
security@testflows.com, or through GitHub’s
private vulnerability reporting.