{"id":17325024,"url":"https://github.com/otaviof/edsrv","last_synced_at":"2025-10-19T21:37:21.562Z","repository":{"id":206715051,"uuid":"717537601","full_name":"otaviof/edsrv","owner":"otaviof","description":"Browser extension backend service for textEditAid, textAidToo, withExEditor, and others","archived":false,"fork":false,"pushed_at":"2023-11-13T14:53:30.000Z","size":3276,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-01T09:41:43.411Z","etag":null,"topics":["browser-extension","server","text-editing"],"latest_commit_sha":null,"homepage":"","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/otaviof.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2023-11-11T19:11:34.000Z","updated_at":"2023-11-13T15:00:25.000Z","dependencies_parsed_at":"2023-11-11T20:23:35.691Z","dependency_job_id":"eda09dbf-6d2a-4814-9ba8-d8cec6791dd6","html_url":"https://github.com/otaviof/edsrv","commit_stats":null,"previous_names":["otaviof/edsrv"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otaviof%2Fedsrv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otaviof%2Fedsrv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otaviof%2Fedsrv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otaviof%2Fedsrv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/otaviof","download_url":"https://codeload.github.com/otaviof/edsrv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245781160,"owners_count":20671001,"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":["browser-extension","server","text-editing"],"created_at":"2024-10-15T14:12:14.357Z","updated_at":"2025-10-19T21:37:16.523Z","avatar_url":"https://github.com/otaviof.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca alt=\"CI\" href=\"https://github.com/otaviof/edsrv/actions\"\u003e\n        \u003cimg src=\"https://github.com/otaviof/edsrv/actions/workflows/test.yaml/badge.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca alt=\"project quality report\" href=\"https://goreportcard.com/report/github.com/otaviof/edsrv\"\u003e\n        \u003cimg src=\"https://goreportcard.com/badge/github.com/otaviof/edsrv\"\u003e\n    \u003c/a\u003e\n\t\u003ca alt=\"latest release\" href=\"https://github.com/otaviof/edsrv/releases/latest\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/github/v/release/otaviof/edsrv\"\u003e\n\t\u003c/a\u003e\n\u003c/p\u003e\n\n`edsrv`\n-------\n\nIs a \"edit server\" (`edsrv`) backend for browser extensions like [TextEditAid][textEditAid], [TextAidToo][textAidToo], [withExEditor][withExEditor] and possibly more supporting the same API.\n\n# Installation\n\nThe preferred installation method is using a pre-compiled executable available on [releases][repoReleases].\n\nAlternatively, use the [`Makefile`](./Makefile) target `install` to build and copy the `edsrv` executable to `/usr/local/bin` (`PREFIX`):\n\n```sh\nmake install\n```\n\nAnother supported approach is using `go install`:\n\n```sh\ngo install github.com/otaviof/edsrv/cmd/edsrv@latest\n```\n\n# Usage\n\nThe edit-server needs to run on the background in order to respond the text edit requests coming from your favorite browser extension.\n\nTo start the service run `edsrv start` with appropriate flags:\n\n```sh\nedsrv start --addr=\"127.0.0.1:8928\" --tmp-dir=\"${TMPDIR}\" --editor=\"${EDITOR}\"\n```\n\nThe subcommand `start` supports the following command-line flags:\n\n| Flag        | Default          | Description                                 |\n| :---------- | :--------------- | :------------------------------------------ |\n| `--addr`    | `127.0.0.1:8929` | Listen address, interface and port          |\n| `--tmp-dir` | `${TMPDIR}`      | Temporary directory to store edited payload |\n| `--editor`  | `${EDITOR}`      | Editor to edit the payload                  |\n\nBy default `edsrv start` uses the regular temporary directory configured on your shell (`${TMPDIR}`) and editor (`${EDITOR}`).\n\nOnce the edit-server is running, you can use the `status` subcommand to confirm the servier is running, and peek runtime configuration:\n\n```sh\nedsrv status\n```\n\n## macOS Service\n\nFor macOS users, consider the [`edsrv.plist` launchd service file](./contrib/edsrv.plist) details, adapt to your needs. To deploy the launchd based service, run:\n\n```sh\nmake deploy-launchd\n```\n\n# API\n\nThe edit-server API contains two only two endpoints, enabling users to edit the payload with the external editor, and check the service status.\n\n## `POST /` \n\nEdits the request body payload using the external editor (`--editor`).\n\nFirst, the body payload is stored on a new randomly named temporary file, under `--tmp-dir` directory. Then, the external editor (`--editor`) gets invoked blocking the request until completed. Once completed the response body carries the temporary file content and deletes it.\n\nThus, the `--editor` flag must be configured to wait until completed, like for instance `code -w`, `-w` implies the command line will *wait* until file is closed.\n\n## `GET /status`\n\nThe endpoint shows the configured editor and temporary directory, i.e.:\n\n```\n$ curl -s 127.0.0.1:8928/status\neditor='code -n -w', tmpDir='/tmp'\n```\n\nThe same output is shown on `edsrv status` subcommand.\n\n# Contributing\n\nTo know more details about the project automation please consider [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n[repoReleases]: https://github.com/otaviof/edsrv/releases\n[textAidToo]: https://chrome.google.com/webstore/detail/text-aid-too/klbcooigafjpbiahdjccmajnaehomajc\n[textEditAid]: https://chrome.google.com/webstore/detail/texteditaid/ppoadiihggafnhokfkpphojggcdigllp\n[withExEditor]: https://chrome.google.com/webstore/detail/withexeditor/koghhpkkcndhhclklnnnhcpkkplfkgoi\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotaviof%2Fedsrv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fotaviof%2Fedsrv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotaviof%2Fedsrv/lists"}