{"id":28003163,"url":"https://github.com/fnproject/hotwrap","last_synced_at":"2025-10-14T09:16:45.443Z","repository":{"id":68934062,"uuid":"138767976","full_name":"fnproject/hotwrap","owner":"fnproject","description":"Command wrapper that lets you run unix commands as functions ","archived":false,"fork":false,"pushed_at":"2019-02-12T20:04:13.000Z","size":172,"stargazers_count":22,"open_issues_count":2,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-10-14T09:16:41.568Z","etag":null,"topics":[],"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/fnproject.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-06-26T17:01:27.000Z","updated_at":"2023-09-01T11:52:08.000Z","dependencies_parsed_at":"2023-03-11T04:30:12.916Z","dependency_job_id":null,"html_url":"https://github.com/fnproject/hotwrap","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/fnproject/hotwrap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnproject%2Fhotwrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnproject%2Fhotwrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnproject%2Fhotwrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnproject%2Fhotwrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fnproject","download_url":"https://codeload.github.com/fnproject/hotwrap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnproject%2Fhotwrap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018501,"owners_count":26086383,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-05-09T01:59:19.675Z","updated_at":"2025-10-14T09:16:45.431Z","avatar_url":"https://github.com/fnproject.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fn HotWrap\n\nHotWrap is a beta tool that lets you create Fn functions based on conventional unix command line tools  (like shell commands or anything else you can invoke in a terminal) while also taking advantage of Fn's streaming event model inside your container.\n \n\nHotWrap implements the Fn FDK contract via a command wrapper `hotwrap` this command wrapper then invokes a command for each event your function receives. \n\nHotWrap sends the body of incoming events to your command via STDIN and reads the response from STDOUT \n\n# Using HotWrap \n\nHotWrap works using Fn's existing docker support:  \n\n\nsuppose you have a Dockerfile for a command that works on the CLI: \n\n```\nFROM alpine:latest\n\n# just any old command \nCOMMAND /usr/bin/wc -l   \n\n```\n\n\n\nAdd HotWrap to your container as follows: \n\nDockerfile:\n```\n## Start of your normal docker file \nFROM alpine:latest\n\n# Install hotwrap binary in your container \nCOPY --from=fnproject/hotwrap:latest  /hotwrap /hotwrap \n\n# just any old command \nCMD /usr/bin/wc -l   \n\n# update entrypoint to use hotwrap, this will wrap your command \nENTRYPOINT [\"/hotwrap\"]\n```\n\nCreate a func.yaml as follows: \n```\nschema_version: 20180708\nname: example\nversion: 0.0.1\n```\n\nDeploy the function to an Fn server with app name `hotdemo`: \n\n```bash\nfn deploy --app hotdemo\n\n```\n\nInvoke the function: \n\n\n```bash\n\necho $'some\\nlines\\nof\\ntext' | fn invoke hotdemo example \n\n4\n```\n \nThe Input passed to the function will be passed on stdin and any output that the code returns on stdout will be returned as function output. \n\nAs with other functions anything sent to stderr will be passed to the functions logs. \n\nHotWrap is a portable  statically linked binary that should work in any linux container.  It invokes commands in a shell and requires at least \"/bin/sh\". \n \n \n # Accessing headers from function call \n \n You can receive invocation headers from function calls as environment variables. \n \n All incoming function headers are transposed into environment variables using the following rules: \n \n * Must start with Fn- (this includes http trigger/gateway headers (see below))\n * Capitalized \n * s/-/_/ \n * Disambiguated by taking the first matching value where multiple headers are present or two headers resolve to the same variable. \n \n\n For HTTP request headers and details received from triggers these are mapped as follows: \n \n * FN_HTTP_H_\u003cHeader Name\u003e \n * FN_HTTP_METHOD \n * FN_HTTP_REQUEST_URL\n \n e.g. for a call to a trigger: \n \n ```\n GET /my/trigger HTTP/1.1 \n My-Header: foo \n Accept: * \n Accept: application/xml \n\n```\n\nyour function will see the following environment: \n\n```\nFN_HTTP_METHOD=GET\nFN_HTTP_REQUEST_URL=http://tld.com/my/trigger\nFN_HTTP_H_MY_HEADER=foo\nFN_HTTP_H_ACCEPT=*\n\n``` \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffnproject%2Fhotwrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffnproject%2Fhotwrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffnproject%2Fhotwrap/lists"}