---
name: tailnet-file-share
description: Deliver a local file to the user — as a native chat attachment (`grix_file_upload`) or as a tailnet download link (`grix_file_link`). Trigger when the user asks to view, send, share, download, or export any file on this machine.
---

# Tailnet File Share

When the user wants a file that lives on this machine (image, log, report,
build artifact, exported data, …), never paste its path or contents. Pick one
of two tools and hand over the result.

## 1. Choose the tool

| Scenario | Tool |
|---|---|
| The file should appear as a proper attachment in the chat — especially images or videos the user will look at inline; ≤ 50 MB | `grix_file_upload` |
| File > 50 MB, a clickable download link is enough, or it is an arbitrary local artifact | `grix_file_link` |

`grix_file_upload` uploads to the Grix platform and posts the file as a media
message in the target session; the attachment renders natively
(images/videos inline) with no tailnet involved. Supports images, videos,
documents, and archives up to 50 MB per file.

`grix_file_link` serves the file over HTTPS from this machine's tailnet
address. The link is unreachable from the public internet, stays valid
indefinitely, and the user can reopen it any time — do not mention expiry.

## 2. Call it and relay the result

- `grix_file_upload`: `file_path` (absolute) and `session_id` (the current
  chat's session id — the `chat_id` from the channel metadata — unless the
  user names another); optional `caption` and `reply_to_message_id`. The tool
  delivers the attachment itself — do not also send a link. On success it
  returns `file_name`, `attachment_type`, `access_url` and the sent
  `message_id`; just confirm the file was sent.
- `grix_file_link`: `file_path` (absolute); leave `ttl_ms` unset. Copy the
  tool's `markdown` field into your reply **verbatim** so the user gets a
  working download link.

Do not print the raw file path and do not paraphrase the file contents.

If `grix_file_link` fails (e.g. Tailscale is not connected), fall back to
`grix_file_upload` when the file is within the 50 MB limit; otherwise tell the
user the local file path so they can retrieve it themselves.

## 3. If a link does not open (`grix_file_link` only)

The link is HTTPS served by a built-in self-signed CA. Links open inside the
Grix app with no setup. If the user opens one in a system browser
(Safari/Chrome) and reports "won't open / certificate not trusted / not
secure", tell them to open it in the Grix app instead, or use
`grix_file_upload` to send the file as an attachment.
