{"id":19502324,"url":"https://github.com/zio/zio-process","last_synced_at":"2025-04-09T21:50:55.924Z","repository":{"id":38851048,"uuid":"233299999","full_name":"zio/zio-process","owner":"zio","description":"A simple ZIO library for interacting with external processes and command-line programs","archived":false,"fork":false,"pushed_at":"2025-03-11T17:14:14.000Z","size":1789,"stargazers_count":64,"open_issues_count":21,"forks_count":13,"subscribers_count":9,"default_branch":"series/2.x","last_synced_at":"2025-04-09T21:50:47.897Z","etag":null,"topics":["scala","zio"],"latest_commit_sha":null,"homepage":"https://zio.dev/zio-process","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zio.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-11T21:30:40.000Z","updated_at":"2025-03-11T17:14:19.000Z","dependencies_parsed_at":"2024-02-17T12:31:14.065Z","dependency_job_id":"822b67eb-35a7-4b87-a030-9737f50d0405","html_url":"https://github.com/zio/zio-process","commit_stats":{"total_commits":188,"total_committers":13,"mean_commits":"14.461538461538462","dds":"0.46808510638297873","last_synced_commit":"e4a94fb8de4e17323104e43555ed3908e2e84907"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zio%2Fzio-process","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zio%2Fzio-process/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zio%2Fzio-process/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zio%2Fzio-process/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zio","download_url":"https://codeload.github.com/zio/zio-process/tar.gz/refs/heads/series/2.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119403,"owners_count":21050754,"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":["scala","zio"],"created_at":"2024-11-10T22:16:05.219Z","updated_at":"2025-04-09T21:50:55.905Z","avatar_url":"https://github.com/zio.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"[//]: # (This file was autogenerated using `zio-sbt-website` plugin via `sbt generateReadme` command.)\n[//]: # (So please do not edit it manually. Instead, change \"docs/index.md\" file or sbt setting keys)\n[//]: # (e.g. \"readmeDocumentation\" and \"readmeSupport\".)\n\n# ZIO Process\n\n[ZIO Process](https://zio.dev/zio-process) is a simple ZIO library for interacting with external processes and command-line programs.\n\n[![Production Ready](https://img.shields.io/badge/Project%20Stage-Production%20Ready-brightgreen.svg)](https://github.com/zio/zio/wiki/Project-Stages) ![CI Badge](https://github.com/zio/zio-process/workflows/CI/badge.svg) [![Sonatype Releases](https://img.shields.io/nexus/r/https/oss.sonatype.org/dev.zio/zio-process_2.13.svg?label=Sonatype%20Release)](https://oss.sonatype.org/content/repositories/releases/dev/zio/zio-process_2.13/) [![Sonatype Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-process_2.13.svg?label=Sonatype%20Snapshot)](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-process_2.13/) [![javadoc](https://javadoc.io/badge2/dev.zio/zio-process-docs_2.13/javadoc.svg)](https://javadoc.io/doc/dev.zio/zio-process-docs_2.13) [![ZIO Process](https://img.shields.io/github/stars/zio/zio-process?style=social)](https://github.com/zio/zio-process)\n\n## Introduction\n\nZIO Process is backed by ZIO Streams, enabling you to work with processes that output gigabytes of data without worrying about exceeding memory constraints.\n\nZIO Process provides a principled way to call out to external programs from within a ZIO application while leveraging ZIO's capabilities like interruptions and offloading blocking operations to a separate thread pool. We don't need to worry about avoiding these common pitfalls as we would if we were to use Java's `ProcessBuilder` or the `scala.sys.process` API since it is already taken care of for you.\n\nKey features of the ZIO Process:\n- **Deep ZIO Integration** — Leverages ZIO to handle interruption and offload blocking operations.\n- **ZIO Streams** — ZIO Process is backed by ZIO Streams, which enables us to obtain the command output as streams of bytes or lines. So we can work with processes that output gigabytes of data without worrying about exceeding memory constraints.\n- **Descriptive Errors** — In case of command failure, it has a descriptive category of errors.\n- **Piping** — It has a simple DSL for piping the output of one command as the input of another.\n- **Blocking Operations**\n\n## Installation\n\nIn order to use this library, we need to add the following line in our `build.sbt` file:\n\n```scala\nlibraryDependencies += \"dev.zio\" %% \"zio-process\" % \"0.7.2\" \n```\n\n## Native support\nSome features might have a different behaviour when using Scala Native. Creating non-existent commands do not throw a corresponding error. `bash` command might be needed when executing a script. In some cases, using `ZStreams` as standard input might block the process. Instead, a Java `InputStream` can be used to write to the standard input of the process.\n\n## Example\n\nHere is a simple example of using ZIO Process:\n\n```scala\nimport zio._\nimport zio.process.Command\n\nimport java.io.File\n\nobject ZIOProcessExample extends ZIOAppDefault {\n  val myApp = for {\n    fiber \u003c- Command(\"dmesg\", \"--follow\").linesStream\n      .foreach(Console.printLine(_))\n      .fork\n    cpuModel \u003c- (Command(\"cat\", \"/proc/cpuinfo\") |\n      Command(\"grep\", \"model name\") |\n      Command(\"head\", \"-n\", \"1\") |\n      Command(\"cut\", \"-d\", \":\", \"-f\", \"2\")).string\n    _ \u003c- Console.printLine(s\"CPU Model: $cpuModel\")\n    _ \u003c- (Command(\"pg_dump\", \"my_database\") \u003e new File(\"dump.sql\")).exitCode\n    _ \u003c- fiber.join\n  } yield ()\n\n  override def run = myApp\n}\n```\n\n## Documentation\n\nLearn more on the [ZIO Process homepage](https://zio.dev/zio-process/)!\n\n## Contributing\n\nFor the general guidelines, see ZIO [contributor's guide](https://zio.dev/about/contributing).\n\n## Code of Conduct\n\nSee the [Code of Conduct](https://zio.dev/about/code-of-conduct)\n\n## Support\n\nCome chat with us on [![Badge-Discord]][Link-Discord].\n\n[Badge-Discord]: https://img.shields.io/discord/629491597070827530?logo=discord \"chat on discord\"\n[Link-Discord]: https://discord.gg/2ccFBr4 \"Discord\"\n\n## License\n\n[License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzio%2Fzio-process","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzio%2Fzio-process","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzio%2Fzio-process/lists"}