{"id":15010326,"url":"https://github.com/elixircl/pods","last_synced_at":"2025-04-09T18:33:50.360Z","repository":{"id":235648861,"uuid":"791061868","full_name":"ElixirCL/pods","owner":"ElixirCL","description":"🌉 Elixir Pods enables communication with external programs using stdin and stdout ","archived":false,"fork":false,"pushed_at":"2024-05-14T15:44:15.000Z","size":435,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T05:26:52.662Z","etag":null,"topics":["babashka","babashka-pods","chile","clojure","elixir","elixir-pods","pods"],"latest_commit_sha":null,"homepage":"https://elixircl.github.io/pods/","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ElixirCL.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-24T02:55:57.000Z","updated_at":"2025-02-21T00:50:23.000Z","dependencies_parsed_at":"2024-09-24T19:33:40.822Z","dependency_job_id":"0172acee-4f07-4731-8242-12ea8b88d37a","html_url":"https://github.com/ElixirCL/pods","commit_stats":null,"previous_names":["elixircl/pods","elixircl/pods-poc"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElixirCL%2Fpods","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElixirCL%2Fpods/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElixirCL%2Fpods/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElixirCL%2Fpods/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ElixirCL","download_url":"https://codeload.github.com/ElixirCL/pods/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248088185,"owners_count":21045662,"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":["babashka","babashka-pods","chile","clojure","elixir","elixir-pods","pods"],"created_at":"2024-09-24T19:33:33.602Z","updated_at":"2025-04-09T18:33:50.327Z","avatar_url":"https://github.com/ElixirCL.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elixir Pods\n\n_Elixir Pods_ is a way of communication between _Elixir_ and a service\nimplemented in any programming language (`pod`). This service must adhere to a simple protocol (`pod protocol`) that uses standard and battle tested tools (`stdin`, `stdout`, `bencode` and `json`) for it's implementation.\n\nThe main inspiration for this is [Babashka Pods](https://github.com/babashka/pods).\n\nBasically is a command line tool that has an infinite bucle (`while true`)\nthat listen to commands in `stdin` and outputs the results in `stdout`.\n\nNote how every component is fully customizable, so you can implement\nthose with your own tools and configurations.\n\n```mermaid\nsequenceDiagram\n    Pod Client-\u003e\u003e+Pod Service: {:ok, \"start\"}\n    Pod Service--\u003e\u003e-Pod Client: {:ok, os_pid}\n    Pod Client-\u003e\u003e+Pod Service: {:ok, {os_pid, \"describe\"}}\n    Pod Service--\u003e\u003e-Pod Client: {:ok, description}\n    Pod Client-\u003e\u003e+Pod Service: {:ok, {os_pid, {\"invoke\", params}}}\n    Pod Service--\u003e\u003e-Pod Client: {:ok, result}\n    Pod Client-\u003e\u003e+Pod Service: {:ok, {os_pid, \"shutdown\"}}\n    Pod Service--\u003e\u003e-Pod Client: {:ok, \"stop\"}\n```\n\n## Implementing a Pod\n\nYou can implement the pods with any technology and a simple _Elixir_ wrapper to expose their API.\n\n- `artifacts`: The directory where the external code executables will be stored.\n- `pod.ex`: The main public api for the pod.\n- `manifest.ex`: Some helper functions to have more information about the pod.\n\nIf you want to debug you can use standard tools such as stdin and stdout. In Unix systems you can access by using (1 stdout, 2 stderr).\n\n```bash\n  cat /proc/\u003cpid\u003e/fd/1\n```\n\nAn _Elixir Pod_ must follow some simple rules:\n\n- An infinite function (`while true`).\n- Reads from `stdin` (in streaming mode).\n- Writes to `stdout` (success and errors) and `stderr` (exceptions).\n- Follows [Elixir Pods](POD_PROTOCOL.md) format.\n- At least implements the `describe` and `invoke` operators.\n- Encodes messages with [bencode](https://en.wikipedia.org/wiki/Bencode).\n- Encodes payload with _JSON_.\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed\nby adding `pods` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:pods, \"~\u003e 1.0.0\"}\n  ]\nend\n```\n\nDocumentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm). Once published, the docs can\nbe found at \u003chttps://hexdocs.pm/pods\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixircl%2Fpods","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felixircl%2Fpods","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixircl%2Fpods/lists"}