#data command adds JSON or CSV files as bundled resources in your app. These files ship with your app and can be read at runtime — perfect for static content like categories, configuration, or sample data.
What It Does
When you use#data, the AI:
- Adds your JSON or CSV file to the Xcode project as a bundled resource
- Creates the necessary Swift model structs to represent the data
- Writes the parsing logic to load and decode the file at runtime
- Displays the data wherever you describe in your app
Supported Formats
| Format | Best for | Notes |
|---|---|---|
| JSON | Structured data, nested objects, API-like data | Most flexible format |
| CSV | Tabular data, spreadsheets, simple lists | Easy to export from Excel or Google Sheets |
How to Use
Select your file
The file picker opens, filtered to JSON and CSV files. Choose the data file you want to bundle.
Describe how to use it
The file appears as an orange chip below the input. Tell the AI what the data represents and how to display it.
Example Prompts
What the AI Generates
When you attach a data file, the AI inspects its structure and generates:- Model structs — Swift
Codablestructs matching the shape of your data - Parsing logic — Code to load the file from the app bundle and decode it
- UI views — SwiftUI views that display the data however you described
Product struct, a loading function, and a List view showing each product.
For dynamic data that changes after your app is published — like user-generated content, real-time feeds, or data you need to update without shipping a new version — consider using Supabase instead.
JSON vs CSV
When to use JSON
When to use JSON
JSON is the better choice when your data has nested structures, mixed types, or complex relationships. For example, a list of restaurants where each restaurant has a name, address object, and array of menu items.
When to use CSV
When to use CSV
CSV works well for flat, tabular data — think spreadsheets. If your data fits neatly into rows and columns with no nesting, CSV is simple and easy to edit.
Related
Toolkit Overview
See all available # commands and how the toolkit works.
Supabase Overview
Set up a backend for dynamic data that changes over time.