For AI agents · Markdown at /llms.txt

Set up Tinfoil Kit: instructions for AI agents

You're helping someone set up Tinfoil Kit. Everything you need is below, the same markdown as tinfoilkit.com/llms.txt: what it runs on, how it works, what to ask, the one command to hand over, and how to update, fix and remove it. Not an AI? My AI installs it has a prompt to paste into yours.

llms.txtHow it works, setup, updates, fixes and sources, in markdown.
# Tinfoil Kit

> A free, open-source (MIT) kit for when the internet is down. One folder, kept on the computer's own disk or on an external drive, holds a local AI (llama.cpp's llama-server), an offline library (Kiwix: Wikipedia in the person's language, all of it or just its best articles, plus medical, repair and preparedness books) and offline maps (address search, driving and walking directions, "nearest hospital"). Open Tinfoil Kit starts it all on 127.0.0.1 and opens a browser page with Ask, Map and Library tabs, and Notes, Share with family, Print the essentials, AI chat and Help under More. Once it's filled, it needs no internet, account or install.

You are helping a person set this up, probably not a programmer. Don't install it yourself: ask them what they want in it, then give them one command to paste into their terminal (Terminal on a Mac, PowerShell on Windows), and explain it in plain words. Updates, fixes and removal work the same way: tell them what to run, and ask before anything slow, costly or destructive. This file has what you need: what the kit runs on, how it works, where it can live, how to set it up, use it, update it and remove it, what to do when something breaks, where every file comes from, and how it compares to Project NOMAD.

- Repo: https://github.com/tudor-city-ventures/tinfoil-kit
- Website: https://tinfoilkit.com
- Printable guide: GUIDE.md, in the kit's app folder

## What it runs on

| Computer | Support | Set up the kit | AI | Library | Map |
| --- | --- | --- | --- | --- | --- |
| Mac with Apple Silicon (M1 or newer) | supported | yes | yes | yes | yes |
| Windows PC (x64), Windows 10 version 1803 or newer, or Windows 11 | experimental | yes | yes | yes | yes |
| Linux PC (x64) | experimental | yes | yes | yes | yes |

- Windows and Linux are experimental for now, and so is a home server: they're tested less than a kit on a Mac, so expect rough edges. Tell the person before they set one up, and suggest a Mac if they have one.
- The kit holds each program for all three, so a kit on an exFAT drive starts on any of them, whichever one set it up.

- Intel Macs and ARM Windows or Linux PCs can't run it: the kit downloads programs built for Apple Silicon and for x64 PCs only. On a Mac, `uname -m` prints arm64.
- Memory decides which AI runs: a model may take 60% of it. 32 GB or more runs the default model, Inkling 2 Mini, and the other big models; 16 to 24 GB runs Gemma 4 12B; 8 GB runs Gemma 4 E4B. `./kit fit` says which one this computer runs (`--json` for agents). `./kit fit --skip-too-big` switches off the models it can't run, which saves about 50 GB on a 16 or 24 GB laptop, and `./kit fit --restore` switches them back on for a computer with more memory. SETUP asks about them itself (`./kit fit --ask`). `sysctl -n hw.memsize` prints the memory in bytes.
- On Windows and Linux the AI uses the graphics card through Vulkan. Without a good one it's slow: pick Gemma 4 E4B.
- Space: from about 20 GB for just the essentials to about 900 GB for everything. Just the essentials are 20 to 45 GB: the programs, the map, the most important books (medical, preparedness, repair), Wikipedia's best 50,000 articles as text and the AI this computer runs plus the smallest. The recommended kit is 200 to 300 GB, and everything, the huge collections too, about 900 GB. Within each, the AI models the computer runs and the map of where they live make the difference. `./kit estimate` (`--essentials` for those) prints the number for the current kit.json, with no internet. Sync always leaves 50 GB free on the computer's own disk and 25 GB on a drive, and SETUP warns before leaving less than 10% of the computer's disk or 5% of a drive.
- Setup needs the internet for hours (how many depends on their connection: see "Give them the command"), the laptop on its charger, and curl, which Macs and Windows come with (on Linux: `sudo apt install curl`). The kit's own program, in every download, does the rest, so nothing else gets installed. After that, nothing needs the internet.

## How it works

The whole kit is one folder, TinfoilKit, with three inside: app (the kit's code as released, which a new version replaces), downloads (everything sync downloads) and data (the person's kit.json and logs, and the kit's records, which no new version touches). It's used in two ways:

1. Online, whenever the person wants: SETUP (SETUP.command, or SETUP-Windows.bat on Windows), or `./kit update`, `./kit sync` and `./kit test`, fills the folder. kit.json lists every model, book, map and program with its publisher's download, and sync fetches each straight from the publisher: the newest edition of every book, model and map, and each program at the exact build this version of the kit names in tools/pins.json. Tinfoil Kit never hosts any of these files.
2. Offline, any time: Open Tinfoil Kit (Open Tinfoil Kit.command, or Open Tinfoil Kit for Windows.bat on Windows) starts a few servers from the folder on 127.0.0.1, and the browser page talks to them. Nothing goes over the internet.

| Part | Program | Port | What it does |
| --- | --- | --- | --- |
| AI | llama-server (llama.cpp) | 8080 | Runs the AI model. AI chat is its built-in chat page |
| Library | kiwix-serve (Kiwix) | 8888 | Serves the books (.zim files) with full-text search, and the kit page |
| Map | pmtiles | 8090 | Serves the map: street detail for a region, plus a low-detail world |
| Addresses | Photon | 2322 | Finds addresses, places and the nearest hospital or pharmacy |
| Directions | GraphHopper | 8989 | Plans driving and walking routes |
| Notes and pins | the kit's program | 8095 | Keeps Notes and the map's home and pins in data/ (notes.txt, places.json), so a new version keeps them and every browser on the kit sees the same ones |
| Sharing (off by default) | the kit's program | 8000 | Lets phones and laptops on the home network in with the access code, and passes their requests to the servers above |

Photon and GraphHopper run on a Java that's in the kit. Every server listens only on 127.0.0.1; sharing is the one way in from the network.

- Ask, with two buttons. Ask the AI: the AI turns the question into short searches, kiwix-serve searches every book, and the AI answers from the top articles with numbered sources. Search: no AI, the question's own words over the same indexes, and the best passages in seconds, on very little power; Have the AI answer from these then answers from them, with no second search. With the AI off, Ask the AI shows the passages too. Map questions ("nearest pharmacy", "directions to the hospital") go to three map tools instead (search places, find nearby, get directions), and the answer shows on the Map tab.
- Notes, under More on the kit page: what the person keeps about their household (allergies, medicines, who to call, where to meet), in data/notes.txt. The AI reads them with every question on Ask.
- Print the essentials, under More: the few pages of the kit's books worth having on paper, most important first (making water safe, first aid, dehydration, power outages), each opening at the first page to print, and a page of the household's own (home and pins with their coordinates, notes, the nearest hospitals) that prints alone.
- The kit page (tools/portal.html) is one HTML file. Each sync builds a copy with the map's code, fonts and icons inside, so the page needs nothing from the internet.
- The kit's code: `./kit` (`.\kit.cmd` on Windows) runs the kit's own program, tools/tinfoilkit-* (built from the Go source in tools/tinfoilkit/, standard library only, with curl for every download), and Open Tinfoil Kit starts the servers with it (`./kit open`). Every download carries the program. A git checkout or GitHub's Download ZIP has none until `tools/tinfoilkit/build.sh` builds it (it needs Go); with Go installed, `./kit` builds it by itself.

What's in the folder:

    TinfoilKit/
    ├── Open Tinfoil Kit.command      start the kit offline (Mac, Linux; the .bat on Windows)
    ├── Open Tinfoil Kit for Windows.bat
    ├── Read me first.txt             for the person: what to open, and what each folder is for
    ├── app/                          the kit's code, as released: a new version replaces it
    │   ├── SETUP.command             set up or update (online; Mac, Linux)
    │   ├── Open Tinfoil Kit.command  what the two at the top start (Mac, Linux)
    │   ├── UNINSTALL.command         remove the kit and everything it downloaded (Mac, Linux)
    │   ├── SETUP-Windows.bat         the same three, for Windows
    │   ├── Open Tinfoil Kit for Windows.bat
    │   ├── UNINSTALL-Windows.bat
    │   ├── GUIDE.md                  the printable guide
    │   ├── .claude/skills/           how-tos for AI agents: set up, update, change, check, share, remove
    │   ├── kit, kit.cmd              the kit's command line (kit.cmd on Windows)
    │   └── kit.json, tools/          the standard list of downloads, and the code
    ├── downloads/                    everything sync downloads
    │   ├── bin/                      programs: llama.cpp, Kiwix, Java, the map servers
    │   ├── models/                   AI models (.gguf)
    │   ├── library/                  books (.zim)
    │   ├── maps/                     map tiles, address database, road network
    │   └── INVENTORY.md              what's installed, with versions and sizes
    └── data/                         the person's: no new version touches it
        ├── kit.json                  what goes in their kit, and its settings
        ├── notes.txt                 Notes on the kit page, which the AI reads
        ├── places.json               the map's home and pins
        ├── logs/                     what each sync and launch did
        └── .kit/                     download progress, caches, the built kit page, the access code

Run `./kit` (`.\kit.cmd` on Windows) in the app folder. data/kit.json starts as a copy of app/kit.json; when a new version's list differs, the kit merges its changes in and keeps the person's. The app folder can be deleted any time and a new download's put in its place: downloads and data stay, and nothing downloads again. A kit set up before these three folders moves into them by itself the first time a newer version runs (`./kit layout`, which SETUP runs), by renaming. A git checkout is its own app folder, with downloads and data inside it.

## Where it can live

Help the person pick one. It's the same kit folder each way; only its place and how it's started change.

1. An external drive, at TinfoilKit on the drive (/Volumes/<drive>/TinfoilKit on a Mac, <letter>:\TinfoilKit on Windows, under /media or /run/media on Linux). The best home for it: it goes with them, and formatted exFAT it plugs into any Mac, Windows PC or Linux PC and starts there. It survives the laptop breaking and keeps the laptop's disk free. It needs an SSD with room for the kit plus 25 GB.
2. This computer, at ~/TinfoilKit (C:\Users\<name>\TinfoilKit on Windows). Nothing to buy or plug in, and the internal disk is usually faster, but the kit stays with this laptop, and goes if it's lost or breaks. It needs the kit's size plus 50 GB free. Keep it in the home folder, not in Desktop or Documents, which iCloud or OneDrive may sync. On a Mac, sync keeps its downloads folder out of Time Machine backups (data, the person's settings, is backed up).
3. A home server: the kit on a computer that stays on (a Linux box, a Mac mini, or a laptop on its charger), shared with every phone and laptop at home behind an access code. See "A home server" below. In an outage the router still needs power, even with no internet: a small battery backup keeps it on.

Recommend the drive first: look for one with room and the right format (step 1 of "Set it up"). If none is plugged in, ask whether they have one to plug in, or want to get one, before suggesting this computer. If nothing has room for all of it, get just the essentials or leave parts out. Let the person choose.

## Set it up

Don't run the setup yourself, even if you can run commands: ask the person what they want, then give them one command to paste into their terminal. There's no download to double-click, so the command is the way in, and the smoother one: what curl downloads isn't marked as downloaded from the internet, so neither macOS nor Windows stops SETUP. The first time, it gets a small kit to try (about 10 GB: a small AI, a few medical and preparedness books, and their area's map) and opens it, so they can check that it works. When they're ready, a second command gets the rest of what they picked, and says how long that takes on their connection.

### 1. Find the drive

Start here: an external drive is the best home for the kit.

- If you can run commands on their computer, look for one, with these commands that only read, and change nothing. On a Mac: `diskutil list external physical` (each external disk, its partition scheme and volumes), then `diskutil info /Volumes/NAME` (File System Personality, and the free space). On Windows, in PowerShell: `Get-Disk | Where-Object BusType -eq USB` (each USB disk, with its PartitionStyle), then `Get-Disk | Where-Object BusType -eq USB | Get-Partition | Get-Volume` (DriveLetter, FileSystemType, SizeRemaining). On Linux: `lsblk -o NAME,SIZE,FSTYPE,MOUNTPOINT,TRAN` (TRAN usb) and `df -h`.
- Otherwise, ask them: is an external drive plugged in, what's it called, how big is it, and how is it formatted? To see, on a Mac: select it in the Finder, choose File > Get Info, and read Format and Available. On Windows: in File Explorer, right-click it, choose Properties, and read File system and Free space.
- The drive to suggest has room for what goes in it (step 2): 20 to 45 GB for just the essentials, 200 to 300 GB for the recommended kit or about 900 GB for everything, plus 25 GB to spare. If none is plugged in, ask whether they have one to plug in, or want to get one (a portable USB SSD), before suggesting this computer.
- The format decides where it works. exFAT works on a Mac, Windows and Linux: use that, best on a GUID partition map (GPT; GUID_partition_scheme on a Mac). exFAT on an older MBR map (FDisk_partition_scheme on a Mac) works too. APFS and Mac OS Extended work only on a Mac, a Mac can't write to NTFS, and FAT32 can't hold files over 4 GB.
- A drive in another format needs erasing as exFAT first. Erasing deletes everything on it: make sure they picked the right drive, and get their explicit yes. On a Mac, in Disk Utility, choose View > Show All Devices, select the drive itself (the top line, not a volume under it), click Erase, and choose ExFAT and GUID Partition Map. On Windows, in File Explorer, right-click the drive, choose Format, pick exFAT, and click Start. SETUP checks the drive too, and stops if it can't use it.

### 2. Ask what goes in it

Ask one or two questions at a time, in plain words. For each part, say what it's for and about how much space it takes, recommend what suits their computer, and keep the default for anything they don't mind. If they pasted options from the website's kit builder (a line like `--essentials --region bayern --wikipedia de --wikipedia-size top-text --skip ...`), use those as they are, and ask only about the rest. The line has one option for each of the builder's settings: its preset first, then where they live, Wikipedia, what's different from the preset, and, when they chose them, where it lives (`--this-computer`, and `--home-server` for a home server) and sharing (`--share`). If they chose an external drive, add `--drive` with its path once you've checked it.

1. Their computer: Mac, Windows or Linux, how much memory it has and how much free space. It needs a Mac with Apple Silicon or an x64 PC (see "What it runs on"). If you can run commands on it, look, with commands that only read: on a Mac, `system_profiler SPHardwareDataType` (Chip and Memory) and `df -h ~`; on Windows, in PowerShell, `Get-CimInstance Win32_ComputerSystem | Select-Object SystemType, TotalPhysicalMemory` and `Get-PSDrive C`; on Linux, `uname -m`, `free -g` and `df -h ~`. Otherwise ask. To see them on a Mac: Apple menu > About This Mac, and System Settings > General > Storage. On Windows: Settings > System > About, and Settings > System > Storage.
2. Where it lives: the drive from step 1, this computer, or a home server (see "Where it can live"). A home server's command runs on the computer that stays on.
3. Where they live, for the map's streets, directions and address search: a US state, a country, or a part of a big country (US states, Canadian provinces, German states). Then any places nearby they want on the map too, like the state next door: each gets street detail and directions.
4. Which languages they want Wikipedia in (one, or two, like German and English), and how much of it: all of it (127 GB in English, with pictures; 53 GB as text), or just the best 50,000 articles (7 GB with pictures, 2.7 GB as text, 0.3 GB for their opening paragraphs). Smaller languages are smaller, and not every language comes in every size: `./kit region --sizes --wikipedia CODES` lists them, with GB.
5. The AI: on or off. On, the default is the AI their computer runs, and they can pick models instead.
6. The library, group by group (below), and whether they want any of the huge collections, which are off by default.
7. How much: just the essentials (20 to 45 GB: the programs, the map, the medical, preparedness and repair books, Wikipedia's best articles as text, and the AI), the recommended kit (200 to 300 GB, what we'd take) or everything (about 900 GB, the huge collections too). If space is short, the essentials; the rest can come later.
8. Sharing it with the phones and laptops at home, behind an access code: only while it's open, or as a home server that starts with the computer.

What goes in, with the ids the options take:

- AI models, which all read photos: Inkling 2 Mini (`Inkling-2-Mini`, the default, fast, 18 GB, for 32 GB of memory or more), Qwen3.8 27B (`Qwen3.8-27B`, a second opinion from another lab, slower, 17.5 GB), Gemma 4 26B-A4B (`Gemma-4-26B-A4B`, a third opinion, 15.7 GB), Gemma 4 12B (`Gemma-4-12B`, for 16 to 24 GB, 7.1 GB) and Gemma 4 E4B (`Gemma-4-E4B`, small, saves battery, for 8 GB, 5.3 GB).
- Maps (`maps`): street detail, addresses and directions for their place, address search for its whole country, and a low-detail world map. 5 to 30 GB, depending on the place. Each place nearby adds its street detail and directions, under 1 GB for most and up to 6 GB for a big country, and has address search only if it's in the same country (or, where address search covers a whole region of the world, the same region). Where nobody publishes address search for the country alone (much of Europe, the Caribbean), it covers the whole region of the world, 16 to 32 GB, and just the essentials leave that out.
- Reference, about 143 GB: Wikipedia with images (`wikipedia`, about 127 GB in English, or less of it: question 4), Wiktionary (`wiktionary_en_all_nopic`, 15 GB) and Wikivoyage (`wikivoyage_en_all_maxi`).
- Medical, about 6 GB: WikiMed (`mdwiki_en_all_maxi`), field medicine books (`zimgit-medicine_en`), military medicine manuals (`irp.fas.org_en_military-medicine`), MedlinePlus (`medlineplus.gov_en_all`), CDC Travelers' Health (`wwwnc.cdc.gov_en_all`), LibreTexts Medicine (`libretexts.org_en_med`) and medical Q&A (`medicalsciences.stackexchange.com_en_all`).
- Preparedness, about 17 GB: post-disaster, water, food and knots guides (`zimgit-post-disaster_en`, `zimgit-water_en`, `zimgit-food-preparation_en`, `zimgit-knots_en`), Ready.gov (`ready.gov_en_all`), Urban Prepper (`urban-prepper_en_all`), Learning Self-Reliance videos (`lrnselfreliance_en_all`), US Army publications (`armypubs_en_all`) and outdoors Q&A (`outdoors.stackexchange.com_en_all`).
- Repair and skills, about 14 GB: iFixit (`ifixit_en_all`), Appropedia (`appropedia_en_all_maxi`), CD3WD (`cd3wdproject.org_en_all`), Energypedia (`energypedia_en_all_nopic`), and Q&A on home improvement (`diy.stackexchange.com_en_all`), gardening (`gardening.stackexchange.com_en_all`), cooking (`cooking.stackexchange.com_en_all`), electronics (`electronics.stackexchange.com_en_all`), amateur radio (`ham.stackexchange.com_en_all`), car repair (`mechanics.stackexchange.com_en_all`), bicycle repair (`bicycles.stackexchange.com_en_all`) and sustainable living (`sustainability.stackexchange.com_en_all`).
- Books and courses, about 15 GB: Wikibooks (`wikibooks_en_all_maxi`), Wikiversity (`wikiversity_en_all_maxi`) and LibreTexts textbooks in biology (`libretexts.org_en_bio`), chemistry (`libretexts.org_en_chem`), engineering (`libretexts.org_en_eng`), physics (`libretexts.org_en_phys`), earth science (`libretexts.org_en_geo`) and math (`libretexts.org_en_math`).
- Off by default, because they're huge: Survivor Library (`survivorlibrary.com_en_all`, 220 GB), Khan Academy videos (`khanacademy_en_all`, 180 GB) and Project Gutenberg (`gutenberg_en_all`, 221 GB).

https://tinfoilkit.com/sources.json has the same list with each item's size, and kit.json in the kit is the full list.

### 3. Give them the command

First tell them how long the downloads take, so they can plan around them:

- Find their internet speed. If you can run commands on a Mac, `networkQuality` (built into macOS 12 and later) measures it in about 20 seconds: read Downlink capacity. Otherwise ask them: their internet plan's speed, or what a speed test site like fast.com shows.
- Hours = GB × 2.2 ÷ Mbps, at best. Wi-Fi and busy servers often make it slower, so round up:

| What downloads | Size | 10 Mbps | 50 Mbps | 100 Mbps | 500 Mbps |
| --- | --- | --- | --- | --- | --- |
| The kit to try | about 10 GB | 2 hours | 30 minutes | 15 minutes | 3 minutes |
| Just the essentials | 20 to 45 GB | 4.5 to 10 hours | 1 to 2 hours | 30 minutes to an hour | 5 to 15 minutes |
| The recommended kit | 200 to 300 GB | 2 to 3 days | 9 to 13 hours | 4.5 to 7 hours | 1 to 1.5 hours |
| Everything | about 900 GB | 8 days | 40 hours | 20 hours | 4 hours |

- The command gets just the kit to try, unless it has `--no-pause` or `--home-server`: then it goes straight on to the rest, so say how long that takes too.
- SETUP times the connection itself before it downloads anything, says how long the kit to try and all of it take, and shows the time left while it downloads.

Put their answers in as options. Mac or Linux, in Terminal:

    mkdir -p ~/Downloads && cd ~/Downloads && curl -fsSL https://github.com/tudor-city-ventures/tinfoil-kit/releases/latest/download/TinfoilKit.tar.gz | tar -xz && bash TinfoilKit/app/SETUP.command --region texas --drive /Volumes/Kit --yes

Windows, in PowerShell:

    cd ~\Downloads; curl.exe -fsSL -o TinfoilKit.zip https://github.com/tudor-city-ventures/tinfoil-kit/releases/latest/download/TinfoilKit-Windows.zip; tar -xf TinfoilKit.zip; Remove-Item TinfoilKit.zip; .\TinfoilKit\app\SETUP-Windows.bat --region texas --drive E: --yes

| Option | What it does |
| --- | --- |
| `--region PLACES` | Where they live, in English: "Texas", "Ontario", "Germany: Bayern" (nicknames like "UK" and big towns like "Lyon" work too), or a place's id. Sets the map's street detail, directions, address search, home and units. Quote a name with spaces. If two places share the name, SETUP stops and lists their ids. Places nearby go after it as ids, with commas: `--region us/new-york,us/new-jersey` (ids work in every terminal; `./kit region --find WORDS` lists them). |
| `--wikipedia CODES` | Wikipedia's languages: `de`, or `de,en` for two. |
| `--wikipedia-size SIZE` | How much of Wikipedia: `all` (the default, with pictures), `all-text`, `top` (the best 50,000 articles, with pictures), `top-text` or `top-intros` (their opening paragraphs). A language without that size gets the next smaller one it has. With `--essentials`, Wikipedia comes whole in that size; without a size, just the essentials bring the best articles' text until the rest of the kit comes. |
| `--recommended`, `--essentials`, `--everything` | The kit builder's presets: what goes in starts over from one of them. Recommended is what we'd take (200 to 300 GB). Essentials is the programs, the map, the medical, preparedness and repair books, Wikipedia's best articles and the AI this computer runs plus the smallest (20 to 45 GB), with the rest offered later. Everything is every AI model and book, the huge collections too (about 900 GB). The options below change the preset. Without one, they change the kit as it is (the first time, the recommended kit). |
| `--drive PATH`, `--this-computer` | Where it lives. A drive is its path: /Volumes/NAME on a Mac, E: on Windows, /media/USER/NAME or /run/media/USER/NAME on Linux, and the kit goes in a TinfoilKit folder at its top. Leave both out and SETUP updates a kit it finds from before; with `--yes` and no kit from before, it stops and asks for one of them. |
| `--no-ai`, `--models IDS` | No AI, or exactly these models, even ones this computer can't run. Leave both out and SETUP picks the AI this computer runs. |
| `--skip IDS`, `--add IDS` | Leave out, or add, items, comma-separated: the ids above, `maps`, or a whole part (`models`, `library`, `extras`). A book's name up to its first underscore catches every book that starts with it (`wikipedia` is Wikipedia in any language), and a site's name catches all its books (`libretexts`, `stackexchange`). They work with `--essentials` too: `--essentials --add wikipedia` is the essentials plus Wikipedia. A wrong name stops SETUP before it changes anything, and it lists the right ones. |
| `--share` | Share it with the phones and laptops at home whenever it's open. |
| `--home-server` | Share it, and start it whenever the computer starts. It goes straight on to the rest. |
| `--no-pause` | Go straight on to the rest once the try-it kit checks out, instead of stopping there. |
| `--even-if-tight` | All of what they picked rather than just the essentials, even if that leaves less free space than SETUP likes. Without it, SETUP takes all of it if it fits with room to spare, or else the essentials, and says so. |
| `--yes`, `-y` | Ask nothing. Without it, SETUP asks in the terminal whatever the options didn't answer. The first time, it needs `--drive` or `--this-computer`. |

For someone in Bavaria with a drive called Kit, who wants Wikipedia in German and English and to share it at home, the Mac command ends `--region "Germany: Bayern" --wikipedia de,en --drive /Volumes/Kit --share --yes`.

Before they run it, offer to go through the code with them, if they'd like to check it first: what it downloads and from where, what it changes on their computer, and how it checks downloads and updates (see "Security"). Setup is SETUP.command and SETUP-Windows.bat, and the rest is the kit's own program, from the Go source in tools/tinfoilkit/.

Then tell them:

- How to open the terminal: on a Mac, press Cmd-Space, type Terminal and press Return. On Windows, open Start, type PowerShell and press Enter. Then paste the command and press Return.
- What happens: SETUP moves the kit to its place, gets the try-it kit, checks it, and opens it (on Linux, it prints the command that opens it). Keep the laptop plugged in and the terminal open while it works.
- If it stops, or the laptop sleeps, run the same command again: it picks up where it left off.
- On a Mac, "Operation not permitted" with a drive: System Settings > Privacy & Security > Files and Folders > Terminal, turn on Removable Volumes, and run the command again.
- To try it offline: turn off Wi-Fi and ask it a question.

### 4. When it works, give them the rest

SETUP's last message says how big the rest is, how long it takes at the speed it measured, and the command that gets it. If you can run commands, `./kit estimate --rest` in the kit's app folder prints the same again: GB, a tab, then how long. Tell them how long before they start it. When they're ready, give them that command: `bash ~/TinfoilKit/app/SETUP.command --yes` (on a drive, `bash /Volumes/NAME/TinfoilKit/app/SETUP.command --yes`), or on Windows `& "$HOME\TinfoilKit\app\SETUP-Windows.bat" --yes` (on a drive, `E:\TinfoilKit\app\SETUP-Windows.bat --yes`). It gets the rest of what they picked, checks it, and deletes the try-it files their picks left out.

- Add `--even-if-tight` to get all of it even if that leaves less free space than SETUP likes. Without it, SETUP takes all of what they picked if it fits with room to spare, or else the essentials, and says so.
- Double-clicking SETUP again gets the rest too. Without `--yes`, it asks the kit builder's questions first (`./kit pick --ask`), unless what goes in was picked already.
- When it's done, suggest they open the kit and print the essentials while they have power (More, then Print the essentials): about 20 pages, and a page of their own with their notes, pins and the nearest hospitals.
- Tell them what to do in an outage: open the TinfoilKit folder (at the top of the drive, or in their home folder) and double-click Open Tinfoil Kit.command (Open Tinfoil Kit for Windows.bat on Windows). Read me first.txt there says the same, and what each folder is for.

### SETUP's own questions

Without `--yes`, SETUP asks in the terminal whatever the options didn't answer. The first time: where the person lives (a US state or a country, for the maps and Wikipedia's language), any places nearby for the map, and how much of Wikipedia they want, then "An external drive (recommended)" or "This computer", with what fits on each, and it moves the kit there. It says which AI the computer runs and asks before downloading models too big for it. Then it times the connection and says how long the downloads take, gets a small kit to try (about 10 GB), tests it, opens it and says how long the rest takes. Running SETUP again gets the rest, after asking what goes in the kit (the website builder's choices).

### By hand

For developers, or to look at each step. In the kit's app folder (`.\kit.cmd` for `./kit` on Windows):

    ./kit drives --json   # what the kit needs, this computer's free space, and every drive plugged in, with its format
    ./kit fit --json      # which AI this computer runs
    ./kit region PLACE --wikipedia de --wikipedia-size top-text   # --sizes: the sizes in those languages, with GB
    KIT="$(./kit place "/Volumes/<drive>/TinfoilKit")" && cd "$KIT/app"   # or ~/TinfoilKit, for this computer
    ./kit pick            # what's on, and the size of all of it and of just the essentials (--ask: the kit builder's questions)
    ./kit pick --essentials --region bayern --wikipedia de --skip ifixit_en_all   # the website builder's options, as SETUP takes them
    ./kit plan            # every item, version and size, and how long it takes to download
    ./kit sync -y --starter && ./kit test   # the try-it kit, about 10 GB
    ./kit sync -y && ./kit test             # everything picked; then it removes the try-it files nobody picked

- `./kit` runs the kit's own program, which needs only curl. A git checkout or GitHub's Download ZIP has none: `./kit` builds it when Go is installed (https://go.dev/dl), or get the kit with the command in "Give them the command" instead.
- `./kit drives --json` needs no internet. It prints needs_gb (what the current kit.json needs), needs_essentials_gb, this_computer and drives, each drive with path, format, free_bytes, problem, has_kit, kit_path and space. space says whether all of it and just the essentials fit there: "fits" (leaving 10% of the computer's disk or 5% of a drive free), "tight" (fits, but leaves less) or "no". A drive with a problem is FAT32, or NTFS on a Mac: erase it as exFAT first (step 1 above). `./kit space PATH --json` says the same for any folder.
- `./kit place` moves the download there (to another disk it copies the kit, then removes the download) and prints the kit's new folder as its only output. If a kit is already there, it carries on with that one, and puts this app folder in it if its own was deleted. On Windows it copies the kit and leaves the download to delete. When it can't, it exits 1 and says why.
- Skip an item by setting "enabled": false on it in data/kit.json (never app/kit.json: a new version replaces it), or get just the essentials with `./kit essentials on`. `./kit search WORDS` finds more Kiwix books and prints a line to paste into library. Run `./kit estimate` after any change.
- `./kit sync` exits 0 when everything finished, 1 when something failed or couldn't be looked up, and 130 after Ctrl-C. On 1, run it again: it resumes and names what's left. The kit already works with what it has.
- Before a kit's first big download, `./kit plan` times the connection for a few seconds on its biggest book or model (`download_speed` in data/.kit/state.json, which each sync updates), so the plan says how long it takes. Sync shows the time left as it goes, for each big file and for everything.
- Sync fetches the most important items first, each big file over eight connections at once, resumes broken downloads, checks every file against its published checksum when there is one, and deletes an old version only after the new one checks out. Building the directions network takes 10 to 40 minutes after the map downloads.
- Developers can `git clone https://github.com/tudor-city-ventures/tinfoil-kit` straight into the chosen place instead, and update with `git pull`. A checkout is its own app folder: downloads and data go inside it.

## Use it

- Double-click Open Tinfoil Kit.command in the kit folder, TinfoilKit (Open Tinfoil Kit for Windows.bat on Windows), or run `bash "Open Tinfoil Kit.command"` there. It opens http://127.0.0.1:8888. Keep its window open: closing it stops everything. The kit's program keeps these launchers and Read me first.txt beside app, downloads and data once the kit is set up; they start the same launchers in app, which work too.
- Open Tinfoil Kit.command's options: `--share` lets phones and laptops on the same network open it with an access code (it prints the address, the code and a QR code), `--no-maps` frees about 5 GB of memory, `--model=NAME` picks the first model (a folder name in downloads/models/), `--no-browser` skips opening the browser. Open Tinfoil Kit for Windows.bat and `./kit open` take the same. If macOS asks whether to accept incoming connections, click Allow; if Windows asks whether tinfoilkit-windows-x64.exe may use the network, click Allow access.
- The kit page has three tabs. Ask: Search shows the best passages from the books without the AI, quickly and on very little power; Ask the AI answers from the books and cites them, slower and on more power than Search. Library browses and searches every book. Map searches places, plans routes and finds the nearest hospital, pharmacy or gas station, and keeps pins. More holds the rest: Notes, what the AI should know about the household, like an allergy or a medicine (they aren't encrypted, so passwords and bank details stay out); Share with family, which turns sharing on and off and gives the message to text; Print the essentials, the pages worth printing while there's power; AI chat, plain chat that can read a photo but doesn't search the books; and Help. The button beside the name says how the kit is: Ready, Starting, AI off, and Shared while others can use it.
- Models: pick one on the Ask page. The first answer after switching takes up to a minute while it loads.
- Map: set home first, since a laptop has no GPS (Set as home on a search result, or Set home to the map center). For actually driving, a phone with offline maps and GPS is better; the kit's map is for planning and for the AI's map questions.
- Power: a big model drains a laptop battery in a couple of hours of steady use. Gemma 4 E4B saves battery, and Search and the Library tab use almost nothing.
- Linux: Fedora 45 and later need `sudo dnf install openssl3-libs` for the AI, installed while there's still internet.

## A home server

Sharing with the phones and laptops at home is off until the person turns it on: Share with family, under More on the kit page (only on the computer the kit runs on), or `./kit share on`. A home server is experimental for now: tell the person. For a computer that stays on, with or without a screen. The setup command with `--this-computer --home-server` (see "Set it up") sets the kit up on that computer's own disk, gets all of it, and turns on both of these. By hand, in the kit's app folder:

    ./kit share on       # share it on the home network behind an access code: prints the address, the code and a QR code
    ./kit autostart on   # start it now, and whenever the computer starts

- Phones and laptops open the address, like http://192.168.1.20:8000, and type the 8-digit code once; the QR code includes it, and so does the link in the message that Share with family, on the kit page, copies for the person to text. `./kit share` shows them again. `./kit share new-code` replaces the code and signs every device out. `./kit share off` stops sharing.
- How it works: the kit's program listens on the network on port 8000 (`share_port` in data/kit.json), asks for the code, and passes requests on: /ai/ to the AI, /tiles/, /geocoder/ and /routing/ to the map, /data/ to the notes and pins, everything else to the library. It answers only devices with home network addresses, turns away names that aren't this computer's, and allows 10 wrong codes per 10 minutes from each device.
- Programs can use the code as an API key: `Authorization: Bearer CODE` with the OpenAI-compatible API at http://ADDRESS:8000/ai/v1.
- Linux: autostart is a systemd user service (`systemctl --user status tinfoil-kit`) that starts at boot once lingering is on (`sudo loginctl enable-linger $USER`; the kit tries it and says if it needs you). Mac: a LaunchAgent that starts when the person logs in, so turn on automatic login on a Mac that's a server, and keep the kit on its own disk. Windows: "Tinfoil Kit.cmd" in the Startup folder, which starts Open Tinfoil Kit for Windows.bat minimized when the person signs in, so keep that PC signed in (locking it is fine) and plugged in. While it shares, the kit keeps Windows from sleeping.
- Windows asks whether tinfoilkit-windows-x64.exe may use the network the first time the kit shares: the person clicks Allow access. If phones still can't connect, the Wi-Fi needs to be a private network (Settings > Network & internet), and that program allowed for private networks in Windows Security > Firewall & network protection > Allow an app through firewall.
- `./kit autostart off` stops it starting by itself; UNINSTALL does that too. On Windows it doesn't stop a kit that's running, and turning sharing on or off needs a restart there: close the kit's window and start it again.
- The traffic is plain HTTP inside the home network: share it on the person's own Wi-Fi or hotspot, not a public one.

## Update it

There's no schedule. Whenever the person wants the newest models, books and maps, while online, in the kit's app folder:

    ./kit update   # the kit's newest version, into the app folder, with any models and sources added since. data/kit.json keeps the person's changes.
                   # Installs only a release signed with the kit's key, and asks first at a keyboard (--yes doesn't).
    ./kit plan     # what's new or changed, how much will download, and how long that takes
    ./kit sync -y  # download it, check every file, then remove the old versions
    ./kit test

- `./kit update` exits 3 after installing a newer version of the kit. That's success: carry on with the next command. It exits 0 when the kit is already the newest.
- In a git checkout, run `git pull` instead of `./kit update`.
- An update can bring models too big for this computer: `./kit fit` names them, and `./kit fit --skip-too-big` leaves them out. On a kit with just the essentials, `./kit space . --json` says when the rest fits; then run `./kit essentials off` before syncing. SETUP asks about both by itself.
- If `./kit update` says a version isn't signed with the kit's release key, stop: don't install it another way. Tell the person, and report it at https://github.com/tudor-city-ventures/tinfoil-kit/security.
- Double-clicking SETUP again (SETUP.command, or SETUP-Windows.bat on Windows) does all four. As an agent, give them `bash "<kit folder>/app/SETUP.command" --yes` (`& "<kit folder>\app\SETUP-Windows.bat" --yes` on Windows), which does the same without asking.
- A normal update brings new library editions, the program builds the new kit version names (the AI engine and the rest), any re-released models and fresh map data. Only what changed downloads.
- A newer download of the kit doesn't start over. Its SETUP finds the kit set up before, in the home folder or on a drive plugged in (`./kit kits` lists them), and updates that one. A kit whose app folder was deleted gets the download's (`./kit place` that kit puts it there). Nothing the kit has downloads again, not even a file an older version kept under another name, and the kit keeps working with the editions it has: the plan lists the newer ones before anything downloads, and the person can say no.
- A book with `refresh_days` in kit.json keeps the edition it has until it's that many days old: Wikipedia has 365, so most updates don't download it again. The plan marks it `later`. `./kit sync --only wikipedia` gets the newest now.
- It's safe to stop at any point and run it again: it picks up where it left off, and the old files keep working until the new ones check out.
- `./kit status` shows what's installed and when it was last updated. downloads/INVENTORY.md lists every item with its version and size.

## Remove it

Double-click UNINSTALL.command (UNINSTALL-Windows.bat on Windows) in the kit's app folder. Once the person types "delete", it removes the kit folder and everything the kit downloaded, the person's notes and pins too (offer to copy data/notes.txt somewhere first). On a drive it leaves the rest of the drive alone. If the app folder sits in a folder with other things in it, it deletes nothing and says so. As an agent, give them `bash UNINSTALL.command --yes` (`.\UNINSTALL-Windows.bat --yes` on Windows), which skips the question, only once they've said yes to deleting all of it.

## When something goes wrong

- The setup command stops with curl's error 404: GitHub has no release of the kit to download right now (https://github.com/tudor-city-ventures/tinfoil-kit/releases). On a Mac or Linux with git and Go (`git --version` and `go version` both answer; Go is at https://go.dev/dl), the kit can come from its source instead, with the same options: `git clone --depth 1 https://github.com/tudor-city-ventures/tinfoil-kit ~/Downloads/tinfoil-kit && bash ~/Downloads/tinfoil-kit/SETUP.command --region texas --drive /Volumes/Kit --yes`. SETUP builds the kit's program first, then copies the code to the drive. For this computer, clone it to ~/TinfoilKit and run the SETUP.command there with `--this-computer`. Otherwise, and on Windows, tell the person to try again later.
- "Apple could not verify..." on a double-click: System Settings > Privacy & Security > Open Anyway, once. `bash "Open Tinfoil Kit.command"` in Terminal always works.
- "Windows protected your PC" on a double-click: More info, then Run anyway, once.
- "Operation not permitted" in Terminal: macOS is keeping Terminal off the drive. System Settings > Privacy & Security > Files and Folders > Terminal: turn on Removable Volumes, then start again.
- Sync ended with exit 1, or SETUP says some downloads didn't finish: run `./kit sync -y` again. It resumes and names what's left. The kit already works with what it has.
- Sync says a program's publisher no longer publishes the build the kit names: run `./kit update` first, since a newer kit names newer builds. If it says a program's file changed after the kit pinned it, don't work around it: tell the person, and report it at https://github.com/tudor-city-ventures/tinfoil-kit/security.
- Not enough space: sync stops short of the free space it keeps (50 GB on the computer's own disk, 25 GB on a drive). Get just the essentials (`./kit essentials on`), delete what the person can do without (`./kit remove NAME`, which also switches it off), or move the kit to a bigger drive. Switching an item off doesn't delete what it downloaded: `./kit status` lists what's switched off but still in the kit.
- A file may be corrupt: `./kit verify` re-checks every file. `./kit verify --fix` removes bad ones, and the next sync replaces them.
- A model won't load or is very slow: quit other apps, pick Gemma 4 E4B, or start with `--no-maps` to free about 5 GB. Advanced, with the person's password: `sudo sysctl iogpu.wired_limit_mb=26624` lets the GPU use up to 26 GB until the next restart.
- The map says address search or directions are "not running": they take up to a minute to start. If they never do, read data/logs/geocoder.log and data/logs/routing.log. If `./kit test` fails on address search with a "lock" error in data/logs/test-geocoder.log, the exFAT format is the cause: reformat the drive as APFS and copy the kit back.
- The Notes or Map tab says notes or pins are saved in this browser: the kit couldn't start the server that keeps them. Read data/logs/data.log. They move into the kit the next time it starts.
- Anything else: close the kit's window, start again, and read data/logs (sync-*.log for downloads, llama-server.log for the AI).
- The previous version of each program stays in downloads/bin/ and starts automatically if the newest one won't.

## Where everything comes from

The kit's own code is MIT. Everything it downloads comes straight from its publisher under the publisher's license: Tinfoil Kit never hosts, mirrors or bundles any of it, and the person is the one downloading, so those terms apply to them. All of it is free to download and use; some of it isn't free to sell. THIRD-PARTY.md has the full list.

- AI models: Inkling 2 Mini by Thinking Machines (Apache 2.0, plus Thinking Machines' Model Acceptable Use Policy, which binds anyone who downloads the weights), Qwen3.8 27B by Alibaba (Apache 2.0), Gemma 4 26B-A4B, Gemma 4 12B and Gemma 4 E4B by Google (Apache 2.0). The files come from ggml-org's and Unsloth's Hugging Face repos.
- Books: Wikipedia and its sister projects, WikiMed, Stack Exchange, Appropedia and Energypedia are CC BY-SA. iFixit, LibreTexts and Khan Academy are CC BY-NC-SA: no commercial use. Ready.gov, CDC Travelers' Health and US Army publications are US government works. So are MedlinePlus's own pages, but its encyclopedia and drug information are copyrighted: free to read, not to republish. Project Gutenberg is public domain in the US. Survivor Library, Urban Prepper, CD3WD, the Learning Self-Reliance videos and the collections of field medicine, post-disaster, water, food and knots guides have mixed terms: free to read, not to republish.
- Maps: OpenStreetMap data (© OpenStreetMap contributors, Open Database License), through Protomaps, Geofabrik and the Photon exports GraphHopper hosts. Map style: Protomaps basemaps (BSD-3-Clause). Fonts: Noto Sans (SIL Open Font License).
- Programs: llama.cpp (MIT), kiwix-serve (GPL-3.0), Eclipse Temurin Java (GPL-2.0 with Classpath Exception), go-pmtiles (BSD-3-Clause), GraphHopper and Photon (Apache 2.0), MapLibre GL JS (BSD-3-Clause).
- Setup and updates talk only to GitHub, Kiwix, Hugging Face, Protomaps, Geofabrik, GraphHopper, Adoptium, Maven Central and npm, plus anything added to kit.json. Using the kit sends nothing over the internet: no account, no telemetry.

## How it compares to Project NOMAD

Project NOMAD (Crosstalk Solutions, Apache-2.0, https://github.com/Crosstalk-Solutions/project-nomad) is another free, open-source offline knowledge kit. If the person asks which to use:

- NOMAD is a server: a Docker "Command Center" on an x86 PC running Ubuntu or Debian, installed with one command run as root, usually on a PC set aside for it. It has Kiwix collections, Kolibri (Khan Academy courses), an Ollama chat with a knowledge base that indexes the person's own documents and its books and cites them, offline maps with pins and notes, and an app catalog. Devices on the network use it with no login, by design.
- Tinfoil Kit is one folder on the computer the person has (a Mac with Apple Silicon, or a Windows or Linux PC on x64), or on an exFAT drive that starts on any of them, set up with one command, with no Docker. Ask searches every book at question time and cites them, with nothing to index first. The map has address search, driving and walking directions and the nearest hospital, as well as pins, and Ask's AI reads the household notes the person keeps in the kit. Sharing is off until it's turned on, then behind an access code, and the kit installs updates to itself only if the maintainer's key signed them.
- Suggest NOMAD for a home server with apps, or an AI that reads their own documents. Suggest Tinfoil Kit for the laptop they have, a Mac, or a drive that moves between computers.

## Security

- `./kit update` installs new kit code only if the maintainer's release key signed it, checked against tools/release-signers in the copy already there. The key never touches GitHub.
- Every download comes straight from its publisher over HTTPS. Each release names the exact build of every program, with its SHA-256, in tools/pins.json, signed with the rest. Books, models and map data are checked against the publisher's checksum wherever one is posted (the map tiles and fonts have none). Nothing is hosted or mirrored by this project.
- The servers listen on 127.0.0.1. Sharing is off until the person turns it on; then a gate, on port 8000 by default, asks for an 8-digit code. It's plain HTTP, so share on the person's own Wi-Fi or hotspot, not a public network.
- To check a release before running it, download tinfoilkit-TAG.tar.gz and its .sig from the release, then run `ssh-keygen -Y verify -f tools/release-signers -I tinfoilkit-release -n tinfoilkit-release -s tinfoilkit-TAG.tar.gz.sig < tinfoilkit-TAG.tar.gz`.
- Security problems go to https://github.com/tudor-city-ventures/tinfoil-kit/security/advisories/new, never a public issue.

## Rules

- Don't set the kit up yourself: give the person the command (see "Set it up").
- Start programs and models only through the kit's own commands. Don't run downloaded files to see what they do.
- Don't delete files in downloads/ by hand. `./kit verify --fix` removes corrupt files, and the next sync replaces them. To remove the whole kit, use UNINSTALL.command.
- data/ is the person's: change their kit.json only as they ask, and never delete anything there. The app folder is the one that can go, for a new version's.
- Ask before formatting a drive, deleting anything or using sudo.
- Don't sell drives filled with the kit: some sources forbid commercial use.
- The AI can be wrong. For anything medical or safety-related, tell the person to read the sources it cites and to get trained help when they can.

## More

- README: https://github.com/tudor-city-ventures/tinfoil-kit#readme
- GUIDE.md: the printable guide, in the kit's app folder
- THIRD-PARTY.md: every model, book, map and program, and its license
- Skills for AI agents, one for each job, with the exact commands: tinfoil-install, tinfoil-update, tinfoil-data, tinfoil-status, tinfoil-home-server and tinfoil-uninstall, in .claude/skills in the kit's app folder and at https://github.com/tudor-city-ventures/tinfoil-kit/tree/main/.claude/skills
- AGENTS.md: rules for changing the kit's own code
- Bugs and ideas: https://github.com/tudor-city-ventures/tinfoil-kit/issues