---
name: net
description: 'The host''s place on the network -- its public IP address and where an IP address is. Tools: ip-location, public-ip. Use when a request needs any of these; each tool''s own trigger is in SKILL.md.'
compatibility: Requires fragletc and Docker. Network access required.
metadata:
  tags: internet
  tools: ip-location.py, public-ip.py
---

# Net

The host's place on the network -- its public IP address and where an IP address is.

Every tool below is one executable file beside this `SKILL.md`, in the directory the commands below call `<skill-dir>`. Run it directly. Two host requirements: [`fragletc`](https://github.com/ofthemachine/fraglet) (`curl -fsSL https://raw.githubusercontent.com/ofthemachine/fraglet/main/install.sh | sh && fragletc version`) and Docker; the image, parameters, outputs and network reach are declared in the file itself. Before running a tool, print its contract:

```sh
<skill-dir>/ip-location.py --fraglet-help
```

Parameters are passed as `-p name=value` (a `file` parameter takes a host path); declared outputs are copied out with `--output <name>[=<host path>]`. A missing required parameter fails host-side with exit 2 before any container starts; otherwise the tool's own exit code is the run's. A declared output not named with `--output` is produced and discarded (a stderr note says what you could have copied). Add `--receipt run.json` (or set `FRAGLETC_RECEIPT_DIR`) to record the run: the receipt carries the tool's `procedure_hash`, image digest, parameters, and every input and output by content hash, and `receipt/attest.py` can verify it later without re-running anything.

## Tools

### `ip-location.py`

Where an IP address is, from ip-api.com (no API key; its free tier is plain HTTP, so treat the answer as a hint, not a secret). Prints one line "City, Region, Country (CC) lat,lon tz" -- the City is the shape weather/current.py, weather/forecast.py and web/search.py take as their location. Pass ip= to look up a specific address; omitted, the caller's own public address is located.

Use when a workflow must find out where it is running (which city) before fetching local weather or news, or when the user asks where an IP address is.

```sh
<skill-dir>/ip-location.py [-p ip="<ip>"]
```

Parameters:
- `ip` (string, optional) — IPv4 or IPv6 address to locate; omitted, the caller's own public address

Outputs:
- stdout

Runs in `ofthemachine/python3@sha256:a015b4f9f0e7c1648f8fcd4164f6a296dd3c9189404f88f333a9764d08d13522`; network required — output depends on live external state; do not cache indefinitely.

### `public-ip.py`

The host's public IPv4/IPv6 address as the internet sees it, from ifconfig.me (no API key) -- what `curl ifconfig.me` prints, as a fraglet so a workflow can record where it ran. Prints the bare address and nothing else.

Use when the user asks what their public IP is, or a workflow needs the address it is running from -- for example to locate itself with net/ip-location.py.

```sh
<skill-dir>/public-ip.py
```

Parameters:
- none

Outputs:
- stdout

Runs in `ofthemachine/python3@sha256:a015b4f9f0e7c1648f8fcd4164f6a296dd3c9189404f88f333a9764d08d13522`; network required — output depends on live external state; do not cache indefinitely.
