packaging: bin/aish wrapper + examples/config.lua + LICENSE for v0.1.0 release

main.lua now resolves package.path relative to its own script directory
rather than cwd, so the packaged install at /usr/share/lua/5.1/aish/
finds its siblings regardless of where the user invokes aish from. Dev
mode (luajit main.lua from the repo root) is preserved: arg[0] is
"main.lua" with no "/" so the regex returns nil and _dir falls back to
"./" — identical to the previous behavior.

bin/aish is a POSIX-sh wrapper that execs luajit against $AISH_LIB/main.lua
(default /usr/share/lua/5.1/aish). The AISH_LIB env override lets users
point at a dev checkout without uninstalling the package. Wrapper emits
distinct errors when AISH_LIB is missing or when luajit isn't on PATH so
broken installs surface clearly instead of through a bare sh: not found.

examples/config.lua is the canonical commented reference, shipped at
/usr/share/doc/aish/examples/config.lua. Stripped of the two live MCP
bearer tokens carried by the in-tree config.lua and switched to the
auth_env env-var indirection form; mcp.servers entries are commented
out so a copy-to-~/.config/aish/config.lua produces a working starting
point on first uncomment. HOSSENFELDER URL flagged as maintainer-LAN.

LICENSE: MIT, copyright 2026 Markus Fritsche. README updated to match.

Sonnet review of the changeset (per feedback_reviews_use_sonnet.md +
bugfix-process step 4): no blockers; the two Important findings (USAGE
text still said "luajit main.lua", bin/aish didn't pre-check luajit)
and one Nit (unredacted HOSSENFELDER URL) were folded in before commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-25 00:21:55 +02:00
parent ff5a545404
commit 8fb5954bc5
5 changed files with 543 additions and 6 deletions
+10 -5
View File
@@ -2,16 +2,21 @@
-- Phase 0: arg parsing, config load, REPL start.
-- See docs/PHASE0.md §4, §10. -p one-shot mode lands per issue #4.
-- Make project modules and the vendored dkjson resolvable from the repo root.
-- Run aish with the repo root as cwd; PTY-relative resolution lands later.
package.path = "./?.lua;./vendor/?.lua;" .. package.path
-- Resolve modules + vendored dkjson relative to this script's directory,
-- not cwd. Packaged install puts main.lua at /usr/share/lua/5.1/aish/ and
-- the /usr/bin/aish wrapper execs `luajit /usr/share/lua/5.1/aish/main.lua`
-- from whatever cwd the user is in — siblings must still resolve. Dev mode
-- (`luajit main.lua` from repo root) keeps working because arg[0] is then
-- "main.lua" with no "/" — _dir falls back to "./".
local _dir = arg[0]:match("(.*/)") or "./"
package.path = _dir .. "?.lua;" .. _dir .. "vendor/?.lua;" .. package.path
local USAGE = [[
aish — AI-augmented conversational shell.
Usage:
luajit main.lua [--config <path>] [--help] -- interactive REPL
luajit main.lua -p "<prompt>" [--config <path>] -- one-shot, print + exit
aish [--config <path>] [--help] -- interactive REPL
aish -p "<prompt>" [--config <path>] -- one-shot, print + exit
In -p mode, if stdin is not a TTY it's read as additional context and
prepended to the prompt as a fenced block — composes with Unix pipes: