{"id":37885993,"url":"https://github.com/natemago/processagent","last_synced_at":"2026-01-18T01:09:39.041Z","repository":{"id":57607761,"uuid":"200310818","full_name":"natemago/processagent","owner":"natemago","description":"Make everything a microservice","archived":false,"fork":false,"pushed_at":"2019-08-09T20:39:34.000Z","size":1277,"stargazers_count":3,"open_issues_count":5,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-20T10:17:27.491Z","etag":null,"topics":["microservice","process-agent","tool"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/natemago.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}},"created_at":"2019-08-02T23:51:03.000Z","updated_at":"2019-08-09T20:39:36.000Z","dependencies_parsed_at":"2022-08-28T07:43:03.852Z","dependency_job_id":null,"html_url":"https://github.com/natemago/processagent","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/natemago/processagent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natemago%2Fprocessagent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natemago%2Fprocessagent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natemago%2Fprocessagent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natemago%2Fprocessagent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/natemago","download_url":"https://codeload.github.com/natemago/processagent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natemago%2Fprocessagent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28480081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: 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":["microservice","process-agent","tool"],"created_at":"2026-01-16T16:52:18.910Z","updated_at":"2026-01-16T16:52:18.991Z","avatar_url":"https://github.com/natemago.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Process Agent\n=============\n\n[![Build Status](https://travis-ci.org/natemago/processagent.svg?branch=master)](https://travis-ci.org/natemago/processagent)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/464aa5413c4f09a95a4c/test_coverage)](https://codeclimate.com/github/natemago/processagent/test_coverage)\n[![Maintainability](https://api.codeclimate.com/v1/badges/464aa5413c4f09a95a4c/maintainability)](https://codeclimate.com/github/natemago/processagent/maintainability)\n[![GoDoc Reference](https://godoc.org/github.com/natemago/processagent?status.svg)](https://godoc.org/github.com/natemago/processagent)\n\nMake everything a micro-service.\n\nProcess agent is a tool that can wrap an existing CLI app and expose it as micro-service.\n\nIt runs as an HTTP, WebSocket or AMQP endpoint, listens for requests on a specific port\nand passes down the requests on the standard input of the wrapped process. Whatever it\nreceives from the process, returns back either as JSON (by default) or raw.\n\nAn example - run `date` as a microservice over HTTP:\n\n```!bash\n$ processagent -c \"date\" \u0026\n$ curl http://localhost:8080\n{\"id\":\"nqzKiMUepQMa\",\"port\":\"http\",\"payload\":\"Wed 10 Jul 2019 01:22:41 AM CEST\\n\",\"timestamp\":1562714561667}\n```\n\n# Install\n\nOn Linux:\n\n```bash\ncurl -o processagent https://github.com/natemago/processagent/releases/download/v1.0.0/processagent_linux_amd64 \u0026\u0026 chmod +x processagent\n```\n\nOn Mac:\n```bash\ncurl -o processagent https://github.com/natemago/processagent/releases/download/v1.0.0/processagent_darwin_amd64 \u0026\u0026 chmod +x processagent\n```\n\nOn Linux on ARM:\n\n```bash\ncurl -o processagent https://github.com/natemago/processagent/releases/download/v1.0.0/processagent_linux_arm \u0026\u0026 chmod +x processagent\n```\n\nOn Linux on 64-bit ARM:\n```bash\ncurl -o processagent https://github.com/natemago/processagent/releases/download/v1.0.0/processagent_linux_arm64 \u0026\u0026 chmod +x processagent\n```\n\n## Install from source\n\nYou can use Go to install it from source:\n\n```bash\ngo get github.com/natemago/processagent\ngo install github.com/natemago/processagent\n```\n\n# Examples\n\n## Simple service that reads from stdin and writes to stdout\n\nA simple service that reads JSON from stdin, does some processing and writes to\nstdout:\n\nFile `service.go`:\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\n// Message holds the message data received as JSON.\ntype Message struct {\n\tName string `json:\"name\"`\n}\n\nfunc main() {\n\t// Read all of the STDIN input.\n\tdata, err := ioutil.ReadAll(os.Stdin)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t// Then unmarshal the JSON into our structure.\n\tmessage := \u0026Message{}\n\tif err = json.Unmarshal(data, message); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Print out the result on stdout.\n\tfmt.Printf(\"Hello %s! This is service.\", message.Name)\n}\n```\n\nCompile the file:\n```bash\ngo build service.go\n```\n\nThen run it and call the service:\n\n```bash\nprocessagent -c \"service\" \u0026\ncurl \"http://localhost:8080\" -d '{\"name\": \"John Doe\"}'\n```\n\nYou will get the following result:\n```\n{\"id\":\"5kHUO65OhkFH\",\"port\":\"http\",\"payload\":\"Hello John Doe! This is service.\",\"timestamp\":1563147018465}\n```\n\n## Run the processagent on different port\n\nTo run the processagent on different port, pass the `-p` parameter:\n\n```bash\nprocessagent -c \"service\" -p 8090\n```\n\nThen call it on that port:\n```bash\ncurl \"http://localhost:8090\" -d '{\"name\": \"John Doe\"}'\n```\n\nand you should get the same result as above.\n\n\n# What it is\n\nProcessagent is a simple tool designed to do a simple task of wrapping an existing\nprocess and exposing it as a service on HTTP (and in future WebService and AMQP).\nThe communication between processagent and the wrapped process goes via the \nprocess `STDIN`, `STDOUT` and `STDERR`.\n\nThis design choice allows for maximum versatility of the wrapped processes, as it\nis the simplest and most portable way of communication on all platforms.\nThe process itself can be written in any technology of your choosing, as long  as \nit can read from `STDIN` and write to `STDOUT` and `STDERR`. This is the case\nwith most of the current programming languages. On the other hand, the most popular\noperating systems (GNU/Linux, Windows, Mac OSX and other *NIX systems) allow a \nprocess to read from stdin and write to stdout/stderr. Of course, some limitations do \nexist, usually on the size of the buffer for these streams, and are different on\ndifferent platforms. These must be taken into account.\n\nThere are many scenarios where a tool like this might be useful:\n\n* You already have command-line tools that you use and want to expose as services.\nThese might be automation scripts in python, data analysis scripts in R or similar.\nIf your scripts already do what they need to do, and do it well, you don't want to\nadd complexity and possibly introduce bugs to them, as re-writing them as web services\nmight do so. Processagent will wrap the processes and won't add any complexity to your\ncode.\n* You need to write services in many different technologies and want to abstract\nthe communication. All you need is to write the services to read from the process\nstdin and write to stdout, without having to take care of the HTTP handling.\n* You're desinging a large-scale system with different moving parts and processagent\nis just a tool helping you to glue your modules as HTTP (or AMQP) services. This\nis the original intention behind processagent.\n* You're designing a FaaS distributed system. Processagent would handle the incoming\nrequests (over HTTP, Websocket, AMQP) and would pass the to the wrapped functions.\nIn this case, the wrapped processes can in fact be the functions that you want to\ncall.\n* In data-center where you want to run data-intensive processing, and you want\nto call the programs executing the algorithms as standard microservices.\n* In a microservice architecture, you can have the absolute abstraction over\nthe technologies in which the microservices are implemented. Each microservice\ncan be implemented in any technology, without the added complexity of writing\nthe requests handling mechanism - just read from stdin, write to stdout.\n\n\n# What it is not\n\n* It is not a microservice framework. This is just a wrapper around a process \nthat exposes that process onver HTTP, WebSocket or AMQP.\n* It is not a REST framework. You can't define specifir routes or react to\ndifferent HTTP verbs - all requests get passed down to the wrapped process.\n* It is not an AMQP or WebSocket client library.\n* Does not support wrapping multiple commands. The command is given as cli argument\nand cannot be chnaged on runtime. All arguments to the command are fixed and cannot\nbe chnaged also. This is due to security concerns as you dont want to give an\nattacker option to run arbitrary processes.\n* Does not support HTTP path matching (calling on /foo and /bar and /, do exactly\nthe same thing).\n\n# Known issues and limitations\n\n* Does not switch the user, nor is there a configuration for it. The processes are\nrun with the same user as processagent. For security reasons it is not reccomended\nyou run processagent with root or admin privileges, but with limited users only.\nBest practice would be to run processagent with the same privileges that you would\nrun the undrlying process with.\n* Does not support WebSockets (although this is on roadmap).\n* Does not support AMQP (also on roadmap).\n\n# How to contribute\n\nFirst of all, thank you for taking interest in contributing on this project.\n\nThere are many ways you can contribute to this project. If you notice an issue or a behavior\nthat does not seems right or out-right crashes of the program, please submit an issue.\nIf you notice an error in the documentation, you can also submit an issue.\nThe tracker supports labels, so it would be nice if you can label the issues - bug,\nenhancement etc.\n\nIf you already have a fix for some issue (bug fix, enhancement, documentation fix,\nspelling error fix), you are more than welcomed to submit a pull request (PR).\n\nTo submit a PR, first clone this repository, do your fix in a branch on your\nrepository, and then submit a PR to merge your branch into the master branch of\nthis repository. Of course, make sure you have the latest changes from this\nrepository pulled into your branch, to avoid merge conflicts.\n\nIf you contribute code, it would be best to write unit tests for it - if it is a\nbug fix, write a unit test showing that the bug have been fixed; if you write\nan enhancement or new functionality, please cover that code with as much unit\ntest coverage as possible.\n\nIn the PR description, write down what that PR adds to the source code - does it\nfix a bug, does it add some functionality and if so, what does it add. If you're\nfixing an issue, it would be nice to reference it, so it may be closed once\nthe PR is accepted and merged.\n\nPRs with malicious intent would not be accepted and will be closed.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatemago%2Fprocessagent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnatemago%2Fprocessagent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatemago%2Fprocessagent/lists"}