Skip to content
Français

Your first task

Write a TypeScript script, run an agent and review its answer and commits.

Create review.ts next to the configuration from Installation. This first script asks the agent to read the README and report its findings. dispatch() opens a fresh sandbox, and the named branch gives the task its own checkout.

import { reportValue } from "./reporter.ts";
import { dispatch } from "@elie-laloum/outpost";
import { coder, repository, sandboxProvider } from "./outpost.config.ts";

const result = await dispatch({
  repository,
  sandboxProvider,
  agent: coder,
  branch: { mode: "named", name: "outpost/readme-review" },
  brief: {
    text: "Review the README for incorrect setup instructions. Report findings without editing files.",
  },
});
reportValue(result.text);
// Example output: The README setup command uses an outdated flag.
reportValue(result.usage);
// Example output: { input: 1200, cached: 0, output: 320 }
reportValue(result.commits);
// Example output: []

The script prints the agent’s findings when the task finishes. This request asks for a review without edits, so there should be no new commits.

node review.ts

API reference: DispatchResult and Usage.

To ask the agent to edit the repository, create fix.ts with another branch name and instructions to commit the correction. Keep review.ts if you want to reuse the read-only request in CI.

import { reportValue } from "./reporter.ts";
import { dispatch } from "@elie-laloum/outpost";
import { coder, repository, sandboxProvider } from "./outpost.config.ts";

const result = await dispatch({
  repository,
  sandboxProvider,
  agent: coder,
  branch: { mode: "named", name: "outpost/readme-fix" },
  brief: {
    text: "Fix the README setup command, verify that it works and commit the correction.",
  },
});
reportValue(result.text);
// Example output: Corrected the README setup command and committed it.
reportValue(result.commits);
// Example output: [ { oid: '8f3a21c…', subject: 'Fix README setup command' } ]

Run node fix.ts, then inspect the commits and diff with the commands below. A new named branch starts from your HEAD and remains after the task. Use a fresh name for each independent task; an existing named branch is reused.

git log --oneline HEAD..outpost/readme-fix
git diff HEAD...outpost/readme-fix

Outpost opened a worktree under .outpost/workspaces/, ran the agent in a sandbox, then closed the sandbox and kept the branch. How it works details the lifecycle.