{"id":28514758,"url":"https://github.com/facebookincubator/scrut","last_synced_at":"2025-07-11T20:04:04.348Z","repository":{"id":212069529,"uuid":"638544709","full_name":"facebookincubator/scrut","owner":"facebookincubator","description":"Scrut is a testing toolkit for CLI applications. A tool to scrutinize terminal programs without fuss.","archived":false,"fork":false,"pushed_at":"2025-07-03T21:16:17.000Z","size":22314,"stargazers_count":44,"open_issues_count":1,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-03T22:24:23.069Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://facebookincubator.github.io/scrut/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/facebookincubator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-05-09T15:20:49.000Z","updated_at":"2025-07-03T21:14:21.000Z","dependencies_parsed_at":"2024-04-03T11:25:54.969Z","dependency_job_id":"be402402-ba8b-466c-872c-d979042953f1","html_url":"https://github.com/facebookincubator/scrut","commit_stats":null,"previous_names":["facebookincubator/scrut"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/facebookincubator/scrut","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookincubator%2Fscrut","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookincubator%2Fscrut/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookincubator%2Fscrut/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookincubator%2Fscrut/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/facebookincubator","download_url":"https://codeload.github.com/facebookincubator/scrut/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/facebookincubator%2Fscrut/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264890087,"owners_count":23678833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-09T02:04:59.086Z","updated_at":"2025-07-11T20:04:04.337Z","avatar_url":"https://github.com/facebookincubator.png","language":"Rust","funding_links":[],"categories":["Rust","\u003ca name=\"programming\"\u003e\u003c/a\u003eProgramming"],"sub_categories":[],"readme":"# Scrut\n\nScrut is a CLI testing toolkit designed to rigorously test terminal programs. It is inspired by [Cram](https://github.com/brodie/cram) and focuses on providing a straightforward way to validate CLI behavior.\n\n# Why though?\n\nTesting command-line interfaces (CLIs) can be challenging. While unit tests are essential for verifying business logic, they often fall short in testing interactions with the environment, such as command line inputs, environment variables, and external APIs.\n\nCLIs vary widely in complexity, from simple shell scripts automating repetitive tasks to large applications with multiple sub-commands. A robust testing framework should accommodate this diversity.\n\nScrut is a tool designed for functional, integration, end-to-end, and black-box testing of CLIs. It supports a flexible syntax to validate the behavior of CLIs, regardless of their complexity or the programming language used (e.g., Rust, Java, Ruby, C++, Typescript).\n\nScrut's key features include:\n\n- **Low Threshold**: Easy to learn, with minimal entry barriers.\n- **Low Effort**: Simplifies writing tests for even small CLI scripts.\n- **Low Maintenance**: Ensures tests remain relevant and easy to update.\n- **Readable**: Provides documentation value through clear test cases.\n\n# How then?\n\nThe `scrut` command line application executes tests of CLIs that are persisted in Markdown (`.md`) or Cram (`.t`) files.\n\nThis is a markdown document that contains a test case:\n\n````markdown title=\"my-test-document.md\" showLineNumbers\n# Scrut Tests are Markdown Documents\n\nWrite tests in code-blocks with the `scrut` language where you validate that\nthe output of a command matches your expectations.\n\n## Version is printed\n\n```scrut\n$ acme --version\nacme 1.0.0\n```\n\nThere is plenty space to note down your intentions and whatever context you\nwant to provide to make this test maintainable.\n````\n\nAssuming the `acme` CLI is in your `PATH` then you can run the test with:\n\n```bash title=\"Terminal\"\n$ scrut test my-test-document.md\n🔎 Found 1 test document(s)\n\nResult: 1 document(s) with 1 testcase(s): 1 succeeded, 0 failed and 0 skipped\n```\n\nThat is assuming `acme --version` prints `acme 1.0.0`.\n\n## Getting Started\n\nHead over to the [Getting Started Guide](https://facebookincubator.github.io/scrut/docs/getting-started/) to get learn how to write your own tests and everything else you need to know\n\n## Contribute\n\n- [Contributing](CONTRIBUTING.md)\n- [Code of Conduct](CODE_OF_CONDUCT.md)\n\n## License\n\n- [LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebookincubator%2Fscrut","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffacebookincubator%2Fscrut","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffacebookincubator%2Fscrut/lists"}