← 全部工具

nao1215/atago

热度 75 更新于 开发与构建

Tests CLI behavior from plain YAML: exit codes, output, files, snapshots, and interactive terminals (PTY/TUI)

githubauto-collected

安装

暂未验证可直接使用的安装命令,请查看项目官方文档或 Release。

[](https://github.com/nao1215/atago/actions/workflows/build.yml) [](https://github.com/nao1215/atago/actions/workflows/unittest.yml) [](https://github.com/nao1215/atago/actions/workflows/reviewdog.yml) [](https://github.com/nao1215/himorime) [](https://pkg.go.dev/github.com/nao1215/atago) [](https://github.com/nao1215/atago/releases)

<p align="center" <img src="./doc/img/atago-logo.jpg" alt="atago logo" width="400" / </p

atago tests real CLI behavior from plain YAML: commands, files, snapshots, services, and interactive terminals. It runs your actual binary — in any language — and asserts what a user observes. No test code, no shell DSL.

Documentation: https://nao1215.github.io/atago/

First run

No install, no fictional binary — if you have Go, paste this. It records a real run of a command you already have, then replays it as a test:

go run github.com/nao1215/atago@latest record --out demo.atago.yaml -- git --version
go run github.com/nao1215/atago@latest run demo.atago.yaml
.

PASSED  1 scenario: 1 passed, 0 failed, 0 errored, 0 skipped (4ms)

record runs git --version once and writes a spec from what it observed — the exit code, the version line on stdout, an empty stderr (a tool that writes a diagnostic there gets that first line anchored instead). run replays it. Open demo.atago.yaml and you have a real test you can tighten, not YAML you wrote from scratch. (Swap git --version for any command you have: go version, jq --version, ls -la.)

Then point it at your own tool:

atago record --out mytool.atago.yaml -- mytool convert input.txt  # turn a real run into a spec
atago run mytool.atago.yaml                                       # replay it as a test
atago run --report junit specs/                                   # or run a whole suite in CI

Why atago?

Pick the tool that owns your layer:

| You are testing | Use | |-----------------|-----| | An HTTP/gRPC API server — scenario-based API testing | runn | | A whole platform — integration suites across HTTP, gRPC, Kafka, databases, and more | venom | | Shell functions and scripts — BDD-style unit tests | ShellSpec | | Bash scripts — TAP-style tests | Bats | | A CLI product — exit codes, output, generated files, snapshots, interactive prompts and TUIs | atago |

If the server or the platform is the system under test, use runn or venom. atago points the other way: the CLI is the product, and HTTP, database, SSH, gRPC, browser, and mock servers appear only as peers your CLI talks to.

A feature-by-feature comparison states the versions compared and its sources, and the migration guide maps Bats and ShellSpec constructs to atago one-to-one — every mapping runs in CI, originals and migrations both.

Install

go install github.com/nao1215/atago@latest