A terminal coding harness. You open lunar
and code.
Simple and fast like Pi <3, but using Lua for extensions.
Lunar gives the model four tools—read
, write
, edit
, and bash
—without imposing a workflow.
brew install --HEAD gszr/taps/lunar
Or with Cargo:
cargo install --git https://github.com/gszr/lunar
With no ~/.lunar/init.lua
, set an API key, an OpenAI Chat Completions base URL, and a model:
export LUNAR_API_KEY=...
export LUNAR_BASE_URL=https://api.x.ai/v1
export LUNAR_MODEL=grok-4.6
Any OpenAI Chat Completions-compatible endpoint should work.
For lasting configuration, create ~/.lunar/init.lua
. From Lunar, /config
opens this file with $VISUAL
or $EDITOR
, then reloads it when the editor exits. Read the key from the environment:
lunar.models {
grok46 = {
id = "grok-4.6",
window = 500000,
},
}
lunar.providers {
xai = {
base_url = "https://api.x.ai/v1",
key_name = "XAI_API_KEY",
models = {
"grok46"
},
},
}
lunar.defaults {
provider = "xai",
model = "grok46",
}
export XAI_API_KEY=...
Or let Lunar store the credential. Use /login
in the TUI (xAI subscription via device code, or a masked API key). /logout
removes it.
lunar.models {
grok46 = {
id = "grok-4.6",
window = 500000,
},
}
lunar.providers {
xai = {
base_url = "https://api.x.ai/v1",
key_in = "auth",
auth_provider = "xai",
models = {
"grok46"
},
},
}
lunar.defaults {
provider = "xai",
model = "grok46",
}
lunar
Type a prompt and press Enter. Run /help
to see the available commands. Use /config
to edit and reload init.lua
, or lunar -c
to continue the latest mission for the current directory.
Lunar includes AGENTS.md
, CONTEXT.md
, and summaries from .agents/skills/*/SKILL.md
in its context.
Lua extensions are planned. For example, you will be able to replace local bash
with execution in a Runta runtime:
-- Planned API; not implemented yet.
lunar.tools.bash = function(cmd)
local runtime = os.getenv("LUNAR_RUNTIME") or "demo"
return lunar.sh { "runta", "exec", runtime, "--", "sh", "-lc", cmd }
end
Lunar is early software for macOS and Linux. It currently supports OpenAI Chat Completions endpoints. Lua extensions and the Responses API are not implemented yet.