# Blink App

> Read and write data in a linked Blink project's database and file storage. Use to manage app data, query users, update records, upload/download files. Requires BLINK_PROJECT_ID secret to be set first.

- Skill: `blink-new/blink-app` (Agent Skill)
- Install (CLI): `npx skillmds@latest add blink-new/blink-app`
- Raw SKILL.md: https://api.skillmd.com/api/skills/blink-new/blink-app/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: blink-new (https://skillmd.com/u/blink-new)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/blink-new/blink-app

---


# Blink App — Project Database & Storage

Access a linked Blink project's isolated SQLite database and file storage using `blink db` and `blink storage`.

## Setup (one-time)
Store your project ID as an agent secret:
```bash
blink secrets set BLINK_PROJECT_ID proj_xxx
```
Get your project ID from **blink.new → your project → Settings → API Keys**.

---

## Database

### Query the database
```bash
blink db query $BLINK_PROJECT_ID "SELECT * FROM users LIMIT 10"
```

### Count records
```bash
blink db query $BLINK_PROJECT_ID "SELECT count(*) as total FROM orders WHERE status = 'pending'"
```

### Insert a record
```bash
blink db query $BLINK_PROJECT_ID "INSERT INTO tasks (id, title, done) VALUES ('t_123', 'My task', 0)"
```

### Execute a SQL file
```bash
blink db exec $BLINK_PROJECT_ID schema.sql
```

### List all tables
```bash
blink db list $BLINK_PROJECT_ID
```

### Show rows in a table
```bash
blink db list $BLINK_PROJECT_ID users
```

---

## Storage

### Upload a file
```bash
blink storage upload $BLINK_PROJECT_ID ./report.pdf --path reports/2024/report.pdf
```

### List files
```bash
blink storage list $BLINK_PROJECT_ID
blink storage list $BLINK_PROJECT_ID images/
```

### Get a public URL for a file
```bash
blink storage url $BLINK_PROJECT_ID images/logo.png
```

### Download a file
```bash
blink storage download $BLINK_PROJECT_ID reports/2024/report.pdf ./local-report.pdf
```

### Delete a file
```bash
blink storage delete $BLINK_PROJECT_ID old-file.pdf
```

---

## Command signatures
```
blink db query <project_id> <sql>
blink db exec <project_id> <file.sql>
blink db list <project_id> [table]
blink storage upload <project_id> <local_file> [--path <storage_path>]
blink storage list <project_id> [prefix]
blink storage url <project_id> <storage_path>
blink storage download <project_id> <storage_path> [output_file]
blink storage delete <project_id> <storage_path>
```
All commands use `$BLINK_PROJECT_ID` from the agent secrets vault.

