Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,36 @@ lmstudio` (or `llama.cpp`, `vllm`, `mlx`). See [Other model servers](servers.md)
Use [WSL2](https://learn.microsoft.com/windows/wsl/install) with Ubuntu and follow the Ubuntu
steps. NVIDIA GPUs work inside WSL2 with the regular Windows driver.

## Upgrade and uninstall
## Updating

```bash
uv tool upgrade lcode-cli # upgrade (pipx: pipx upgrade lcode-cli; Homebrew: brew upgrade lcode)
uv tool uninstall lcode-cli # remove lcode (Homebrew: brew uninstall lcode)
lcode update # update lcode, and Ollama if it runs in Docker
lcode update --check # only show which versions are out
```

- **lcode** updates the way you installed it: `uv tool upgrade`, `pipx upgrade`, `brew upgrade`
or `pip`. If it runs from a git checkout, `git pull` (on `main`, without local changes).
- **Ollama in a Docker container** is updated to the newest release on Docker Hub. lcode looks
that up instead of trusting a local `latest` tag, which can be months old, and skips release
candidates. It pulls the version's own tag, such as `ollama/ollama:0.35.1`, so `docker ps` shows
which version runs. A ROCm image stays ROCm.
- **A container from Docker Compose:** lcode changes the `image:` line in its compose file and
runs `docker compose up -d` for that service, so Compose keeps managing it.
- **Any other container** is recreated with the same name, ports, volumes, environment, GPUs,
network and restart policy. The old one is kept until the new one answers with the new
version, and is put back if it doesn't.
- Your models stay: they're in the container's volume.
- **Ollama installed without Docker** gets the command that updates it: on Linux,
`curl -fsSL https://ollama.com/install.sh | sh`; on macOS, `brew upgrade ollama` or the app
itself.

lcode shows what it will do and asks first. `lcode update lcode` or `lcode update ollama` updates
only one; `-y` doesn't ask.

## Uninstall

```bash
uv tool uninstall lcode-cli # remove lcode (pipx: pipx uninstall lcode-cli; Homebrew: brew uninstall lcode)
rm -rf ~/.config/lcode ~/.local/state/lcode # remove settings and saved sessions
ollama rm lcode-qwen3.6-35b qwen3.6:35b-a3b-coding # remove downloaded models
```
1 change: 1 addition & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ lcode config [set|unset] # show or change settings
lcode bench [models] # score models on small coding tasks on this machine
lcode mcp [catalog|add|list] # connect MCP servers: Jira, GitHub, AWS, databases… (see MCP servers)
lcode acp # run inside an editor over the Agent Client Protocol (see Editors)
lcode update [--check] # update lcode, and Ollama when it runs in Docker (see Installation)
```

| Option | Meaning |
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ ignore = [
"src/lcode/gitflow.py" = ["E501"]
"src/lcode/action.py" = ["E501"]
"src/lcode/acp.py" = ["E501"]
"src/lcode/update.py" = ["E501"]

[tool.pytest.ini_options]
testpaths = ["tests"]
Expand Down
18 changes: 17 additions & 1 deletion src/lcode/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ def build_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(
prog="lcode",
description="A local-first terminal coding agent powered by open-weight models via Ollama.",
epilog="Subcommands: lcode setup | models | doctor | config | bench | mcp | index "
epilog="Subcommands: lcode setup | models | doctor | config | bench | mcp | index | update "
"(lcode <subcommand> --help). "
"Docs: https://nasser1941.github.io/lcode/",
)
Expand Down Expand Up @@ -774,6 +774,15 @@ def build_subparsers() -> dict[str, argparse.ArgumentParser]:
from lcode.mcp.commands import build_parser as mcp_parser

subs["mcp"] = mcp_parser()
p = argparse.ArgumentParser(
prog="lcode update",
description="Update lcode, and Ollama when it runs in Docker (to the newest version on Docker Hub, pinned "
"to its version tag).",
)
p.add_argument("what", nargs="?", choices=["lcode", "ollama"], help="only this one (default: both)")
p.add_argument("--check", action="store_true", help="only show which versions are out")
p.add_argument("-y", "--yes", action="store_true", help="don't ask before updating")
subs["update"] = p
subs["acp"] = argparse.ArgumentParser(
prog="lcode acp",
description="Run as the agent inside an editor, over the Agent Client Protocol on stdin and stdout "
Expand All @@ -787,6 +796,12 @@ def build_subparsers() -> dict[str, argparse.ArgumentParser]:
return subs


def cmd_update(args) -> None:
from lcode import update

sys.exit(update.command(console, args.what or "", check=args.check, yes=args.yes))


def cmd_acp(args) -> None:
from lcode import acp

Expand Down Expand Up @@ -863,6 +878,7 @@ def cmd_mcp(args) -> None:
"index": cmd_index,
"action": cmd_action,
"acp": cmd_acp,
"update": cmd_update,
}


Expand Down
Loading
Loading