{"id":51672681,"url":"https://github.com/thurstonsand/ghosttykit.lua","last_synced_at":"2026-07-15T02:05:36.366Z","repository":{"id":366201811,"uuid":"1267032878","full_name":"thurstonsand/ghosttykit.lua","owner":"thurstonsand","description":"Generated Lua SDK mirror for GhosttyKit","archived":false,"fork":false,"pushed_at":"2026-06-20T17:24:26.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-20T19:13:02.216Z","etag":null,"topics":["ghostty","ghosttykit","lua","luarocks"],"latest_commit_sha":null,"homepage":"https://github.com/thurstonsand/ghosttykit","language":"Lua","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thurstonsand.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-12T06:53:23.000Z","updated_at":"2026-06-20T17:24:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/thurstonsand/ghosttykit.lua","commit_stats":null,"previous_names":["thurstonsand/ghosttykit.lua"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/thurstonsand/ghosttykit.lua","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thurstonsand%2Fghosttykit.lua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thurstonsand%2Fghosttykit.lua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thurstonsand%2Fghosttykit.lua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thurstonsand%2Fghosttykit.lua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thurstonsand","download_url":"https://codeload.github.com/thurstonsand/ghosttykit.lua/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thurstonsand%2Fghosttykit.lua/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35487009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-15T02:00:06.706Z","response_time":131,"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":["ghostty","ghosttykit","lua","luarocks"],"created_at":"2026-07-15T02:05:35.648Z","updated_at":"2026-07-15T02:05:36.358Z","avatar_url":"https://github.com/thurstonsand.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GhosttyKit Lua SDK\n\n`ghosttykit` is the Lua client library for talking to `ghosttykitd` and GhosttyKit bridge sockets. Use it from Neovim plugins, Lua scripts, or LuaRocks-based tools that need to control Ghostty through GhosttyKit.\n\n## Installation\n\nPublished package installation is coming next.\n\nThe SDK supports two runtimes:\n\n- Neovim: uses `vim.uv` and `vim.json`.\n- LuaJIT/LuaRocks: uses `luv` and `dkjson`.\n\n## Usage\n\nCreate a client and call GhosttyKit commands:\n\n```lua\nlocal ghosttykit = require(\"ghosttykit\")\n\nlocal client = ghosttykit.client()\nlocal status, err = client:doctor()\n\nif err then\n  error(tostring(err))\nend\n\nprint(status.healthy)\n```\n\nBy default, the client connects to the standard GhosttyKit socket. Pass `socket_path` to target another daemon or bridge socket:\n\n```lua\nlocal client = ghosttykit.client({\n  socket_path = \"/path/to/ghosttykit.sock\",\n})\n```\n\n## Commands\n\nCommands are grouped by domain. Terminal-scoped methods derive `tty` from `GTY_TTY`, then the process's controlling terminal, when it is omitted; pass `tty` explicitly to override it. Most methods return `value, err`; methods that only need acknowledgement return `ok, err` when `ack = true`, or send a notification without waiting when `ack` is omitted.\n\n```lua\nclient:doctor()\nclient.terminal:id({})\nclient.terminal:count({})\nclient.terminal:clear_cache({ ack = true })\nclient.key_table:activate({ name = \"nvim\", ack = true })\nclient.key_table:deactivate({ ack = true })\nclient.layout:focus({ direction = \"left\", ack = true })\nclient.layout:split({ direction = \"right\", cwd = vim.fn.getcwd(), focus = true, ack = true })\nclient.layout:resize({ direction = \"right\", pixels = 10, ack = true })\nclient.layout:zoom({ ack = true })\nclient.paste:get()\nclient.bridge:create({})\n```\n\nPaste handles can read text, read file contents, or save pasted content to disk:\n\n```lua\nlocal paste = assert(client.paste:get())\nlocal saved = assert(paste:save({ dir = \"/tmp/ghosttykit-paste\" }))\nprint(saved[1].path)\n```\n\n## Low-level protocol escape hatches\n\nRaw request builders are available through `ghosttykit.protocol`, and clients expose protocol reply modes through `client.raw`:\n\n```lua\nlocal request = ghosttykit.protocol.focus({ tty = \"/dev/ttys001\", direction = \"left\", ack = true })\nlocal reply, err = client.raw:call(request)\n\nlocal stream, stream_err = client.raw:stream(ghosttykit.protocol.paste())\nlocal held, hold_err = client.raw:hold(ghosttykit.protocol.bridge_lease(token))\n```\n\n## Errors\n\nErrors are returned as values, not thrown:\n\n```lua\nlocal ok, err = client.layout:focus({ direction = \"left\", ack = true })\nif not ok then\n  vim.notify(err.message or err.code, vim.log.levels.ERROR)\nend\n```\n\nEach error has:\n\n- `code`: protocol or transport error code.\n- `message`: optional human-readable detail.\n- `name`: stable error name for callers that prefer names over codes.\n\n## Development\n\nInstall the SDK from a local checkout:\n\n```sh\ncd sdk/lua\nluarocks make --tree ../../.luarocks --lua-version 5.1 ghosttykit-scm-1.rockspec\n```\n\nRun the development checks:\n\n```sh\njust install-deps\njust check\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthurstonsand%2Fghosttykit.lua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthurstonsand%2Fghosttykit.lua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthurstonsand%2Fghosttykit.lua/lists"}