lgh
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| resources | {
"subscribe": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| lgh_addA | Register a local Git repository with the LGH local server. Creates a bare repository under the LGH repos dir and adds an "lgh" remote pointing at it to the source repo. Initializes a git repo first if the directory is not one yet; refuses with an error if the path does not exist, the name is already registered, or a bare repo already exists at the target path. Returns the repository name and its clone URL. Use lgh_up to push subsequent commits and lgh_remove to unregister. |
| lgh_cloneA | Clone a repository from the LGH local server into a new working directory on this machine — the restore side of the backup loop and the inverse of lgh_up. Use it to recover a working copy after data loss or to materialize an existing backup on a new machine: find the exact registered name with lgh_list, make sure the server is up (lgh_status, otherwise lgh_serve_start), then clone. The name may carry a .git suffix. Refuses with a clear error when the name is not registered, the server is not running, or the destination directory already exists and is not empty — it never overwrites existing files. Returns JSON with name, clone_url, destination (absolute path), and the checked-out branch and HEAD commit. |
| lgh_diffA | Show uncommitted changes in a Git working directory: runs git diff --stat for a per-file summary plus the full unified diff, and returns JSON with has_changes, stat, diff, truncated, and staged. The full diff is truncated at 32KB to protect the caller's context. Refuses with an error when the path is not inside a git work tree. Use this to review patch content before lgh_save or lgh_up; use lgh_up_dryrun instead when you only need the changed-file list, trash detection, and LGH registration state. |
| lgh_listA | List every Git repository registered with the LGH local server, each with its name, source_path (local working dir), bare_path, clone_url (LGH server URL), and created_at. Reads only the local registry under ~/.localgithub; no network access. Use it to discover the clone_url of an existing backup or the exact registered name required by lgh_remove. Returns a JSON array, empty when nothing is registered. |
| lgh_logA | Read the LGH server's runtime log from ~/.localgithub/logs/server.jsonl and return the most recent entries as a JSON array of {ts, level, msg, component} objects (an empty array if no log file exists yet). A level filter keeps only entries at exactly that severity, so level=ERROR surfaces just the failures. Use this to investigate why a push or the server misbehaved in the past: lgh_status only shows the current health snapshot, while lgh_log shows the history that led to it. |
| lgh_removeA | Unregister a repository from LGH. Deletes the bare backup repository from the LGH repos dir and removes the "lgh" remote from the local working directory; the local working tree and its git history are never touched. Fails with an error if the name is not registered. Destructive: the LGH-side backup copy and its history are permanently deleted and only come back by re-registering (lgh_add) and pushing again (lgh_up). Use lgh_list first to find the exact registered name. |
| lgh_rollbackA | Roll the repository back N commits by running git reset --hard HEAD~N. Destructive: uncommitted changes and the rolled-back commits are discarded from the local branch, so run lgh_up or lgh_save first if anything there is worth keeping. With push enabled it also force-pushes the reset state to the LGH server so the backup matches; without push only the local branch moves. Returns JSON with from_commit, to_commit, rolled_back (the discarded commit's subject), and push success. Use lgh_diff or lgh_up_dryrun to inspect what would be lost before rolling back. |
| lgh_saveA | Create a local checkpoint: ensures a .gitignore exists, then git add + git commit in the working directory WITHOUT pushing anywhere — nothing is synced to the LGH server or any other remote. Initializes git if the directory is not a repo yet, and aborts when trash detection finds blocking issues. Use this for intermediate saves; switch to lgh_up when the work should also reach the LGH backup. Returns JSON with success and a human-readable output line ("Nothing to commit, working tree clean" when there are no changes). |
| lgh_serve_startA | Start the LGH HTTP server in the background by spawning "lgh serve --daemon" from the current binary. The server hosts the git endpoints that repos push to, so start it before lgh_up or before cloning from LGH. Returns the daemon's startup output, or an error with that output if the server cannot start (for example the port is already taken). Check lgh_status afterwards to confirm the PID and listen address. |
| lgh_serve_stopA | Stop the background LGH HTTP server by shutting down its PID. Registered repositories and local commits are unaffected; pushes simply fail until the server is restarted with lgh_serve_start. Returns a friendly notice instead of an error when the server is not running, so it is safe to call speculatively as a cleanup step. Takes no arguments; use lgh_status to check state first if you want to avoid a no-op call. |
| lgh_statusA | Get a unified health snapshot of the LGH server and the ActionD daemon. Aggregates LGH running state, PID, listen address, registered repo count, repos dir, and read-only flag, plus the ActionD daemon's running state and PID (probed via its PID file). Takes no arguments and reads only local state, so it is safe to call at any time. Use this to answer "is LGH up?"; use lgh_log when you need the historical runtime events that led to the current state. Returns pretty-printed JSON with top-level "lgh" and "actiond" objects. |
| lgh_upA | One-click backup: ensures a .gitignore exists, then git add + git commit + git push to the LGH local server (localhost, NOT GitHub/GitLab). Auto-registers the repo with LGH and initializes git if needed, so it also works on a fresh directory. Aborts with an error when trash detection finds blocking issues (large files, .env secrets) unless force is set. If ActionD is running, the result includes event_id and triggered_job_ids for the CI jobs spawned by this push; use the ActionD server's dev_cycle_run tool when you need full job tracing. Returns JSON with success, output, project_type, commit, and optional triggered_job_ids. |
| lgh_up_dryrunA | Dry-run preview of lgh_up without touching any state: nothing is committed, pushed, registered, or written. Reports whether the directory is a git repo, the pending changed files, LGH registration status (or the name it would auto-register as), and trash-detection results including whether lgh_up would fail and why. Call this before lgh_up whenever you are unsure what a backup would include; use lgh_diff when you want the actual patch content instead of the changed-file list. Returns a JSON object with dry_run=true. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| LGH Configuration | Current LGH configuration settings |
| Repository List | List of all repositories registered with LGH |
| Server Status | Current LGH server status |
TDQS
Scored across 13 tools
Most tools target distinct actions and descriptions explicitly cross-reference siblings (e.g. lgh_save vs lgh_up, lgh_diff vs lgh_up_dryrun, lgh_status vs lgh_log), so selection is clear. Minor overlap remains: lgh_up auto-registers, duplicating lgh_add, and lgh_up vs lgh_save differ only in whether a push happens.
Every tool shares the lgh_ prefix and uses snake_case, giving a predictable scheme. A few break the verb-first pattern (lgh_serve_start/lgh_serve_stop place the object first, lgh_up_dryrun appends a modifier), a small deviation but still readable.
13 tools is well-scoped for a git backup/server-management server. Each tool maps to a distinct lifecycle step (server control, registration, checkpoint/backup, inspection, recovery) and none feels redundant.
The surface covers the full loop: server start/stop/status, add/remove/list/clone, save/up/up_dryrun, diff, rollback, and log inspection. Minor gaps exist around pulling/fetching into an existing tree and branch/tag management, but core backup and restore workflows are covered.