Help · Using Morie
Checks and scripts
A check says whether the work is right. A script just runs it. Morie keeps the two apart.
Checked against Morie 0.54.3.
- A check is a named command that passes or fails, such as
pytestorcargo test. Morie runs it on a ticket’s commit and keeps the result. - A chat can run any test command through Morie too. It waits its turn, and its result is kept on the ticket under Chosen commands, apart from the checks.
- A script starts something and leaves it running, such as your app at a local address. Checks and scripts are set for each repository, in Settings → Repositories and worktrees → Repositories.
Shop’s shop-api is written in Python and has two checks: test runs pytest, and lint runs ruff check .. On ticket #12, a chat changes how the cart adds tax. Before it commits, it runs only the cart’s tests through Morie: mcheck "cart tax" -- pytest tests/test_cart.py. They pass, and the run shows on #12 under Chosen commands. The chat commits and runs mcheck all: test passes and lint fails. It fixes the lint, commits again, and both checks pass on the new commit.
Where checks come from
Each repository has one list of checks: Morie’s list, kept on this Mac. Each check is a name and a command, with a folder and a switch to turn it on or off. A change needs no commit, and every ticket sees it at once.
- Set it in Settings → Repositories and worktrees, under the repository’s Checks: Add a check, Remove, then Save.
- Or let a chat set it up. A chat changes the list only with your allow: one allowed change may replace the whole list, and the card you allow lists each check it adds, changes, removes or turns off.
Morie does not guess checks from your project. The first time a repository’s checks are needed, Morie asks: Should this repository have checks?
- Use the repository’s file, when the repository has
.morie/checks.json: Morie lists its checks, and Replace copies them into Morie’s list. - Ask Morie to set up: the Morie chat reads the repository and suggests the checks; you allow each change.
- Set up by hand: the list opens, ready for Add a check.
- No checks: nothing runs for this repository. Turn its Checks back on in Settings when you want them.
.morie/checks.json is a way to share the list with the repository. Under Share, Use the repository’s file copies the file’s checks into Morie’s list, replacing it, and Export to .morie/checks.json writes Morie’s list into the file for you to commit if you want. Morie never reads the file by itself.
How checks run
A check runs when you press Run checks or a check’s Run on a ticket, when a chat asks Morie to, or when an automation reaches its Run ticket checks step. Nothing else starts one.
- It runs on the ticket’s commit, whole: every check that is on, each command as you set it.
- Runs go in turn on this Mac, in the checks line at the foot of Settings → Repositories and worktrees. Checks run at the same time says how many go at once. A checks run, a chat’s chosen command, a rig build and a setup script each take one place.
- A test run that would start beside another one still going first lets this Mac settle for a few seconds. When this Mac is busy, it waits. See Settings → This Mac.
- When a newer commit of the same ticket asks for the same checks, the older run still waiting leaves the line, and the chat that asked is told it was replaced by the run on the newer commit.
- Each result is kept on its commit, with how long it took.
- Processes a check starts are stopped when its run ends; services that must stay up belong in a rig.
- The ticket’s card shows a green mark when every check that is on has passed on its current commit, and N checks failed when one failed there. Results on older commits, and chosen commands, never colour the card.
Nothing waits for checks: a merge never does.
Running checks
- Open the ticket, then Ticket info.
- Under Checks, press Run checks, or Run on one check.
- Each result shows beside its check, with the commit it ran on.
A chat asks Morie to run them and is told the result. It cannot report a pass of its own: only Morie runs a check, and every result belongs to one commit.
Runs wait their turn. Checks run at the same time, in Settings → Repositories and worktrees, says how many go at once: one, unless you change it.
Tests a chat runs
A chat on a ticket can run any test command through Morie, in any language and with any test runner. It puts mcheck, then a few words on what the run tests, in front of the command:
mcheck "cart tax" -- pytest tests/test_cart.py
mcheck "checkout handler" -- go test ./checkout/...
mcheck "price parser" -- cargo test parser
mcheck all
The run waits its turn in the line, and waits while this Mac is busy. The chat is told the result when it ends.
- Chosen commands. A command the chat writes itself is kept on the ticket, in Ticket info under Checks, in Chosen commands. Each row starts with what the run tests, then the command, the result, the commit, how long it took, the chat and a Log, such as ✓ cart tax · pytest tests/test_cart.py · passed · 3f9c2a1 · 2 minutes · Cart fixes · Mac · 14:02. A chosen command never counts as a check and never colours the ticket’s card.
- Named checks. Runs you name, such as
mcheck test, ormcheck all, are checks and count as checks. They always run whole. Aftermcheck all, Checks passed on 3f9c2a1 shows only if every named check passed on that commit. - Once per commit. A chat asks for each named check once for each commit, through
mcheckorchecks.run, not both, and treats a run on uncommitted changes as no result for the commit. Every chat is told:
> Ask for each of the repository's named checks once per commit, through checks.run (their names in names) or mcheck, not both; a result on uncommitted changes is not the commit's.
- Values in the command. On the row, values set in the command, such as
API_TOKEN=…, are hidden. The log keeps the command whole, with Morie’s own secrets masked. - Stop on a running row ends it, and its log keeps what it printed so far. On a waiting row, it takes the run out of the line.
- Add --alone when this test run is known to need the Mac to itself (it fails or flakes beside other runs), or --remote when it runs on another machine, so it doesn't hold a place. It starts when every test run going on has finished, in any repository, and no other test run starts until it ends. Rig builds and setup scripts carry on.
- A --remote run shows in the line, marked remote, but takes no place and isn’t held.
- Time. A run has 30 minutes on this Mac, and 60 with
--remote.--time 60mgives it longer.
It works in chats Morie started on a ticket, in that ticket’s worktree. Read-only chats, review chats and chats in the Morie Box can’t use it, and are told so.
Scripts
A script starts something and leaves it running: your app, a preview, a watcher.
- Morie reads a repository’s scripts from
.morie/repo.json, or suggests them from the project’s files. Change them in Settings → Repositories and worktrees, under Scripts. - In a ticket, open the Terminals picker. Under Run scripts, press Run. While it runs, its row has Output, Stop and its local address.
- Each ticket’s worktree has its own port, in
MORIE_PORT. Use it in the script, and two tickets can run the same app at once.
When something is off
- Nothing to run? The repository has no checks yet. Add them in Settings → Repositories and worktrees, or ask a chat to.
- A run is waiting? Its row says why: another run has its turn, a run asked alone has the line, or this Mac is busy. It starts by itself. Stop takes it out of the line.
- A chat can’t run tests through Morie? It needs to be a chat Morie started on a ticket, working in its worktree. For
mcheck all, the repository’s checks need to be on. - A chat’s
mcheck allis refused? Named checks run only from a chat at Bypass or Full Access. Another chat asks Morie to run the checks instead.
See also: Settings → Repositories · Settings → This Mac · Tickets and Ticket info