--url and --app-id, and all but comments-read take --json. See the conventions every command follows. With --json, a command prints the response of the API route it calls. The API reference names the keys. A failed command prints the reason and exits 1. work proofs exits 2 when it cannot decide.
Who runs each command
You type some of these commands. A build’s agent, a session hook or a runner runs the others for you. You call those yourself only when you write your own build command or skill.outerlayer work build
Start work on an item. A runner claims the item and builds it.work build again.
Build a parent
A build request on a parent item records a build request on each of its children that needs one. Each request names you. The parent gets no request, because a parent has no build of its own. A parent builds only after its plan is approved. The command refuses a parent whose plan has no approval, and names the command that approves it:work plan --approve.
A child that waits on an item that has not shipped is held. A runner takes it only after those items ship. The command says how many children it queued and how many it holds:
--continue is not available for a parent. With --json, the output has a children key with the counts and one entry for each child.
Choose the agent and the model
The build request records the agent and, if one applies, the model. The amend and the revision of the item use both. The review uses the agent and keeps the model of its configured command.--agentreplaces the whole repository config. The gateway then reads neither theagentkey nor themodelkey of.outerlayer/config.json. To build with a model, pass--modelwith--agent.--modelwins over themodelkey.- A model with no agent is recorded with no agent. The runner that takes the item applies the model to its default agent. If that agent takes no model, the job runs unchanged and the runner log says so. Name the agent with the model when the factory’s runners build with different agents.
- With neither flag and no key, no agent is chosen. Any runner takes the item. A runner of your own builds it with the agent of its implement command. A managed runner builds it with the factory’s Default agent. The model is the one the runner’s command names.
work build --item, work build --issue, Build again on the item’s page, the build label and an issue automation. A previous request that named a model and no agent carries no model.
The gateway reads .outerlayer/config.json from the repository’s default branch. The repository chooses no agent when it has no file, or when the OuterLayer GitHub App cannot read the repository’s contents. A file that GitHub cannot give the gateway for now refuses the request, unless you pass --agent. So does a file that is not a JSON object, or a file larger than 65536 bytes.
The command refuses a value before it sends the request:
The gateway refuses these requests, and it records nothing:
A runner builds an item only when it reports the item’s agent. See Build with several agents.
On an item with an open pull request, the request asks a runner to amend the pull request. OuterLayer refuses it when no review waits on an agent.
A rerun starts from the build disk that the item’s previous build left, unless you pass
--fresh.
Instructions belong to the one build request they come with. The issue and its criteria win if the two disagree. Instructions never skip a judge or change which issue is built. A repository with an old copy of the /build skill needs outerlayer init --update first.
The command prints the item’s own number, which is not the issue’s, then the item’s page:
outerlayer connect.
Debug a build
Builds run on a runner.--local is for debugging a build or a skill in your own session. With it, the item goes on Work with no build request, so no runner takes it. The command prints:
--json, the launch line is the launchCommand field. An item already on Work needs no --local: start a session with OUTERLAYER_WORK=<number>. See Debug a build in your own session.
Refusals
The command refuses a flag that does not go with--local, and --continue with --fresh. The message says which flag to drop. Other refusals:
See also: Debug a build in your own session, Run work on your machines, Connect an issue tracker.
outerlayer work status
Print one item: its stage, section, judges’ results, linked pull requests and sessions, additions, and recorded acceptance criteria.- Criteria lists the current criteria, each with its id, text and required proof. It reads “drafted by the build” when the build wrote the list from the issue description, and “none recorded” when the item has no list.
- Failing judges lists each failing judge with its sentence and its failing judge items.
- Milestones lists, for a parent, each milestone and the last verification. Each line has the name, the verification state and the short commit of each repository, such as
app@1a2b3c4. The last verification reads “The last verification”.
--json. The output is then one line of JSON and nothing else. These are the fields a script reads most:
no live item for <repo>#<n> or for ENG-123: check --issue and --repo. ENG-123 names an item in jira and linear: pass --tracker.
The newest proof
Each criterion’snewestProof is the newest artifact of the proof kind that the criterion declares. It is { artifactId, kind, commitSha }, or null when no such artifact exists or the criterion declares no proof. artifactId is the id that outerlayer emit artifact printed, which --replaces takes. commitSha is null when the artifact recorded no commit.
For a test proof, the artifact is a JUnit results file, and newestProof also holds tests: { selected, items: [{ name, file, line }] }. selected is true when the results were bound to tests named with --test, and items lists those tests. Otherwise items lists the tests the file held.
outerlayer work verify
A verification job runs these commands. The job’s item key reaches only the parent’s verification, so the commands work in no other session.OUTERLAYER_WORK names the parent. See Verify the whole.
--json, --url and --app-id.
A finished, released or expired verification gives
claim_expired.
outerlayer work list
List the factory’s work items.--claimed with --unclaimed is refused (invalid_query).
outerlayer work remove
Remove an item that you added from the Work page, and record why. Nothing is deleted: the item’s history stays.--issue matches no item on Work, the command prints nothing to remove and exits 0. With --json, the output has noLiveAddition: true. A mistyped issue number also exits 0, so check the output when you pass --issue.
outerlayer work link and unlink
Link work items as a parent and its children, or make one item wait for another.unlink takes a link away.
Give exactly one of
--parent and --waits-on. For unlink, give the same flags that link took.
work_item_waiting. A pull request that merged without a passing verdict also releases the item.
outerlayer work plan
Approve the plan of a parent. The children of a parent do not build until its plan has an approval.
The approval records the children, what each waits on and the milestones. It also approves a plan that was changed after its approval. It prints that the plan is approved and how many children it holds:
spec.insert). An API key is refused. Every item of the plan must have an issue. When an item has no issue, the command refuses and says to approve the plan on the Plan tab. It writes no issue text for an item that has no spec text in OuterLayer.
See Plan large work.
outerlayer work comment
Post one comment on an item’s general thread, on one criterion’s thread, or as the answer to one source thread.
Give at most one of
--pass, --fail, --attach, --ready.
person, agent or no one.
--fail on the general thread does.
Answer a source thread
A source thread is a conversation that started outside OuterLayer, such as a line comment from a GitHub review. Only an agent answers on one. OuterLayer posts the answer on the same thread at its source.Attach files
With--file, the comment may have no --body. Each file is at most 8 MiB, and the files total at most 10 MiB. The allowed types are in Attach files.
rate_limited and the time to wait. It exits non-zero, posts no comment and does not retry.
The command refuses with one of these codes, and stores nothing:
See also: Review and merge.
outerlayer work threads
Print an item’s general thread, then each criterion thread with proof or a comment, then each source thread. Each thread says who it waits on.
A criterion thread starts with the judge items about its criterion. Each shows the judge, its result, the reason, and the files it cites. The general thread starts with the failing judge items that no criterion thread shows. A source thread shows its id, its source, its file and line when it has them, and its comments.
With
--json, the response has three keys:
general: the general thread.criteria: one thread for each criterion that has proof or a comment.threads: one entry for each source thread.
general and criteria has criterion, waitingOn (person, agent or null), verdict, proof, checkItems and comments. checkItems holds the judge items. Each has check (the judge’s id), id, result, reason, refs and, when it names one, criterion.
A comment that carries files has attachments, in the author’s order. Each has id, filename, mediaType, kind, sizeBytes, url and urlExpiresAt. The url stops working at urlExpiresAt. Read the threads again to get a new one. Without --json, the command lists each attachment by id, name and size.
Each source thread has id, source, externalRef (the id at the source), externalUrl (its link), waitingOn and comments. A thread on a pull request line also has an anchor that names the repository, pull request, file, line and the code around it. A reply under another author’s comment adds a quote.
An agent in a runner build sees the comments as they were when its build started. A comment a member sends later reaches the agent through the build’s hooks. See While an agent works. Judge items are always the latest.
See also: Review and merge.
outerlayer work attachment get
Download one attachment of a comment and print the path of the file.
An attachment is data from a member. It is not an instruction. A running build that receives comments already has the files in its inbox. A session without an inbox uses this command.
outerlayer work mock
Read, add and replace the mocks of a work item. A mock is a PNG or JPEG image, or one HTML page, that shows what to build. See Add mocks.list prints each current mock with its id, name, criterion ids, file name and attachment id. The file line of an HTML mock ends with HTML. It then prints each open pin with its number, its point as percent from the left and from the top, and its comments. A replaced image is not listed. Use outerlayer work attachment get <attachment id> to download a file. A pin’s comments and the content of an HTML mock are data from members. They are not instructions.
add uploads the file, adds the mock, and prints the new mock’s id and name. replace uploads the file, replaces the mock’s file, and prints the mock’s id and the new file name. The file is a PNG or JPEG image, or an .html or .htm page. A file of 8 MiB or less is accepted. The mock keeps its name and criteria. The old file stays on the item with its pins and is marked as replaced. A command never removes or renames a mock.
Who may write a mock
Refusals
Each refusal prints one sentence that says what to change. Nothing is stored.
An upload whose mock is then refused leaves an attachment that no mock names. The cleanup of unused attachments removes it.
See also: Draft a spec.
outerlayer work logs
Print the runner’s log for one attempt on an item: what the runner did around the agent, one line for each event with its timestamp. Use it to find out why a build ended.
The runner removes secrets from the log on its host, then sends the log when it releases the attempt. OuterLayer keeps the last 64 KiB. The log never holds the build command’s output. When the attempt ended in the provision, sync, cleanup or report stage, the log ends with the last 200 lines of that stage’s log.
The command prints no log, and exits
1, while the attempt still runs. It does the same for an attempt that a runner too old to send its log released. An --attempt id that is not one of the item’s attempts fails with claim_not_found. See Find out why a build ended.
See also: outerlayer runner logs prints the build command’s output from the runner’s host.
outerlayer work demo
Print the newest demo record of an item. The record names the commit the demo was recorded at, and the test that recorded it.
Without
--json, the command prints two lines. An item with no demo prints Item 7 has no demo.
outerlayer emit demo --replaces takes the artifactId. See Record the demo again.
record is null when the stored record cannot be read. liveArtifactIds lists the item’s artifacts that no later artifact replaced.
outerlayer work stop
Ask the runner that is building an item to stop. OuterLayer records who asked, when, and the note. After its next heartbeat, the runner ends the build and releases the claim with the outcomestopped.
The command prints that the stop is pending and which runner holds the build, then returns. It does not wait for the build to end. A second request while one is pending changes nothing.
outerlayer work build, or with the rerun button beside Build time on the item page. A build that outerlayer runner stop --now ends on the host keeps its request, and the item stays available.
The command exits 1 when no runner build is running for the item (no_build_running). A session’s own claim cannot be stopped this way.
The command needs Withdraw others’ work. On the item page, a member with that permission selects Stop build in the Building now block.
outerlayer work proofs
List each proof that an item’s criteria declare, and say whether it is current at your checkout’s HEAD. With--record, the command runs the tests behind each proof that is not current, and records what they write.
A build’s agent runs --check before the build ends. The runner then runs --record at the pushed head. In a session of your own, run --record after each push. The steps are in Record proofs by rerunning tests.
outerlayer sync first, so the artifacts you emitted have reached OuterLayer.
The command lists each criterion that declares a screenshot, video, report, log, file or test proof. Each listed proof has one of four states:
After the list, the command says why
--record cannot record a proof that is not current. For example, the proofs file is missing or invalid at HEAD.
With --json, each entry of the array has these keys:
With
--record, the exit status is the status of the closing list.
With --check, the exit status is 0 when every checked proof passed. In a runner build, a failed row gives 1 too. A proof passes when its test runs, its runner exits 0, and it writes a file of the declared kind. A demo proof passes when its chapter ran checks and each passed. A screenshot proof also needs the frame the chapter marked.
The check applies each rule of outerlayer emit demo that reads only the chapters, such as a chapter for a criterion of another work item. It then fails every screenshot and video proof, and prints the refusal. The check does not render the demo, so a demo that outerlayer emit demo refuses for its video can still pass.
no work item: pass --item, or set OUTERLAYER_WORK.
Criteria the judge failed: failed
The command also lists each criterion that the criteria judge failed, while no test file has changed since.
The command compares commits, not the working copy, so commit the test first. Adding, removing or renaming a test file also ends the row.
A criterion that the judge could not judge is not listed, for example because its run timed out. When the checkout does not hold the judged commit, the command says so and lists no row for that criterion.
The proofs file
The proofs file says once how to start your app and run your tests. It is the file.outerlayer-proofs.yaml at the repository root. Commit it once: it is not per item. --record and --check read it from the HEAD commit, not from the working copy.
Any other key, at the top level or in a runner, makes the file invalid. So does an empty command.
A glob matches the path of a file from the repository root, such as
e2e/login.demo.ts. A file that two runners match belongs to the first runner.
A glob matches no file when it breaks one of these limits:
- It is longer than 1,024 characters.
- Its braces expand to more than 256 alternatives.
- One path segment holds more than 3
*characters. - It uses an extended form such as
+(or!(.
{a,b}.
The criteria judge and the failed rows also use the runner globs to find your test files. Both read each file that a glob matches. They also read files with a common test name, such as *_test.rb or *Test.java, and source files in a test folder, such as test/ or spec/. If your tests live in files that none of these rules reads, add a runner whose files glob matches them. See The judge stage.
The preview block
Thepreview block says how to run the app so a reviewer can use it in the browser. A preview runs the setup commands, then the seed commands. The commands run in a container of the build image. A runner needs CLI 0.46 or newer. A CLI older than 0.43 rejects the preview key.
Any other key in the block makes the file invalid.
outerlayer work proofs --check names the key and exits with status 2.
How a proof is recorded
--record needs a working copy that matches HEAD. If a tracked file differs from HEAD, the command names the files and records nothing. Commit your tests first.
The command finds the tests behind a proof by the criterion’s id. A test file names its criterion with the id as a whole word: no letter, digit, _ or - comes right before or after it. So AC-1 matches neither AC-12 nor AC-1-2. A demo script names the id in demo.chapter("AC-1", ...). Any other test names it in a comment or a string, such as the name of the file it writes.
For the proofs that are not current, the command does these steps:
- It finds the test files at HEAD that a runner’s glob matches and that hold the criterion’s id. With none, the output says
no test at HEAD names this criterion. A script (a file that starts with#!) that names the path of another such file runs that file, as a scripted demo runs the browser demo it records. It then holds the ids of the file it names, and the named file no longer holds them. So one run records one demo. - It runs each
setupcommand. If one fails, it runs no runner and names the failed command. - It runs each runner once, with all of its matched files. It stops a runner that runs for longer than its
timeoutMinutes. A runner withouttimeoutMinutes, and every setup and teardown command, gets 10 minutes. The reason for a stopped runner namestimeoutMinutesand gives the last line that its command printed. That line shows whether the run was slow or had stopped. - It runs each
teardowncommand, and stops the processes that setup started. - It emits at HEAD what the tests wrote, and prints
Recorded <criterion id>: <artifact id>for each proof.
$OUTERLAYER_PROOF_OUT/<criterion id>.<ext>. The command emits that file only when all of these are true:
- The criterion’s proof is not current.
- The file’s kind is the kind that the criterion declares.
- The runner that ran the test exited 0.
<criterion id>.png or .webm file counts only when no chapter names the criterion.
A unit test that names a screenshot or video criterion records neither. When the tests pass and leave no chapter and no file, the output says no demo test has a chapter for it. Add the chapter to a demo test, and commit it.
Know these limits before you write the file:
- Setup, teardown and the tests run with your environment, including your API key.
- A runner runs all its files at once, so one failing test blocks every file proof from that runner.
- Teardown does not run when the command gets SIGINT or SIGTERM.
- If the run changes a tracked file, the command names the file. The next run records nothing until the file matches HEAD again.
How a test proof is recorded
Atest proof is a JUnit results file. Record the first results yourself: run the tests with a JUnit reporter at HEAD, then run outerlayer emit artifact <file> --for <criterion id> --test <name>=<path>:<line>. See Prove a criterion with test results.
After that, --record runs the same tests again at a new head. The tests are the ones the newest results were bound to: the tests named with --test, or every test the file held. The command runs the runner whose files glob matches each test’s file. It then emits the JUnit XML files that the run wrote, at HEAD and bound to the same tests.
A JUnit file counts when it ends in .xml and was written during the run. It can be in $OUTERLAYER_PROOF_OUT, or where the test tool writes by default, such as Maven’s target/surefire-reports.
The command emits the results when the run’s files hold every one of the tests, whether each passed or failed. A failed test then fails the criterion, and does not leave it out of date. The output names a test that no results file holds.
--record cannot run these tests, and the output names each one:
- A test whose results name no file. Emit the results again with each test’s file:
--test "<name>=<path>". A file is enough, with no line. - A test with no runner whose glob matches its file.
outerlayer work pr
Declare that a pull request belongs to the work item this session was started on. The command declares onto theOUTERLAYER_WORK item or refuses: if the session is not on that item, nothing is stored. Running it twice changes nothing.
You need it in a session of your own, for a pull request that you opened without work open-pr. A runner build declares its pull request when it opens it.
OUTERLAYER_WORK names a child item, the command reads the item first. It refuses when the item has no plan note of its own, and it declares nothing. It also refuses when it cannot read the item, and it names the failure. --withdraw is not checked. When OUTERLAYER_WORK is not set, the command does not know the item, so it checks nothing.
Withdraw a declaration
work pr <number> --withdraw --item <n> removes that item’s declaration of the pull request. Other items’ declarations of it stay. It needs your own login: a factory key or an agent session is refused (withdraw_needs_person). Withdrawing a declaration that does not exist fails with item <n> has no declaration of <repository>#<number> (declaration_not_found).
See also: Open and declare the pull request.
outerlayer work release
Release the claim that the calling session holds on an item. While a session holds a claim on an item, the item’s review stays closed. The starter/build skill runs this command as its last step in a session of your own. Run it yourself to open the review without closing the session.
released session <session id>'s lease on #7, if it held one. It never releases another session’s claim. A later tool call in the same session takes the claim again. The command needs Add work.
Inside a runner build, or with --host, the command releases a runner’s claim. See work claim, renew and release.
outerlayer work open-pr
Open the pull request for the item this session is on, or edit the one already open on its branch. The agent of a build runs this command, as the starter/build skill tells it. Call it from your own build command or skill in the same way.
- In a runner build, OuterLayer opens or edits the pull request as the factory’s GitHub App, from the branch of the build’s claim. No
ghruns.OUTERLAYER_WORKmust be set. A new pull request opens as a draft, and the output says so. See A draft until the build ends. The refusals are in Opening the pull request. - In your own session, the command runs
gh pr create, orgh pr edit, under your GitHub login. Run it in the checkout of the pull request’s repository. It then declares the pull request aswork prdoes. If declaring fails, runwork pr <number>.
gh. It refuses when the item has no plan note of its own, and says that the item needs one. The check runs each time, also when the command edits a pull request that is already open. In your own session the command checks once, before gh runs. When it cannot read the item, it refuses and names the failure. A build always sets OUTERLAYER_WORK. An item that is not a child passes.
A build checks out every repository of the factory. When it changes several, it opens one pull request for each repository, and names each with --repository. Every pull request links to the same item:
OUTERLAYER_REPOSITORIES. A repository that the build’s claim does not name is refused with repository_not_in_claim.
See also: Open and declare the pull request.
outerlayer work no-change
Record that the work item this build holds needs no change. The agent of a runner build runs this command when the default branch already meets the issue’s request. Examples are a bug that is fixed, a duplicate issue, and a feature that exists.OUTERLAYER_WORK must be set. Any other caller is refused.
The item then shows No change needed, and OuterLayer posts the reason on the issue. OuterLayer does not close the issue. See When a build finds no change is needed.
outerlayer work needs-attention
Record why this build ends without a pull request. The agent of a runner build runs this command before it gives up.outerlayer work no-change. A build that records that no change is needed ends ok, and the reason is not used.
Only a runner build can run the command. It needs the build’s item key, and OUTERLAYER_WORK must be set. Any other caller is refused.
The runner releases the claim with the outcome incomplete and your sentence as the reason. The item shows Needs attention, and the Work page and the item’s Activity section show the sentence. A build that opened a pull request ignores the record: the item’s verdict decides its outcome. See When a build ends without a pull request.
outerlayer work link-session
Link the calling session to an item that is already on Work. The session hooks run this command for you when a session starts withOUTERLAYER_WORK set.
See also: Debug a build in your own session.
outerlayer work comments-read
Record which comments the agent of a running build read. The hooks of a runner build run this command after they hand a member’s comment to the agent. A comment that is not recorded as read waits for the next build.
The command prints nothing and exits
0, also when the call fails. A failed call leaves one line in hook-errors.log.
outerlayer work claim, renew, release
These commands are for scripts that act as a runner. You do not need them to build, review or script work items.outerlayer runner start does not run them: it calls the same API routes itself.
They take, extend or give up a runner’s claim on an item, so two runners never build it at once. Flags, help text and outcomes call a claim a lease.
They need a key with work.claim. No dashboard role has that permission: use a runner key. They create this machine’s host key on first use, and a runner key binds to the first host key that signs for it.
work_item_claimed. Releasing twice returns the recorded release time and outcome both times. A release with an outcome shows as an attempt on the item’s page.
See also: Run work on your machines.