Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.heylua.ai/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The lua git commands connect your agent project to git, so that Lua operations automatically commit a snapshot of your project. Optionally, each commit can also be pushed to a linked GitHub repository.
lua git connect      # enable auto-commits for this project
lua git auth github  # link a GitHub account
lua git status       # show the current git integration state
Git integration is opt-in and per-project. Until you run lua git connect, Lua never touches your git repository.

What Auto-Commit Does

Once enabled, these commands commit your project automatically after they succeed:
CommandCommitsAlso tags
lua push
lua version createlua/v<N>
lua version promote
lua version delete
lua pull
Auto-commit is non-blocking: if a commit can’t be made, the Lua command still succeeds and prints a short warning.

Enabling Auto-Commit

1

Prepare your repository

Auto-commit needs a git repository with an identity configured:
git init
git config user.name "Your Name"
git config user.email "[email protected]"
Lua never runs git init or git config for you — you stay in control of your repository.
2

Connect

lua git connect
This runs sanity checks (git installed, inside a repository, identity configured) and, on success, records the setting in lua.skill.yaml.

Pushing to GitHub

To also push each auto-commit to GitHub, link a GitHub account and enable auto-push.
1

Link your GitHub account

lua git auth github
A code is shown in your terminal; open github.com/login/device, enter the code, and authorize Lua. The token is stored locally under ~/.lua-cli/.
Open https://github.com/login/device and enter the code: WDJB-MJHT
✓ Logged in to GitHub as @your-username.
2

Add a GitHub remote

Auto-push targets your origin remote, which must be a GitHub HTTPS URL:
git remote add origin https://github.com/<owner>/<repo>.git
3

Enable auto-push

lua git connect --auto-push
This verifies that a GitHub account is linked and that origin is a GitHub HTTPS remote before enabling auto-push — so you find out about a missing link or remote immediately, not on your next lua push.
After this, every auto-commit is followed by a push to your GitHub repository. Auto-push is non-blocking: if a push fails (revoked token, network issue, etc.), the commit is kept locally and you can run git push manually.

Commands

lua git connect

Enable auto-commits for the current project.
FlagDescription
--auto-pushAlso enable auto-push to the linked GitHub remote (requires lua git auth github and a GitHub HTTPS origin).

lua git disconnect

Disable auto-commits. Existing commits and tags in your repository are left untouched.

lua git status

Show the current integration state: whether it’s enabled, your git identity, and the most recent Lua-issued commit and tag.

lua git auth github

Link a GitHub account using GitHub’s OAuth device flow (enter a code at github.com/login/device).
FlagDescription
--forceRe-link without the “already linked, re-link?” prompt.

lua git auth status

Show the linked GitHub username, granted scopes, and when it was linked.

lua git auth disconnect

Remove the locally stored GitHub token.

Configuration

The git block in lua.skill.yaml is managed by the CLI — use the commands above rather than editing it by hand, so the sanity checks always run:
git:
  enabled: true    # set by `lua git connect`
  autoPush: true   # set by `lua git connect --auto-push`

Troubleshooting

The project directory isn’t a git repository yet. Run git init (and set your user.name / user.email), then lua git connect.
Add a GitHub remote: git remote add origin https://github.com/<owner>/<repo>.git. Auto-push supports GitHub HTTPS remotes only.
Re-link your account with lua git auth github.