{"id":18026782,"url":"https://github.com/yegor256/jaxec","last_synced_at":"2025-03-27T01:31:24.992Z","repository":{"id":191648948,"uuid":"685087679","full_name":"yegor256/jaxec","owner":"yegor256","description":"Primitive execution of command line commands from Java (mostly useful for tests)","archived":false,"fork":false,"pushed_at":"2025-03-17T15:59:13.000Z","size":190,"stargazers_count":13,"open_issues_count":5,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-17T16:47:46.506Z","etag":null,"topics":["cli","exec","java","java-library"],"latest_commit_sha":null,"homepage":"","language":"Java","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/yegor256.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2023-08-30T13:44:47.000Z","updated_at":"2025-03-10T12:55:44.000Z","dependencies_parsed_at":"2023-12-26T15:53:23.761Z","dependency_job_id":"b52d7802-01fc-48d4-b733-275a11ae1292","html_url":"https://github.com/yegor256/jaxec","commit_stats":null,"previous_names":["yegor256/jaxec"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fjaxec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fjaxec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fjaxec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fjaxec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yegor256","download_url":"https://codeload.github.com/yegor256/jaxec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245764704,"owners_count":20668462,"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":["cli","exec","java","java-library"],"created_at":"2024-10-30T08:08:02.612Z","updated_at":"2025-03-27T01:31:24.986Z","avatar_url":"https://github.com/yegor256.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Executes Command Line from Java\n\n[![EO principles respected here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)\n[![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/jaxec)](http://www.rultor.com/p/yegor256/jaxec)\n[![We recommend IntelliJ IDEA](https://www.elegantobjects.org/intellij-idea.svg)](https://www.jetbrains.com/idea/)\n\n[![mvn](https://github.com/yegor256/jaxec/actions/workflows/mvn.yml/badge.svg)](https://github.com/yegor256/jaxec/actions/workflows/mvn.yml)\n[![PDD status](http://www.0pdd.com/svg?name=yegor256/jaxec)](http://www.0pdd.com/p?name=yegor256/jaxec)\n[![Maven Central](https://img.shields.io/maven-central/v/com.yegor256/jaxec.svg)](https://maven-badges.herokuapp.com/maven-central/com.yegor256/jaxec)\n[![Javadoc](http://www.javadoc.io/badge/com.yegor256/jaxec.svg)](http://www.javadoc.io/doc/com.yegor256/jaxec)\n[![codecov](https://codecov.io/gh/yegor256/jaxec/branch/master/graph/badge.svg)](https://codecov.io/gh/yegor256/jaxec)\n[![Hits-of-Code](https://hitsofcode.com/github/yegor256/jaxec)](https://hitsofcode.com/view/github/yegor256/jaxec)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/jaxec/blob/master/LICENSE.txt)\n\nIt's a simple executor of a shell command from Java. It is essentially\na wrapper around [`Runtime.exec()`][exec], with a fluent interface.\n\nFirst, you add this to your `pom.xml`:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.yegor256\u003c/groupId\u003e\n  \u003cartifactId\u003ejaxec\u003c/artifactId\u003e\n  \u003cversion\u003e0.4.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nThen, you use it like this:\n\n```java\nimport com.yegor256.Jaxec;\nString stdout = new Jaxec(\"ls\", \"-al\")\n  .with(\"/tmp\") // append argument to the command\n  .withHome(\"/home/me\") // run it in this directory\n  .withRedirect(false) // don't redirect STDERR to STDOUT\n  .withCheck(false) // don't throw if the exit code is not-zero\n  .withStdin(\"Hello, world!\") // send this text to the STDIN of the command\n  .exec()\n  .stdout();\n```\n\nIf exit code is not equal to zero, a runtime exception\nwill be thrown by the `exec()` method. You can also use\n`unsafeExec()`, which throws checked exception `IOException`.\n\nThe stdout and stderr of the command are both sent to Slf4j logging\nfacility `com.jcabi.log.VerboseProcess`. The level for stdout\nis `DEBUG`, while the level for stderr is `WARN`.\n\n## How to Contribute\n\nFork repository, make changes, send us a\n[pull request](https://www.yegor256.com/2014/04/15/github-guidelines.html).\nWe will review your changes and apply them to the `master` branch shortly,\nprovided they don't violate our quality standards. To avoid frustration,\nbefore sending us your pull request please run full Maven build:\n\n```bash\nmvn clean install -Pqulice\n```\n\nYou will need Maven 3.3+ and Java 8+.\n\n[exec]: https://docs.oracle.com/javase/8/docs/api/java/lang/Runtime.html#exec-java.lang.String-\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyegor256%2Fjaxec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyegor256%2Fjaxec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyegor256%2Fjaxec/lists"}