{"id":14991234,"url":"https://github.com/timfjord/anytest-cli","last_synced_at":"2026-02-01T01:34:38.589Z","repository":{"id":229199512,"uuid":"776040180","full_name":"timfjord/anytest-cli","owner":"timfjord","description":"Run any test from your terminal.","archived":false,"fork":false,"pushed_at":"2024-05-04T10:07:27.000Z","size":69,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-26T05:27:48.483Z","etag":null,"topics":["cargotest","espec","exunit","jest","pytest","rspec","zigtest"],"latest_commit_sha":null,"homepage":"","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/timfjord.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2024-03-22T15:00:08.000Z","updated_at":"2024-05-04T10:07:30.000Z","dependencies_parsed_at":"2024-04-18T16:00:49.537Z","dependency_job_id":"86cc05cd-4968-4f9f-b3c6-f05c205fa355","html_url":"https://github.com/timfjord/anytest-cli","commit_stats":null,"previous_names":["timfjord/any_test"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/timfjord/anytest-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timfjord%2Fanytest-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timfjord%2Fanytest-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timfjord%2Fanytest-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timfjord%2Fanytest-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timfjord","download_url":"https://codeload.github.com/timfjord/anytest-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timfjord%2Fanytest-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28963913,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T01:25:30.373Z","status":"ssl_error","status_checked_at":"2026-02-01T01:25:29.809Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cargotest","espec","exunit","jest","pytest","rspec","zigtest"],"created_at":"2024-09-24T14:21:55.504Z","updated_at":"2026-02-01T01:34:38.575Z","avatar_url":"https://github.com/timfjord.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable --\u003e\n[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://stand-with-ukraine.pp.ua)\n\n# anytest [![Lint](https://github.com/timfjord/anytest-cli/actions/workflows/lint.yml/badge.svg)](https://github.com/timfjord/anytest-cli/actions/workflows/lint.yml) [![Test](https://github.com/timfjord/anytest-cli/actions/workflows/test.yml/badge.svg)](https://github.com/timfjord/anytest-cli/actions/workflows/test.yml)\n\n\u003c!-- markdownlint-enable --\u003e\n\nRun any test from your terminal.\n\nMany test frameworks allow running a single test, but they all use different formats. The majority require to build quite complex queries that are hard to type and even remember. This tool aims to provide a unified way to run a single test by specifying only the file and the line number (following how RSpec/ExUnit/ESpec does that).\nThe tool is heavily inspired by the awesome [vim-test](https://github.com/vim-test/vim-test) plugin.\n\nCurrently, the following test frameworks are supported (and more are coming soon):\n\n|       Language | Test framework | Identifiers       |\n| -------------: | :------------- | :---------------- |\n|     **Elixir** | ESpec, ExUnit  | `espec`, `exunit` |\n| **JavaScript** | Jest           | `jest`            |\n|     **Python** | pytest         | `pytest`          |\n|       **Ruby** | RSpec          | `rspec`           |\n|       **Rust** | Cargotest      | `cargotest`       |\n|        **Zig** | Zigtest        | `zigtest`         |\n\nFeel free to [open an issue](https://github.com/timfjord/anytest-cli/issues/new) with a test framework request as those test frameworks will be added first.\n\n## Installation\n\nCurrently, `anytest` is distributed via [crates.io](https://crates.io/crates/anytest) so Rust is required to install it.\nTo install Rust, follow the instructions on the [official Rust website](https://www.rust-lang.org/tools/install).\n\nTo build `anytest` from source use:\n\n```sh\ncargo install anytest\n```\n\n## Usage\n\nIt is as simple as running `anytest \u003cfile\u003e:\u003cline\u003e`:\n\n```sh\nanytest tests/test_rust.rs:10\n```\n\nThe tool supports the following scopes:\n\n- `suite` - run the whole suite\n- `file` - run all tests in the file\n- `line` - run the test at the specified line\n\nWhen the the path is specified with the line number (e.g. `anytest tests/test_rust.rs:10`), the scope is automatically set to `line`.\nWhen the path is specified without the line number (e.g. `anytest tests/test_rust.rs`), the scope is automatically set to `file`.\n\nThe scope can be explicitly set with the `--scope`/`-s` flag:\n\n```sh\nanytest tests/test_rust.rs:10 -s file\n```\n\nBy default, `anytest` uses the current working directory as the root directory. The root directory can be explicitly set with the `--root`/`-r` flag:\n\n```sh\nanytest anytest-cli/tests/test_rust.rs:10 -r anytest-cli\n```\n\nWhen the root directory is specified, the path to the test can be either relative to the root (e.g. `anytest tests/test_rust.rs:10 -r anytest-cli`) or relative to the current working directory (e.g. `anytest anytest-cli/tests/test_rust.rs:10 -r anytest-cli`).\n\nTo run the tool in the dry-run mode, use the `--dry-run`/ flag:\n\n```sh\nanytest tests/test_rust.rs:10 --dry-run\n```\n\nTo see the list of all available options, run:\n\n```sh\nanytest --help\n```\n\n## Usage with Zed\n\nEven though `anytest` is a standalone tool, the main driver behind writing it was to use it with [Zed](https://zed.dev).\nCurrently, Zed has limited extension support, so the only way to integrate `anytest` with Zed is to use [Zed tasks](https://zed.dev/docs/tasks).\n\nThe repository contains [an example `tasks.json` file](https://github.com/timfjord/anytest-cli/blob/main/examples/tasks.json) that can be copied to the Zed configuration directory with the following command:\n\n```sh\nwget https://raw.githubusercontent.com/timfjord/anytest-cli/main/examples/tasks.json -O ~/.config/zed/tasks.json -nc\n```\n\nPlease note that the command above won't overwrite the existing `tasks.json` file. Remove the `-nc` flag to overwrite the existing file.\n\nOnce the tasks are set up, either pick the `task: spawn` command from the Command Palette or add keybindings to run the tests.\n\n```json\n[\n  {\n    \"context\": \"Workspace\",\n    \"bindings\": {\n      \"cmd-j cmd-s\": [\"task::Spawn\", { \"task_name\": \"anytest: test suite\" }],\n      \"cmd-j cmd-f\": [\"task::Spawn\", { \"task_name\": \"anytest: test file\" }],\n      \"cmd-j cmd-l\": [\"task::Spawn\", { \"task_name\": \"anytest: test line\" }]\n    }\n  }\n]\n```\n\n## Usage with other crates\n\n`anytest` also acts as a library crate and can be used in other Rust projects.\n\nCurrently, it exposes the `build_command` function that builds a [`std::process::Command`](https://doc.rust-lang.org/std/process/struct.Command.html) for the given context. See [tests/test_api.rs](https://github.com/timfjord/anytest-cli/blob/main/tests/test_api.rs) for more details.\n\n```rust\nuse anytest::{Context, Scope};\n\nlet context = Context::new(\n    Some(\"tests/fixtures/cargotest/crate\"),\n    \"tests/integration_test.rs\",\n    Some(3),\n    Some(Scope::Line),\n)\n.unwrap();\nlet command = anytest::build_command(\u0026context).unwrap();\n\nassert_eq!(command.get_program(), \"cargo\");\nassert_eq!(\n    command\n        .get_args()\n        .map(|arg| arg.to_str().unwrap())\n        .collect::\u003cVec\u003c_\u003e\u003e(),\n    vec![\n        \"test\",\n        \"--test\",\n        \"integration_test\",\n        \"it_adds_two\",\n        \"--\",\n        \"--exact\"\n    ]\n);\n```\n\n## Contribution\n\nThe easiest way to add a new test framework is to find it either in [the `AnyTest` repository](https://github.com/timfjord/AnyTest/tree/main/plugin/test_frameworks) or [the `vim-test` repository](https://github.com/vim-test/vim-test/tree/master/autoload/test) and try to adapt it.\nIt is also required to cover the test frameworks with tests. Tests and fixtures can be also found in either [the `AnyTest` repository](https://github.com/timfjord/AnyTest/tree/main/tests/test_frameworks) or [the `vim-test` repository](https://github.com/vim-test/vim-test/tree/master/spec)\n\n## Credits\n\n`anytest` is heavily inspired by the [vim-test](https://github.com/vim-test/vim-test) plugin so all credits go to the authors and maintainers of this awesome Vim plugin.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimfjord%2Fanytest-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimfjord%2Fanytest-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimfjord%2Fanytest-cli/lists"}