Commands
install.py
Connects Lore to the agents on your machine, once. After it has run you do not need to operate Lore.
Synopsis
python3 install.py # detect Claude Code and Copilot CLI and set up what is found
python3 install.py --client claude # only Claude Code (or: copilot)
python3 install.py --approval manual # rules the agent proposes wait for you
python3 install.py --dry-run # show what would change, change nothing
python3 install.py --uninstall # remove what this script added
Options
| Option | Default | Meaning |
|---|---|---|
--client {auto,claude,copilot} | auto | Which client to configure. auto tries both and skips the ones it does not find. |
--approval {auto,manual} | unchanged | Save this approval mode in ~/.lore/config.json. It is saved first, because the Copilot instruction block depends on it. |
--dry-run | off | Print what would be done and change nothing. |
--uninstall | off | Remove the Lore server entry (and the instruction block) from the client. |
What it does for each client
Claude Code
If claude is on your PATH, it runs:
claude mcp add --scope user lore -- /path/to/python /path/to/lore/mcp_server.py
- It first asks
claude mcp get lore. If Lore is already registered with this exact path it prints "already set up" and does nothing; if registered with a different path, it replaces the entry. - It uses the absolute path of the Python that is running
install.py, so the server does not depend onpython3being found on the client'sPATH. - No instruction file is written. The server sends its instructions itself when Claude Code connects.
GitHub Copilot CLI
If ~/.copilot exists or copilot is on your PATH:
- Adds (or updates) the
loreentry undermcpServersin~/.copilot/mcp-config.json, keeping every other server and key in the file. It writes the file atomically. - Writes a block between the markers
<!-- lore:begin (managed by install.py) -->and<!-- lore:end -->in~/.copilot/copilot-instructions.md, keeping everything else you wrote there. Running it again replaces only the block. - If
mcp-config.jsonis not valid JSON, or is not an object with anmcpServersobject, it stops with an error and leaves the file alone.
VS Code
Not automated, because its configuration path varies. Add the server by hand: see Connect your agent.
Examples
$ python3 install.py --dry-run
Claude Code: would run: /usr/bin/claude mcp add --scope user lore -- /usr/bin/python3 /home/you/projects/lore/mcp_server.py
Copilot CLI: not found, skipped.
$ python3 install.py
Claude Code: server added (it sends Lore's instructions itself; nothing else to write).
Copilot CLI: not found, skipped.
Done. Start a new agent session; projects register themselves the first time an agent works in them.
$ python3 install.py # again
Claude Code: already set up.
Files it touches
| File | When |
|---|---|
~/.claude.json | Through claude mcp add/remove, never edited directly. |
~/.copilot/mcp-config.json | Copilot CLI. |
~/.copilot/copilot-instructions.md | Copilot CLI: only the marked block. |
~/.lore/config.json | Only with --approval. |
Exit status
0 on success (including "nothing found"); 2 with error: … on stderr when something it needs is unusable, such as a malformed Copilot config or a failing claude mcp add.
Moved the Lore folder?
Run
install.py again from the new location. The client entries contain the absolute path, so the old ones will point nowhere; the script replaces them.