{"id":15883031,"url":"https://github.com/tcr/commandspec","last_synced_at":"2025-07-11T15:07:57.977Z","repository":{"id":57609110,"uuid":"124180066","full_name":"tcr/commandspec","owner":"tcr","description":"Rust macro to build std::process::Command objects with shell syntax. Uses macro_rules! and works on stable.","archived":false,"fork":false,"pushed_at":"2020-03-12T17:52:04.000Z","size":27,"stargazers_count":43,"open_issues_count":8,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-08T08:55:36.806Z","etag":null,"topics":["command","macro","process","rust","shell"],"latest_commit_sha":null,"homepage":"http://docs.rs/commandspec","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tcr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-07T04:41:29.000Z","updated_at":"2025-02-07T10:36:28.000Z","dependencies_parsed_at":"2022-08-27T19:52:32.722Z","dependency_job_id":null,"html_url":"https://github.com/tcr/commandspec","commit_stats":null,"previous_names":["tcr/command-macro"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tcr/commandspec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcr%2Fcommandspec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcr%2Fcommandspec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcr%2Fcommandspec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcr%2Fcommandspec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tcr","download_url":"https://codeload.github.com/tcr/commandspec/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcr%2Fcommandspec/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264837435,"owners_count":23671038,"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":["command","macro","process","rust","shell"],"created_at":"2024-10-06T04:08:12.941Z","updated_at":"2025-07-11T15:07:57.933Z","avatar_url":"https://github.com/tcr.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# commandspec\n\nSimple Rust macro for building `std::process::Command` objects. Uses macro_rules! and works on stable.\n\n```toml\n[dependencies]\ncommandspec = \"0.10\"\n```\n\nThen:\n\n```rust\n#[macro_use]\nextern crate commandspec;\n\nuse commandspec::CommandSpec; // .execute() method on Command\nuse std::process::Command;\n\nlet result = execute!(\n    r\"\n        cd path/location\n        export RUST_LOG=full\n        export RUST_BACKTRACE=1\n        cargo run {release_flag} --bin {bin_name} -- {args}\n    \",\n    release_flag=Some(\"--release\"),\n    bin_name=\"binary\",\n    args=vec![\"arg1\", \"arg2\"],\n)?;\n// result = Ok(()) on success (error code 0), Err(CommandError) for all else\n```\n\nFormat of the commandspec input, in order:\n\n* (optional) `cd \u003cpath\u003e` to set the current working directory of the command, where path can be a literal, a quoted string, or format variable.\n* (optional) one or more `export \u003cname\u003e=\u003cvalue\u003e` lines to set environment variables, with the same formatting options.\n* Last, a command you want to invoke, optionally with format arguments.\n\n### Features:\n\n* format-like invocation makes it easy to interpolate variables, with automatic quoting\n* Equivalent syntax to shell when prototyping\n* Works on stable Rust.\n\n## License\n\nMIT or Apache-2.0, at your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcr%2Fcommandspec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftcr%2Fcommandspec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcr%2Fcommandspec/lists"}