# Large Files & External Tools

Most apps handle modest amounts of data, and the agent takes care of that for you. Two kinds of app need a little more thought: those that move **large files** like video, audio, or big datasets, and those that lean on **external command-line tools** to do their work. Knowing how Glaze handles each helps you ask for the right thing and know what to expect.

## Large Files

When an app loads a large file, *how* it gets there matters, because pushing a multi-megabyte file through the app's internal messaging is slow. Instead, the agent **streams** it: the UI requests the file directly and the backend serves it in pieces, the way a large image or video loads without stalling. You don't configure this. Just describe what you want ("let me preview large video files", "load this dataset and chart it") and the agent streams when the size calls for it.

> [!TIP]
> If an app feels sluggish loading a big file, tell the agent the files can be large. It can switch to streaming so the UI stays responsive instead of waiting for the whole file at once.

## Performance

A few habits keep large-file apps feeling fast:

- **Load on demand.** Fetch a file when the user opens it, not all of them up front.
- **Show progress.** For anything that takes a moment, ask for a loading state so the app doesn't look frozen.
- **Right-size what's bundled.** Files the app ships with should be optimized; files the user supplies are streamed at runtime. The agent handles this distinction, but it's worth naming if an app feels heavy.

For everyday reading and writing of files, see [Files & Data](/capabilities/files-and-data), which covers the smaller end of the spectrum.

## External Tools

Some capabilities, like converting media, live in mature command-line tools rather than being rebuilt from scratch, and a Glaze app can call those tools in the background and use their output. Ask for the capability in plain language ("convert these videos to GIFs"), or provide the agent with the name of a specific library you'd like to use. Either way, the agent installs the tool and wires the app to run it.

## Dependencies

There are two kinds of dependency, and the agent manages both:

- **Code libraries** are packaged with your app and install as part of building it. This is the common case and needs nothing from you.
- **External command-line tools** are programs that live on the machine, often using tools like **Homebrew**. When an app needs one, the agent handles installing it and running it for you.

## Portability

An app that depends on an external command-line tool needs that tool present to do its job. That has implications when you share the app:

- **On your Mac**: Everything the agent installed is already there, so the app works.
- **Published Apps**: The app may need to install or check for the tool the first time it runs on a user's Mac. The agent can add that handling for you, so the experience is smooth rather than a confusing failure.

If you plan to share an app that uses external tools, tell the agent. It can make the app handle a missing tool gracefully, prompting to install it rather than breaking. Apps that stay fully self-contained (no external tools) are the most portable by default.

### Why does my app stream large files instead of just loading them?

Streaming serves the file directly to the UI in pieces, so it appears quickly and the app stays responsive. Loading a large file through the app's internal messaging all at once is slow and can make the UI hang, and not provide a great user experience.

### Will an app that uses a command-line tool work when I share it?

It can, but the tool needs to be present on the other person's Mac. Ask the agent to have the app install or check for the tool on first run, so sharing it works smoothly rather than failing silently.
