Cofounder CLI

Routines

Cofounder-defined agent runs that keep company work current on a schedule, running the cofounder CLI on the company's behalf.

A routine is recurring work that Cofounder defines and runs for your company on a schedule. Each run starts an agent in a sandbox that has the cofounder CLI, signed in as the person the routine belongs to. Cofounder writes and maintains each routine's instructions, so improvements reach every company on its next run; you choose when it runs.

A routine is one ongoing piece of work: each run continues the same agent session, so the agent keeps its context and sandbox from run to run. It keeps its progress in two places: Library files people read, and the routine's state, structured data that routines get returns.

See and manage routines

MCPCLIAPI
routines_listcofounder routines listGET /cofounder-cli/v1/routines
routines_getcofounder routines get --routine-id <id>GET /cofounder-cli/v1/routines/{routine_id}
routines_updatecofounder routines update --routine-id <id>PATCH /cofounder-cli/v1/routines/{routine_id}
routines_state_updatecofounder routines state update --routine-id <id> --state <json>PUT /cofounder-cli/v1/routines/{routine_id}/state
routines_deletecofounder routines delete --routine-id <id>DELETE /cofounder-cli/v1/routines/{routine_id}

routines get shows a routine's instructions, schedule, and next run time. update changes the --schedule, a standard five-field cron expression (minute, hour, day of month, month, day of week) evaluated in the owner's timezone, or turns scheduled runs on and off with --enabled. Deleting a routine stops future runs and removes its run history. The routine's agent replaces its state with routines state update at the end of each run; each routine defines the shape of its state, and invalid state is rejected.

The agent acts as the routine's owner through one company API key, named Routine <id> in cofounder company api-keys list. Each run keeps it valid for another 24 hours, and deleting the routine revokes it. The agent can do anything the owner can do in the company. For the same reason, only the owner can update or run a routine; any company member can list, read, or delete it.

Company state and next steps

Every new company starts with one routine, Company state and next steps, owned by the person who created the company. It runs daily at 07:00, reads the company's new events, roadmap, and Library, and rewrites two Library files: general/company_state.md, a synthesis of where the company stands, and general/next_steps.md, its prioritized plan. Its state holds a summary, recent changes, risks, next_steps (each with a title, why, owner, and due date), and the last event sequence it read.

Run a routine and check on it

MCPCLIAPI
routines_runcofounder routines run --routine-id <id> --request-id <uuid>POST /cofounder-cli/v1/routines/{routine_id}/runs
routines_runs_listcofounder routines runs list --routine-id <id>GET /cofounder-cli/v1/routines/{routine_id}/runs
routines_runs_getcofounder routines runs get --run-id <id>GET /cofounder-cli/v1/routines/runs/{run_id}

run starts one run right away, outside the schedule, and spends model usage like a scheduled run. Generate a fresh --request-id UUID and reuse it if the response gets lost: the same request id never starts a second run.

A run is starting until the runner accepts it, then started; a run the runner could not take is failed, with the reason. What the run produced shows up in the routine's state and the Library files it writes.