You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Automation: JSON output, a Python API and a GitHub Action for self-hosted runners #48
lcode -p prints text for humans. Scripts, CI and other tools need structured results. Teams also want lcode to work on issues and pull requests using their own GPU machines.
Proposal
Structured output:lcode -p "…" --output json | stream-json returns the final answer, tool calls, files changed, token usage and exit status. --max-steps and --allowed-tools limit a run.
A Python API:from lcode import Session lets a program run requests and read the results.
A GitHub Action for self-hosted runners with a GPU and Ollama:
It answers @lcode in issues and pull requests.
It proposes changes as a pull request and reviews diffs.
No code leaves the runner.
Acceptance criteria
--output json and stream-json, with a documented schema
A Python API with an example
An Action that works on a self-hosted runner (example workflow in the docs)
lcode -p "…" --output json | stream-json, with --max-steps and --allowed-tools.
from lcode import Session, with an example in examples/api/fix_tests.py.
uses: nasser1941/lcode@v0.18.0 for self-hosted runners: it answers @lcode and can review pull requests.
Tested with Qwen3.6 35B through Ollama, also from the PyPI build:
--output json: fixed the bugs and reported calc.py changed, with the usage.
--output stream-json --max-steps 3: the expected events, and exit code 3.
The Python example: it approved only the test command; done in 5 model requests.
lcode action on a simulated @lcode issue comment, against a stand-in GitHub API and a bare remote.
lcode reacted to the comment and ran the tests (allow-commands), then pushed a branch with the fix as lcode.
It opened a pull request that closes the issue and replied with a summary.
Earlier versions had the model try to commit and then say so. Now git is denied to the model and the reply is written after the change is proposed.
Not yet tried on a real GitHub self-hosted runner: that needs a runner registered to a repository. Reports from anyone who sets it up are welcome here.
Activity
nasser1941 commentedon Oct 5, 2026
Shipped in 0.18.0 (#81). See Automation.
lcode -p "…" --output json | stream-json, with--max-stepsand--allowed-tools.from lcode import Session, with an example inexamples/api/fix_tests.py.uses: nasser1941/lcode@v0.18.0for self-hosted runners: it answers@lcodeand can review pull requests.Tested with Qwen3.6 35B through Ollama, also from the PyPI build:
--output json: fixed the bugs and reportedcalc.pychanged, with the usage.--output stream-json --max-steps 3: the expected events, and exit code 3.lcode actionon a simulated@lcodeissue comment, against a stand-in GitHub API and a bare remote.allow-commands), then pushed a branch with the fix aslcode.Not yet tried on a real GitHub self-hosted runner: that needs a runner registered to a repository. Reports from anyone who sets it up are welcome here.