{"slug": "show-hn-lunar-a-coding-harness-extensible-via-lua", "title": "Show HN: Lunar, a coding harness extensible via Lua", "summary": "Lunar, a terminal coding harness extensible via Lua, has been released as an open-source tool on GitHub by developer gszr. It provides four tools—read, write, edit, and bash—and supports any OpenAI Chat Completions-compatible endpoint, including xAI's Grok-4.6 model. Lunar is early software for macOS and Linux, with Lua extensions and the Responses API planned but not yet implemented.", "body_md": "A terminal coding harness. You open `lunar`\n\nand code.\n\nSimple and fast like [Pi <3](https://github.com/earendil-works/pi), but using Lua for extensions.\n\nLunar gives the model four tools—`read`\n\n, `write`\n\n, `edit`\n\n, and `bash`\n\n—without imposing a workflow.\n\n```\nbrew install --HEAD gszr/taps/lunar\n```\n\nOr with Cargo:\n\n```\ncargo install --git https://github.com/gszr/lunar\n```\n\nWith no `~/.lunar/init.lua`\n\n, set an API key, an OpenAI Chat Completions base URL, and a model:\n\n```\nexport LUNAR_API_KEY=...\nexport LUNAR_BASE_URL=https://api.x.ai/v1\nexport LUNAR_MODEL=grok-4.6\n```\n\nAny OpenAI Chat Completions-compatible endpoint should work.\n\nFor lasting configuration, create `~/.lunar/init.lua`\n\n. From Lunar, `/config`\n\nopens this file with `$VISUAL`\n\nor `$EDITOR`\n\n, then reloads it when the editor exits. Read the key from the environment:\n\n```\nlunar.models {\n  grok46 = {\n    id = \"grok-4.6\",\n    window = 500000,\n  },\n}\n\nlunar.providers {\n  xai = {\n    base_url = \"https://api.x.ai/v1\",\n    key_name = \"XAI_API_KEY\",\n    models = {\n      \"grok46\"\n    },\n  },\n}\n\nlunar.defaults {\n  provider = \"xai\",\n  model = \"grok46\",\n}\nexport XAI_API_KEY=...\n```\n\nOr let Lunar store the credential. Use `/login`\n\nin the TUI (xAI subscription via device code, or a masked API key). `/logout`\n\nremoves it.\n\n```\nlunar.models {\n  grok46 = {\n    id = \"grok-4.6\",\n    window = 500000,\n  },\n}\n\nlunar.providers {\n  xai = {\n    base_url = \"https://api.x.ai/v1\",\n    key_in = \"auth\",\n    auth_provider = \"xai\",\n    models = {\n      \"grok46\"\n    },\n  },\n}\n\nlunar.defaults {\n  provider = \"xai\",\n  model = \"grok46\",\n}\nlunar\n```\n\nType a prompt and press Enter. Run `/help`\n\nto see the available commands. Use `/config`\n\nto edit and reload `init.lua`\n\n, or `lunar -c`\n\nto continue the latest mission for the current directory.\n\nLunar includes `AGENTS.md`\n\n, `CONTEXT.md`\n\n, and summaries from `.agents/skills/*/SKILL.md`\n\nin its context.\n\nLua extensions are planned. For example, you will be able to replace local `bash`\n\nwith execution in a [Runta](https://runta.ai) runtime:\n\n```\n-- Planned API; not implemented yet.\nlunar.tools.bash = function(cmd)\n  local runtime = os.getenv(\"LUNAR_RUNTIME\") or \"demo\"\n  return lunar.sh { \"runta\", \"exec\", runtime, \"--\", \"sh\", \"-lc\", cmd }\nend\n```\n\nLunar is early software for macOS and Linux. It currently supports OpenAI Chat Completions endpoints. Lua extensions and the Responses API are not implemented yet.", "url": "https://wpnews.pro/news/show-hn-lunar-a-coding-harness-extensible-via-lua", "canonical_source": "https://github.com/gszr/lunar", "published_at": "2026-08-21 11:07:19+00:00", "updated_at": "2026-08-21 11:16:04.177973+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "artificial-intelligence"], "entities": ["Lunar", "gszr", "OpenAI", "xAI", "Grok-4.6", "GitHub", "Runta"], "alternates": {"html": "https://wpnews.pro/news/show-hn-lunar-a-coding-harness-extensible-via-lua", "markdown": "https://wpnews.pro/news/show-hn-lunar-a-coding-harness-extensible-via-lua.md", "text": "https://wpnews.pro/news/show-hn-lunar-a-coding-harness-extensible-via-lua.txt", "jsonld": "https://wpnews.pro/news/show-hn-lunar-a-coding-harness-extensible-via-lua.jsonld"}}