Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,8 @@ Use `autter memory search "<question>"` to rank what Autter knows about the repo

For coding agents, `autter context "<task>"` is the one call to start with: the memory facts (with `rmf_…` ids to cite), wiki pages and code structure that matter for the task, ranked and cut to a token budget, as Markdown. It is the CLI form of the `get_context` MCP tool, and the `repo-memory` skill tells agents to use it when the Autter MCP server isn't connected. `autter memory skills install` writes the repository's memory skill into the checkout (`.agents/skills/autter-repo-memory/SKILL.md` and a Cursor rule) so teammates' agents get it from git.

When a review's generated tests catch a bug, the failing test is not committed to the PR. On the PR's branch, `autter tests run` writes the failing tests Autter kept into your checkout and runs them with their framework's command (it asks first: the tests are model-written and run with your environment). `autter tests list` shows what Autter wrote and why each failed, and `autter tests clean` removes the files again. A test that used Autter's temporary database runs only with `--database-url` pointing at a scratch database.

### Connect your agents to Autter's MCP server

`autter mcp connect` adds Autter's MCP server to every installed agent's user-level config (Claude Code, Codex, Cursor, VS Code, Gemini CLI, OpenCode). Only the URL is written; each agent signs you in with your Autter account the first time it uses it. `--dry-run` shows the changes, `--agent <name>` picks agents, and `autter mcp disconnect` removes the entry again.
10 changes: 10 additions & 0 deletions changelog/run-generated-tests-locally.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Run the tests Autter wrote for a PR on your machine

- When a review's generated tests find a bug, the failing test is never committed (it would turn CI red). `autter tests run` now brings it to you: on the PR's branch, it writes the failing tests Autter kept into your checkout and runs each one with its framework's command (vitest, jest, mocha, `node --test`, pytest, `go test`, `cargo test`, rspec, phpunit) from its project directory. Fix the bug and run it again to see it pass.
- `autter tests list` shows what Autter wrote for the PR: which tests failed, where and why, which passed, and what could not run in its sandbox. `autter tests pull` only writes the files, and `autter tests clean` removes exactly what `pull` or `run` wrote (a file you edited stays unless `--force`).
- The PR is the one open from your current branch, or `--pr <n>`. `--all` includes the passing tests and `--only <path>` picks one. If your checkout is not at the commit the tests were checked on, a note says so.
- These tests are model-written from the PR's code and run here with your environment, not in Autter's sandbox, so `run` asks before it runs anything (`--yes` skips the question; `--dry-run` prints what would run). The command is built by the CLI from the test's framework and path; the command string stored on the server is never executed. `pull` never overwrites a file it did not write.
- A test that ran against Autter's temporary database runs only with `--database-url <postgres-url>`, pointing at a scratch database it may write to. It never inherits your `DATABASE_URL`.
- Add `--json` for scripts and coding agents. The command uses your existing `autter login`; in local mode, or for repositories excluded from sharing, it sends nothing.

This command needs the updated Autter API.
37 changes: 37 additions & 0 deletions src/commands/arg_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,42 @@ autter memory skills preview [--repo <remote|owner/repo>] [--org <slug>] [--json
The repository is this checkout's default remote unless --repo is given.
Uses your autter login. Nothing is sent in local mode or for repositories
excluded from sharing. Use --json in scripts and coding agents.",
},
HelpEntry {
name: "tests",
aliases: &[],
summary: "Pull and run the tests Autter wrote for a pull request",
body: "autter tests list [--pr <n>] [--repo <remote|owner/repo>] [--org <slug>] [--json]
autter tests pull [--pr <n>] [--all] [--only <path|gap>]... [--force] [--json]
autter tests run [--pr <n>] [--all] [--only <path|gap>]... [--database-url <postgres-url>]
[--yes] [--dry-run] [--force] [--json]
autter tests clean [--pr <n>] [--force] [--json]

On a review Autter writes tests for changed code that had none and runs them
on the PR's base and head. A test that fails on the head reproduces a bug the
PR introduces; those are never committed, so this command brings them here.

list What Autter wrote for the PR: which tests failed, where and why, which
passed, and what could not run in its sandbox.
pull Write the test files into this checkout (default: the failing ones;
--all for every kept test; --only for one file or gap id). Never
overwrites a file Autter did not write.
run Pull, then run each file with its framework's command (vitest, jest,
mocha, node --test, pytest, go test, cargo test, rspec, phpunit) from
its project directory, with CI=true. Asks first: the files are
model-written from the PR's code and run with your environment here.
--yes skips the question; --dry-run prints what would run.
A test that used Autter's temporary database runs only with
--database-url, pointing at a scratch Postgres database it may write
to; it never inherits your DATABASE_URL.
clean Remove the files pull wrote (all PRs, or --pr). A file you edited
stays unless --force.

The PR is --pr, else the one open from this checkout's branch. The
repository is this checkout's default remote unless --repo is given. If
this checkout is not at the commit the tests were checked on, a note says
so. Exit status 1 when a test fails, is skipped or cannot be written.
Uses your autter login.",
},
HelpEntry {
name: "context",
Expand Down Expand Up @@ -1060,6 +1096,7 @@ const HANDLES_OWN_HELP: &[&str] = &[
"logs",
"threads",
"memory",
"tests",
"context",
"mcp",
"ci",
Expand Down
3 changes: 3 additions & 0 deletions src/commands/autter_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ pub fn handle_autter(args: &[String]) {
| "threads"
| "badge"
| "memory"
| "tests"
| "context"
| "mcp"
) || (args[0] == "lineage"
Expand Down Expand Up @@ -219,6 +220,7 @@ pub fn handle_autter(args: &[String]) {
None => commands::lineage::handle(&args[1..]),
},
"memory" => commands::memory::handle(&args[1..]),
"tests" => commands::generated_tests::handle(&args[1..]),
"context" => commands::context::handle(&args[1..]),
"mcp" => commands::mcp::handle(&args[1..]),
"help" | "--help" | "-h" => {
Expand Down Expand Up @@ -522,6 +524,7 @@ const AUTTER_COMMANDS: &[&str] = &[
"status",
"sync",
"telemetry",
"tests",
"threads",
"uninstall",
"uninstall-hooks",
Expand Down
Loading
Loading