Cocobox

Workflows

A workflow is a path an agent follows, one step at a time: sync the branch, run the tests, build, wait for your yes, deploy, check, report. A step is done when its check passes, and Cocobox runs the check command itself, so an agent cannot say a step is done and be wrong. Each workflow is a file, kept in your repo for the whole team or just for you.

Find your workflows

  1. Open the right panel and pick the Workflows tab. Workflows saved in the repo are listed under This repo (.cocobox/workflows); your own are under Personal (~/.config/cocobox/workflows).

    The Workflows panel listing a release workflow, a bug fix workflow and a personal dependency bump
    Each card shows its steps as icons, how many are checks, loops and approvals, and how its last run went.
  2. A file with a problem shows what is wrong, and its Run button stays off until it is fixed.

Make or edit a workflow

  1. Click New workflow, or Edit on a card. The editor opens with the steps on the left and the selected step's settings on the right.

    The workflow editor: seven step cards on the left, the Smoke check step's settings on the right
    The editor, with the Smoke check step selected.
  2. Add steps with the three buttons under the list:

    • Agent step: the agent does it. Write its instructions; you can also give it a command to verify with.
    • Check: Cocobox runs a command. The step passes when the command does. Common commands from your project are offered as suggestions.
    • Approval: you say yes. The run waits for you with the message you write here.
  3. Reorder steps by dragging a card, or focus a card and press ⌥↑ / ⌥↓. The + between two cards inserts a step there.

  4. For an agent step, set Loops to ask the agent to review and improve its own work. Pass 1 does the work; each further pass reviews it, and Cocobox runs the check after each one. A loop stops early when a pass changes nothing. Up to 5 passes.

  5. Choose If it fails: Ask me, Agent retries (Cocobox sends the failure back to the agent and runs the check again, up to the retries, then asks you) or Stop the run.

  6. Pick This repo or Personal at the bottom, then Save. File at the top shows the file itself, a short TOML file you can also edit by hand.

Start a workflow

  1. In the message box, click the flow button (beside the paperclip), or type / and the workflow's name. Pick one with ↑ ↓ and Enter.

    The Start a workflow list above the message box
    Start a workflow in this tab.
  2. The workflow sits in the message box as a chip. Type a note the run should know (optional), then press Enter to start it. The × on the chip removes it.

    A workflow chip in the message box with a note typed under it
  3. Or click Run on its card in the Workflows panel, or simply ask the agent to "follow the release workflow".

  4. The first time a workflow runs, and whenever its file changed since you last saw it, Cocobox shows every command it will run, because it runs them itself, as you. Read them, then click Trust and run, or Cancel.

    The Review commands sheet listing npm test, npm run build and npm run smoke:preprod

A workflow never changes what a tab may do without asking. One tab runs one workflow at a time.

Follow a live run

  1. A strip at the top of the tab shows the workflow, a box per step, which step is running and how long the run has taken. Stop ends it. The tab's row in the sidebar shows the step too, like ▸ 5/7.

    The workflow strip: four steps done, step 5 of 7, Deploy to preprod, running
  2. Click View run on the card for every step: its instructions, its check and result, and how long it took. The chat also gets a divider for each step.

    A workflow run showing its steps and check results
    The run view shows which checks passed.

Approve, fix, retry or skip

  1. At an approval step the run waits. Click Approve and continue, or Stop here. The card shows the branch and which checks passed. The same buttons appear in the chat, so you can answer with the panel closed.

    An approval step waiting: Approve and continue, Stop here
  2. When a check fails, its card shows the command, the exit code and the end of the output. Choose Ask the agent to fix this, Retry or Skip. To skip, write why: the reason is kept with the run.

    A failed Tests step with its output and the buttons Ask the agent to fix this, Retry and Skip
  3. A failed, stopped or interrupted run can carry on where it stopped: open it and click Resume from step N. Run again starts over.

  4. When every step is done, a summary shows the total time, steps, checks, retries and who approved. Run again starts a new run.

    Finished in 5m 44s: 7 of 7 steps, 3 checks, 0 retries, approved by you

See past runs

  1. Click the last-run line on a card. Runs lists each run with when it ran, the tab, how long it took and, for a failure, the step that failed. Click one to read it. Steps shows the workflow as it is now.

    Runs of the release workflow: one failed at Tests, one where all steps passed
    The newest 50 runs are kept on your Mac. Editing a workflow never rewrites a past run.

Let an agent write one

Ask an agent to set up a workflow ("make a release workflow for this repo") and it saves one with Cocobox's own tool, so it shows in the Workflows panel.

Share or import a workflow

  1. In the Workflows panel, click Share… on a workflow. You see the exact file that goes out, with secrets, tokens, database URLs, emails and your own paths replaced by placeholders. Copy it or save it, and send it however you like. Nothing is uploaded.

  2. To bring one in, click Import…, paste the file or pick it, or drop the file on the Workflows panel. Nothing runs on import: you approve its commands first, and it cannot run until its placeholders are filled in.

  3. To share one as a link, or to start from a ready one, see The workflow gallery and shared links.