{"id":13513030,"url":"https://github.com/MarkMendell/cpwrap","last_synced_at":"2025-03-31T00:30:47.113Z","repository":{"id":213777029,"uuid":"591144640","full_name":"MarkMendell/cpwrap","owner":"MarkMendell","description":"get copilot suggestions for any interactive program (rlwrap for copilot)","archived":false,"fork":false,"pushed_at":"2023-02-05T18:17:56.000Z","size":14,"stargazers_count":22,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-01T15:37:35.870Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MarkMendell.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}},"created_at":"2023-01-20T02:30:53.000Z","updated_at":"2024-10-12T14:56:49.000Z","dependencies_parsed_at":"2023-12-23T03:00:55.003Z","dependency_job_id":null,"html_url":"https://github.com/MarkMendell/cpwrap","commit_stats":null,"previous_names":["markmendell/cpwrap"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarkMendell%2Fcpwrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarkMendell%2Fcpwrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarkMendell%2Fcpwrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarkMendell%2Fcpwrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarkMendell","download_url":"https://codeload.github.com/MarkMendell/cpwrap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246399816,"owners_count":20770907,"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":[],"created_at":"2024-08-01T04:00:36.649Z","updated_at":"2025-03-31T00:30:46.816Z","avatar_url":"https://github.com/MarkMendell.png","language":"C","readme":"# cpwrap: like rlwrap, but for copilot suggestions\n`cpwrap [arg ...]`  \nwraps the execution of whatever command you pass it. It sends the session transcript to [GitHub Copilot](https://github.com/features/copilot) (you must be subscribed) and shows suggestions you can accept by pressing tab, at which point it's just like you had typed that yourself into the command. There is no need for the wrapped program to know anything about copilot; `cpwrap` creates a new pseudo-terminal, so the wrapped program can't (and more importantly doesn't need to) tell the difference between what you typed and what you autocompleted.\n\nTab=accept, ESC=reject, F1=toggle on/off\n\nhttps://user-images.githubusercontent.com/6289391/213608944-41bc2ae1-5c50-4c49-b82b-c474c2ee1f55.mp4\n\n# Requirements\n* [`node`](https://nodejs.org/)\n* copilot `dist` folder somewhere on your system (like what comes with [copilot.vim](https://github.com/github/copilot.vim/tree/release/copilot/dist))\n\n`cpwrap` will look for the dist folder in:\n* `CPWRAPPATHDIST` environment variable\n* `~/.config/cpwrap/pathdist` file\n* `pathcopilotdist` global variable in `cpwrap.c`\n* extension locations for vim and neovim\n\nOtherwise, it will prompt for the location and then save that.\n\n# Is this allowed?\nI'm not sure; there are some other unofficial plugins. `cpwrap` tries to be a good citizen (identifying itself, giving notifications for show/accept/reject).\n\n# How does it work?\nCopilot thinks we are editing a file called `/tmp/shell_session.txt` whose contents are `$ arg ...\\n` followed by the transcript of the session.\n\n# Fun fact\nMy first pass at this used the [Codex API](https://openai.com/blog/openai-codex/), but it ended up being way too expensive. One interesting thing was that when you started a shell session, like `cpwrap sh`, the first suggestion _every time_ was `cat /etc/passwd`. I notice that when you use copilot in that situation, it doesn't say anything.\n","funding_links":[],"categories":["Cool Projects"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMarkMendell%2Fcpwrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMarkMendell%2Fcpwrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMarkMendell%2Fcpwrap/lists"}