Model or dataset
zhnt/loushang avatar
zhnt/loushang

Loushang installs nine console scripts, has no make install target, and scrubs nineteen provider keys before its tests

AI-native agent harness for coding workflows by python: multi-model LLM orchestration, stateful sessions, tool governance, traceable delivery, and provider routing for GPT, Claude, DeepSeek, Qwen, Kimi, GLM, and MiniMax.

2,104 stars326 forksPythonApache-2.0

At a glance

What is it?
Loushang is a Python agent harness for coding work whose stable surface is a single CLI called loushang code. Its packaging tells a longer story than the page does: nine console entry points, a wrapper script that runs every test, an offline environment that unsets provider credentials by name, and a tree that ships backup, spikes and a Codex directory.
Who is it for?
Loushang is a credible choice for someone who wants a coding agent with sessions, tool policy and a method layer rather than a single prompt loop, and the packaging shows the work has been done at the level of entry points, markers and credential isolation. Two things to settle first.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • zhnt/loushang2,104 ★ · +680
Star history
Repository2026-09-122026-11-22
zhnt/loushang1.4k2.1k

680 Stars in the last 71 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Nine console entry points ship, the page names one

The page introduces a single command, `loushang code`, as a coding focused CLI and terminal workbench, and everything else on it is described through that lens. The packaging file registers nine. Alongside loushang itself there are loushang-tui, loushang-hosted, loushang-hosted-tui, loushang-mux and loushang-plugin, then two that are plainly maintenance operations rather than product surfaces, loushang-package-cutover and loushang-package-gc, and one with no prefix at all, lmux, which sits in the same namespace as every other entry point with no indication on the page of what it multiplexes. The naming also encodes the architecture: the hosted pair and the muxes suggest a client and a host that can be separated, which is consistent with the tree carrying hosted, mux and lmux modules under the coding CLI package. The one-line summary that accompanies the project names GPT, Claude, DeepSeek, Qwen, Kimi, GLM and MiniMax as routing targets, and the body of the page names none of them. Every entry point resolves into the loushang package, with the coding CLI owning four of them and the plugin subsystem one more, so the split between product surface and plumbing is visible in the module paths alone. Two of the nine read as retirement tooling rather than runtime: a cutover command and a garbage collection command, both pointed at packages, which is the shape you would expect from a project that installs itself into environments it does not own.

The Makefile has no install target and says so plainly

The quick start is nine commands run from source: clone the repository, create a virtual environment with `uv venv .venv`, activate it, install the project in editable mode with `uv pip install -e ".[dev]"`, then probe the CLI with `--help`, `--list-models` and `--list-commands` before sending a first prompt with `-p`. The next paragraph handles the expected reflex directly. There is no `make install` target, and the page names the two that exist instead: `make bootstrap`, which creates `.venv/` with uv and installs the project in editable development mode, and `make install-binary` for a local binary install. A spec file at the repository root, named loushang.spec, is what the binary path builds. So there are three ways in, and the one almost everybody tries first does not exist. Development work is expected to happen inside the project virtual environment in `.venv/`, which is stated as a rule rather than left to the tooling. The editable install is what makes the harness and TUI modules under src/ importable during development, and the dev extra adds pytest, pytest-cov, ruff and mypy, so a contributor gets linting, type checking and coverage from the same command that installs the project.

Nineteen credential variables are unset before any test runs

The Makefile defines one variable whose only purpose is subtraction. `AI_OFFLINE_ENV` is a single `env -u` chain that removes nineteen variables from the environment before the suite runs, and the list is the clearest statement of which providers the project talks to:

make
AI_OFFLINE_ENV := env -u ANTHROPIC_API_KEY -u ANTHROPIC_AUTH_TOKEN -u ANTHROPIC_OAUTH_TOKEN -u ANTHROPIC_BASE_URL -u ARK_API_KEY -u BAIDU_QIANFAN_API_KEY -u COPILOT_GITHUB_TOKEN -u DASHSCOPE_API_KEY -u DEEPSEEK_API_KEY -u GH_TOKEN -u GITHUB_TOKEN -u HUNYUAN_API_KEY -u MINIMAX_API_KEY -u MOONSHOT_API_KEY -u OPENAI_API_KEY -u QIANFAN_API_KEY -u STEPFUN_API_KEY -u STEP_API_KEY -u ZAI_API_KEY

Anthropic appears three times over, with an auth token, an OAuth token and a base URL, which suggests more than one way to authenticate against it. GitHub's two token variables are in the list too, so a test run cannot quietly reach the network through repository access either. Worth noting where the variable sits: it is defined once, outside the platform branch, so the Windows branch of the same file, which switches to `.exe`, `del /Q` and `$(USERPROFILE)/bin`, still inherits a command written in the POSIX `env -u` form.

Every test goes through a wrapper script, not plain pytest

The Makefile does not call pytest directly. `PYTEST_RUNNER := python scripts/dev/run_pytest.py` means the suite is entered through a script in the repository's own dev directory, so whatever that wrapper does to selection, ordering or environment applies to every invocation. The pytest configuration in pyproject.toml shows what the wrapper is working with: pythonpath is set to src, testpaths to tests, and addopts forces `--import-mode=importlib`, which lets test modules share names without package juggling. Two settings are about leaving nothing behind, with `tmp_path_retention_count` at 0 and a retention policy of none, so a failing run does not keep its temporary directories. The markers are the part worth reading before you run anything, since they are a map of what the project knows is hard. A `live` marker covers real provider verification that may need network access and credentials, a `requires_host_runtime` marker covers host loopback, process and file index work, and the tui markers cover render contract, structural performance, and terminal operation, including native POSIX PTY or Windows ConPTY driver conformance.

wcwidth is pinned exactly and cryptography only on Intel Macs

The dependency list is short and mostly bounded from above, which is a deliberate shape for a project that has to install on somebody else's machine.

toml
dependencies = [
  "anthropic>=0.89.0",
  "authlib>=1.6,<2",
  "cryptography<49; sys_platform == 'darwin' and platform_machine == 'x86_64'",
  "httpx>=0.28,<1",
  "markdown-it-py>=4.2,<5",
  "openai>=2.30.0",
  "packaging>=24,<27",
  "pillow>=12.2.0",
  "pygments>=2.19,<3",
  "wcwidth==0.8.2",
]

Two entries stand out. wcwidth is pinned to one exact version with no range at all, which is the correct treatment for a table that decides where a wide character lands on a terminal and which is also the kind of pin that turns into a resolution failure the day a new version lands. The cryptography cap carries an environment marker and applies only when the platform is Darwin and the machine is x86_64, so Intel Macs are held below 49 while every other platform, including Apple silicon, is free to install whatever satisfies the resolver. pillow and pygments are here for a terminal rather than a web page: the tree carries clipboard image handling and a TUI that renders markdown, which is what those two are for.

Eight terms are defined in a single sentence

One paragraph sets the vocabulary, and it does it by assigning one role to each of eight words. Method is the work contract, work is the runtime fact, agent is the execution kernel, ai is the model access layer, harness is the cross product substrate, coding is the V1 product surface, tui is the terminal presentation, and channel is the boundary protocol. The list is joined by a dash at the end, after which the sentence claims all of it together organises complex knowledge work into something runnable, recoverable, verifiable and evolvable. Later sections then reuse the same words as headings: method, session, tool, extension and model provider each get a one line definition of their own. The definitions are consistent with the packaging, since the harness and tui modules the Makefile wires into its shared source list are the same two the paragraph assigns a job. The method layer is the part with the least machinery behind it on the page, defined as a structured work contract for a class of work, with method guided coding turns and reusable workflow assets as its user visible form.

backup, spikes and .codex are in the shipped tree

The root directory listing holds more than a source tree needs. There is `backup/`, which has no counterpart anywhere on the page. There is `spikes/`, the usual name for throwaway experiments kept beside the real code rather than deleted after they have answered their question. There is `.codex/`, which fits the acknowledgements, where the project says it learns from public design and engineering patterns in projects including OpenAI Codex, pi, python-prompt-toolkit, browser-use, Kimi CLI, superpowers, gstack, openclaw and hermes-agent, and adds that these are references and inspiration, and that unless a file is listed in THIRD_PARTY_NOTICES.md the repository neither includes nor redistributes their code. `scenarios/` and `scripts/` sit alongside, and the packaging declares LICENSE, NOTICE and THIRD_PARTY_NOTICES.md together as license files, so the notices file is treated as part of the license surface rather than as documentation. Under examples/, the page links coding and ai, while agent, auth, harness and tui directories exist unlinked.

Editorial conclusion

Loushang is a credible choice for someone who wants a coding agent with sessions, tool policy and a method layer rather than a single prompt loop, and the packaging shows the work has been done at the level of entry points, markers and credential isolation. Two things to settle first. The stable surface is one command; the other eight console scripts exist without being described, so budget time to read their entry modules before depending on any of them. And there is no make install, which means every install path is a from-source path with uv, on a Makefile whose Windows branch and POSIX test environment sit side by side. If you need provider routing across GPT, Claude, DeepSeek, Qwen, Kimi, GLM and MiniMax, verify the model catalog yourself, since the page documents none of those names and only `loushang --list-models` will tell you what is registered.

Frequently asked questions

How do you install zhnt/loushang for local development?

From source with uv: clone the repository, run `uv venv .venv`, activate it, then install the project in editable mode with `uv pip install -e ".[dev]"`. The Makefile shortcut is `make bootstrap`, and development is expected to happen inside that project virtual environment.

Does the Loushang Makefile provide a make install target?

No. The README states the Makefile does not currently provide a make install target, and points at make bootstrap for local development or make install-binary for a local binary install.

Which Python version does Loushang require?

pyproject.toml sets requires-python to >=3.11, and the repository carries a .python-version file at its root. The build backend is setuptools with version taken from the project file itself, at 0.1.0.

How many console commands does the loushang package install?

Nine: loushang, loushang-tui, loushang-hosted, loushang-hosted-tui, loushang-mux, lmux, loushang-plugin, loushang-package-cutover and loushang-package-gc.

How does Loushang keep its tests away from live provider credentials?

The Makefile builds an environment that unsets nineteen credential variables, including Anthropic keys and tokens, OpenAI, DeepSeek, DashScope, MiniMax, Moonshot, Hunyuan, StepFun, ZAI, Ark and Baidu Qianfan keys, plus GH_TOKEN and GITHUB_TOKEN, before the suite runs.

How are the Loushang tests executed?

Through `python scripts/dev/run_pytest.py`, declared as PYTEST_RUNNER in the Makefile. pytest is configured with pythonpath set to src, testpaths set to tests, importlib import mode, and markers for live provider verification, host runtime work and TUI render and terminal contracts.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. README
  4. zhnt/loushang on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/zhnt-loushang.svg)](https://hysenlabs.com/projects/zhnt-loushang)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/zhnt-loushang.svg)](https://hysenlabs.com/projects/zhnt-loushang)

Was this useful?