{"id":18610462,"url":"https://github.com/neilotoole/shelleditor","last_synced_at":"2026-04-20T13:05:24.966Z","repository":{"id":154011471,"uuid":"631289937","full_name":"neilotoole/shelleditor","owner":"neilotoole","description":"Invoke the shell EDITOR like 'kubectl edit' does","archived":false,"fork":false,"pushed_at":"2023-09-24T19:31:17.000Z","size":88,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-27T01:41:29.695Z","etag":null,"topics":["editor","go","golang","kubectl","nano","shell","textpad","vi","vim"],"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/neilotoole.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}},"created_at":"2023-04-22T14:52:11.000Z","updated_at":"2024-10-07T21:12:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"c0afcb16-2711-4eda-899e-2f0be9c12c56","html_url":"https://github.com/neilotoole/shelleditor","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neilotoole%2Fshelleditor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neilotoole%2Fshelleditor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neilotoole%2Fshelleditor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neilotoole%2Fshelleditor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neilotoole","download_url":"https://codeload.github.com/neilotoole/shelleditor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239400606,"owners_count":19632051,"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":["editor","go","golang","kubectl","nano","shell","textpad","vi","vim"],"created_at":"2024-11-07T03:10:06.577Z","updated_at":"2025-11-02T21:30:23.325Z","avatar_url":"https://github.com/neilotoole.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shelleditor\nInvoke the shell `EDITOR` like `kubectl edit` does.\n\nThis code is lifted from [kubectl](https://github.com/kubernetes/kubectl/tree/master/pkg/cmd/util/editor).\nThanks lads. \n\nWhy not import the `kubectl` code directly? It has tons of dependencies that are not needed\nfor this simple task. The codebase has been edited to import fewer packages,\nand those that are imported are mostly copied to the `/pkg` dir.\n\n## Usage\n\nImport via the normal mechanism.\n\n```shell\ngo get -u github.com/neilotoole/shelleditor\n```\n\nNote that because `shellescape` supports the stdlib `slog` logger,\nso it requires Go 1.21 or greater.\n\n\n## Example program\n\nThere's an example program in [`cmd/shelleditor`](https://github.com/neilotoole/shelleditor/blob/master/cmd/shelleditor/main.go).\n\n```shell\n$ go install github.com/neilotoole/shelleditor/cmd/shelleditor\n$ shelleditor hello.txt\n```\n\nIt's very simple:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log/slog\"\n\t\"os\"\n\n\t\"github.com/neilotoole/shelleditor\"\n)\n\nfunc main() {\n\tif len(os.Args) != 2 {\n\t\tfmt.Fprintln(os.Stderr, \"Usage: shelleditor PATH\")\n\t\tos.Exit(1)\n\t}\n\n\t// Set logger... you can usually ignore this. When not\n\t// set, log output is discarded.\n\tshelleditor.SetLogger(slog.Default())\n\n\ted := shelleditor.NewDefaultEditor(\"EDITOR\")\n\tif err := ed.Launch(os.Args[1]); err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"error: %v\\n\", err)\n\t\tos.Exit(1)\n\t}\n}\n```\n\n## Alternatives\n\n- [th/go-editor](https://github.com/tj/go-editor)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneilotoole%2Fshelleditor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneilotoole%2Fshelleditor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneilotoole%2Fshelleditor/lists"}