behave, a CLI compatibility testing tool with an MCP server mode

behave, a CLI compatibility testing tool with an MCP server mode

behave•byemirmrkaljevic

behave records how a command-line tool behaves, generates cases from its help output and man page, and diffs another binary against that recording; the optional `behave mcp` mode exposes the same flow over stdio.

License: MIT•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Generates test cases from a tool's `--help` output and man page, covering flags, flag pairs, listed values, odd stdin, missing files and bad values.
  • •Records stdout, stderr and exit codes from one binary, then diffs a second implementation against that recording.
  • •Exposes the probe, record and diff flow over stdio through the optional `behave mcp` mode.
  • •Ships ready-made specs, including a small GNU `cut` suite and a gojq-vs-jq check, and supports hand-written cases with `behave add`.

BEST FOR

  • •Checking whether a rewrite or port of a command-line tool matches the original's observable behaviour.
  • •Measuring compatibility progress between binaries, since the diff output reports pass and fail counts and flags with differences.
  • •Driving compatibility testing from an editor via the MCP mode.

ABOUT BEHAVE

behave, a CLI compatibility testing tool with an MCP server mode is cataloged as an MCP server attributed to emirmrkaljevic. behave records how a command-line tool behaves, generates cases from its help output and man page, and diffs another binary against that recording; the optional `behave mcp` mode exposes the same flow over stdio. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for behave, a CLI compatibility testing tool with an MCP server mode are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Does behave ship an MCP server?

Yes. `behave mcp` exposes the same probe, record and diff flow over stdio so it can be driven from an editor.

What safety limits does behave have when probing tools?

It only runs the binaries you point it at, in a fresh temp directory, and warns against probing tools that change things outside their working directory without `--skip-flag` and a sandbox.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 09eb319bc6f5 · 采集于 2026-11-13 14:10:21 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

behave

Support my open-source work: get a SkinToScan pack
If you find this useful, you can support me by getting a SkinToScan pack, my other project. It's a one-time purchase that directly funds my open-source work.

Buy Single Picture Check, €4.49 Buy 5 Picture Pack, €19.99 (popular) Buy 15 Picture Pack, €54.99

behave records how a command-line tool actually behaves, then replays those cases against another implementation. I built it for CLI compatibility testing: checking a Rust or Go port against the original, or catching a refactor that changed visible behaviour.

It treats the tool as a black box. It reads --help and the man page, generates cases (flags, flag pairs, listed values, odd stdin, missing files, bad values), records stdout, stderr and the exit code, and diffs a second binary against that recording.

behave recording jq and checking gojq against it

I have used it on the Rust rewrites of GNU coreutils, findutils, sed and procps. So far that has led to 40 upstream bug reports and 47 fix PRs, 33 of them merged (as of 13 Nov 2026). The full list is in upstream findings.

Install

Homebrew (macOS and Linux), a binary from Releases, or go install:

brew install emirmrkaljevic/tap/behave
# or: go install github.com/emirmrkaljevic/behave/cmd/behave@latest

Example

Record GNU sort, check that the recording is stable, then compare a rewrite:

behave probe sort
behave run behave-sort
behave diff behave-sort --impl ./target/release/sort --skip-tag meta

--skip-tag meta drops --help and --version, which a rewrite is allowed to word differently.

A failing case looks like this (abridged):

✗ flag --output-delimiter, value -1, arg -f1  0135-flag-output-delimiter-value-1-arg-f1.yaml
  $ cut --output-delimiter -1 -f1
  exit:
    exit: want 0, got 1
  stdout:
    - hello

flags with differences:
  --output-delimiter             2/16  cases differ
flags fully compatible: 9 of 10

cut vs ./uu/cut: 172/175 passed, 3 failed, 0 skipped  (differs in: exit 2, stdout 3)  [0.1s]

The repo also ships ready-made specs under examples/. behave run examples/cut is a small GNU cut suite; behave diff examples/jq --impl gojq checks gojq against jq 1.7. The full list, with case counts, is in docs/examples.md.

For tools that need a positional argument, pass samples with --arg:

behave probe jq --arg . --arg '.a' --arg keys

Add a hand-written case with behave add behave-cut --stdin 'a,b' -- -d, -f2. The commands and spec format page covers the rest of the CLI, including coverage and JUnit output for CI.

MCP (optional)

behave mcp exposes the same probe, record and diff flow over stdio, if you want to drive it from an editor. Setup and tools are in docs/mcp.md.

Limitations

behave only runs the binaries you point it at, in a fresh temp directory. Do not probe tools that change things outside their working directory (package managers, rm -rf style tools) without --skip-flag and a sandbox.

Recordings are only as good as the original you pointed at. Record from the release the rewrite actually targets. GNU coreutils 9.12 and 9.7 already disagree on some tail -v headers. Cases that change between runs, such as sort --random-sort, are marked flaky and skipped. Some differences are deliberate design choices, not bugs.

Status: early (v0.1). The CLI works; feedback is welcome.

Docs

MCP Registry name: io.github.emirmrkaljevic/behave

License

MIT

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for behave, a CLI compatibility testing tool with an MCP server mode from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/behave)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools