Get started with York
Shared folders, text files, Office documents, PDFs and SQLite databases. Read and write local copies with your usual tools; York keeps them in sync with your account.
Create your first database
Install York, make an ordinary SQLite file, then link it. The first York command opens the browser to sign in.
curl -fsSL https://york.so/install.sh | sh
export PATH="$HOME/.cargo/bin:$PATH" # york is usable in this shell right away
sqlite3 notes.db <<'SQL'
CREATE TABLE notes (
id INTEGER PRIMARY KEY,
body TEXT NOT NULL, -- the note itself
created_at TEXT DEFAULT CURRENT_TIMESTAMP
);
SQL
york link notes.db -d "Things I want to remember" # signs in once, then syncs
sqlite3 notes.db "INSERT INTO notes (body) VALUES ('buy milk')"
sqlite3 notes.db "SELECT * FROM notes"
york sync status # wait for synced (0 pending)
sqlite3 notes.db "SELECT * FROM _york_notes"Already have a file?
york link app.db syncs an existing SQLite file where it is, including its schema and rows. Linking is never charged. If interrupted, rerun the same command to restart the upload or finish the saved link. On another machine, york connect notes downloads a synced copy.
When to use York
Use York for files agents read and write: instructions, skills, memory, notes, config and the SQLite databases behind the apps they build. York merges edits from every machine instead of keeping the last save, and an unplaced edit is reported, never dropped.
Use git for source code, where a conflict should stop the merge for a person to resolve. Use Dropbox or iCloud for documents and photos; copying a live SQLite file with them can corrupt it, while York syncs it row by row.
Sync a text file
Link an existing UTF-8 text file: markdown, CSV, JSON, YAML or anything else that isn’t SQLite. York keeps it at the same path.
york link notes.md
york sync statusOffice documents (.docx, .xlsx, .pptx, .doc, .xls, .ppt, .odt, .ods, .odp) and PDFs link the same way: york link report.pdf. People you share them with can download them from the web up to 4 MiB; larger documents need york connect.
Working with an agent
- Discover first. Run
york list, thenyork describe <name>before reading or writing. Schema comments explain each column. - Edit locally. Use your usual tools; York never needs to be called for data. Re-read text files before editing and prefer targeted edits to rewriting the file.
- Check the result. Integer primary keys can be renumbered. Read
_york_notesfor changes York made, then delete notes you have dealt with.
Guides for specific agents say where each keeps its files and what to leave out: Claude Code, OpenClaw, Muse, Codex, Dots, OpenCode, Goose, Hermes, Spark, Cowork, Manus, OpenHands.
CLI configuration
| Setting | Purpose |
|---|---|
YORK_SERVER | Use another server. |
YORK_TOKEN | Override the stored token. |
~/.config/york/credentials.json | Stored credentials; YORK_CONFIG_DIR overrides the configuration directory. |
SQLite: writes stay local, changes travel
Each copy is an ordinary SQLite file in WAL mode. The daemon notices writes within half a second and pushes bounded bursts with shared request pacing. It durably receives remote changes while local writes queue. Conflicting rows wait for acknowledgement; unrelated rows and columns keep updating.
| Situation | Result |
|---|---|
| Offline writes | Queue in the file, then push on reconnect. Status never says synced with unsent changes. |
| Same column edited twice | Last change to reach the server wins; the other writer gets a note. Different columns in one row both apply. |
| Rejected write | Undone locally and noted: CHECK, NOT NULL, UNIQUE, foreign-key failures, an update to a deleted row, read-only access or the storage limit. |
| Duplicate integer primary key | The later row gets a new key; declared foreign-key references follow. York records a note. |
| Unwanted update or delete | Restore through the file's Backups tab. Every copy resets with a restored note. |
| Schema migration | Every copy resets with a migration note. Direct schema edits cause drift and stop that copy syncing until york sync reset. |
Check or recover a copy
york sync status # daemon, file states and unsent changes
york sync reset notes # saves notes.db.york-drift, replaces from shared copyText files: saves become text patches
- Every copy applies the same patches in the same order. The local file holds the merged text.
- Patches use surrounding text to find their place. If someone removed that context, the unplaced edit appears in
york sync status; it is never dropped silently. - An older copy’s save does not erase edits merged since. Known exception: a line removed within 10 minutes of being merged, together with another edit, comes back.
- Merges never stop for a conflict, which suits notes, docs, config and data. Use git for source code, where a conflict should stop the merge.
- Files must be UTF-8 and free of NUL bytes. Up to 4 MiB they merge; from there to 32 MiB each save replaces the whole file, as with a document. Connecting refuses an existing path.
- Office documents and PDFs can’t be merged. Each save replaces the whole file. If two saves cross, the later one wins and every copy keeps the other beside the file as
name (conflict date).ext, with a note inyork sync status. Conflict copies are not synced.
Folders
york link skills syncs a folder. On another machine, york connect skills downloads it to ./skills; york connect skills <dir> chooses a new or empty directory. Read, edit, create, move and delete files with your usual tools.
York merges other people's changes into this folder. Re-read files before editing them, and prefer edit tools over rewriting whole files.
- Any extension, at most 32 MiB per file (SQLite databases follow the plan's storage limit instead) and 1,000 files per folder. Text files up to 4 MiB merge; files first seen larger, and binary files such as images, PDFs and Office documents, are replaced whole, and if two saves cross, the other version is kept as a conflict copy. Subfolders sync; empty directories do not. Over 1,000 files blocks syncing.
- Skipped:
.git,node_modules,.DS_Store,.venv,__pycache__,target,*.swp,*~,.#*, York temp files (.*.york-*.tmp) and symlinks. Agent runtime databases are skipped too:state.db,sessions.db,openclaw-agent.sqlite,.openclaw/memory/*.sqlite, Codexstate_N.sqliteandlogs_N.sqlite, and SQLite-wal,-shmand-journalfiles. So are agent session logs:*.jsonlunder.claude/projects,.codex/sessionsand.codex/archived_sessions. Other SQLite databases sync as their own linked files inside the folder. - A text file York already syncs that grows past 4 MiB, or any other file over 32 MiB that isn't a SQLite database, is skipped: left alone, never treated as deleted. Check
york sync statusfor skipped files and merge notes. - If a large deletion is blocked,
york sync reset skillsaccepts those deletes on the next tick.
Schema rules
| Feature | Rule |
|---|---|
| Primary keys | Required on every table, with non-null row values and BINARY collation. Integer keys may be renumbered; use TEXT or a separate UNIQUE column for meaningful numbers such as barcodes. |
| Foreign keys | Only NO ACTION and RESTRICT actions. No deferred foreign keys. |
| Unsupported objects | User triggers and virtual tables, including FTS. |
| Reserved names | Columns named with __, _york, _cf_ or sqlite_ are refused. Objects starting with _york belong to York. |
| Blobs | Values over about 1 MiB cannot sync. |
Command reference
| Command | Behavior |
|---|---|
york login [--server URL] | Connect this machine to your account. Opens the browser once and stores an account-wide token. Other commands do this automatically when not logged in. |
york logout | Revoke the stored token and forget it. |
york whoami | Show the account, and the file and role if the token is scoped. |
york list | List your files, invitations and files shared with you (as <person>/<name>, with the stable <owner-id>:<name>). |
york usage [--json] | Plan, files used and your invite link. |
york create <name> [-d DESCRIPTION] | Create an empty database. The description is shown to future agents by describe. |
york describe <name> [--json] | Purpose, notes, schema (with SQL comments) and row counts. Run this before reading or writing a file. |
york connect <name> [path] | Download a file (yours, or shared with you, accepting the invitation) to a new local path, default ./<name> for folders, ./<name>.db for SQLite or ./<name> with the original extension for text files, and sync it. |
york link <path> [--name NAME] [-d DESCRIPTION] | Adopt an existing folder, UTF-8 text file or SQLite database and sync it where it is. SQLite files bring their schema and rows. |
york share <name> <@username|email|name> [--read] | Invite someone with write access, or read-only with --read. Sharing with someone new waits for the owner's browser approval. |
york share <name> | List who has access to a file you own, with the handle to pass to york unshare. |
york unshare <name> <@username|email|name> | Revoke someone's access to a file you own, or cancel an invitation they haven't accepted. |
york invites | List every invitation waiting for you, including from people you haven’t shared with yet and ones sent to your email. |
york invites accept|decline <name> | Decide an invitation. The first from someone new waits for browser approval unless approvals are off. york connect <name> accepts and downloads in one step. |
york approvals [on|off] | Show or change whether drops, destructive migrations, sharing with someone new and first invitations from someone new wait for browser approval. |
york people | List people you've shared with, ranked by sharing frequency and recency, with usernames and private nicknames. |
york people rename <who> <nickname> | Set a private nickname using a contact id, name, nickname or username. |
york sync status | Whether the sync daemon runs, and each local file's state and number of unsent changes. |
york sync install | Run the sync daemon as a launchd or systemd user service. connect and link do this when no daemon runs. |
york sync run | Run the sync daemon in the foreground (what the service runs). |
york sync reset <name> | Save a drifted file beside itself as <file>.york-drift, then replace it from the shared copy. |
york migrate <name> "<sql>"|- | Run a schema change script ("-" reads stdin). Destructive changes wait for browser approval. |
york export <name> > backup.sql | Dump schema and all rows as SQLite SQL. Restore with sqlite3 restored.db < backup.sql. |
york token <name> [--role read|write] | Mint a token that can only access one file. Default role: write. |
york update | Install the newest release over this binary and restart the sync service. Beta builds follow beta releases. |
york drop <name> | Delete a file. Waits for you to approve in the browser. |
Actions that need approval
Dropping a file, a migration that removes a table or column, deletes rows or overwrites values, sharing with someone new, and accepting a first invitation from someone new need browser approval. The CLI prints a link and waits for the owner.
To skip the browser, run york approvals off or turn it off in Settings → Agents. Account-wide tokens then act straight away; file-scoped tokens still ask. Any agent with your login can change this setting, so treat it as a convenience, not a lock.
Token scope and lifetime
| Token | Access |
|---|---|
york login | Account-wide. |
york token <name> | One file, with read or write access. |
Tokens never expire. Revoke them in the dashboard.
Server checks
Each synced change is validated against the live schema and applied with bound values. Migrations run SQL supplied by the client. ATTACH and most PRAGMAs are blocked on the server.
Choose a file allowance
| Plan | Price | Owned files | Sharing per file | Storage |
|---|---|---|---|---|
| Free | $0 | 5 | 1 person | 300 MB |
| Pro | $6/month | 100 | Anyone | 1 GB |
A file is anything you sync: a folder, text file, Office document, PDF or SQLite database. Files shared with you do not count. Each person you invite who pays for Pro once permanently adds one file to your limit.
Request limits
| Requests / minute | Per account | Per IP |
|---|---|---|
| Control plane | 120 | 240 |
| Sync | 3,600 | 7,200 |
Throttled requests return HTTP 429 with Retry-After: 60.
From invitation to local copy
- Invite. Use a file’s Share button with an exact @username, email or contact name. Choose read-only or read and write. CLI:
york share <name> <@username|email|name> [--read]. Sharing with someone new waits for the owner’s browser approval. - Accept. Recipients can join from their dashboard, or run
york invitesandyork connect <name>. The first invitation from someone new waits for browser approval unless approvals are off. - Connect. The recipient runs
york connect <person>/<name>to accept an eligible invitation and get a local file.
To see who has access, open the file’s Share button or run york share <name>. To end someone’s access or cancel an invitation, use Revoke there or run york unshare <name> <@username|email|name>. Revoking never needs approval.
People with write access can edit the file, including adding, changing and deleting SQLite rows. If access ends, their file remains as an unsynced copy with a note.
Restore or take a backup
| Need | Action |
|---|---|
| Undo unwanted changes | Owners can restore to any time in the past 30 days from the file's Backups tab. |
| Portable SQL backup | york export <name> > backup.sqlRestore with sqlite3 restored.db < backup.sql. |
Make a request
Send Authorization: Bearer <token> with JSON bodies. Errors return { "error": "..." }. File names use lowercase letters, digits, - or _, up to 63 characters.
After signing in with the CLI and creating notes, mint a read-only token and fetch its description:
YORK_API_TOKEN=$(york token notes --role read)
curl -fsS https://york.so/api/files/notes -H "Authorization: Bearer $YORK_API_TOKEN"Endpoint reference
| Method and path | Request / response |
|---|---|
POST /api/device/code | Starts a device login (what york login does): { device_code, user_code, verification_uri, verification_uri_complete, interval, expires_in }. No token needed. |
POST /api/device/token | { device_code } polls the login. Returns 400 { error: 'authorization_pending' } until approved in the browser, then { token } (account-wide). |
GET /api/whoami | { email, role, file } |
GET /api/usage | Account usage (account-wide token). |
GET /api/files | { files: [...] } |
POST /api/files | { name, description?, notes? } creates a database. |
GET /api/files/:name | Describe: schema, notes, row counts. |
GET /api/files/:name/export | SQL dump. |
POST /api/files/:name/migrate | { migrations: [{ sql }], notes? }. Returns 202 with an approval when destructive. |
DELETE /api/files/:name | Returns 202 with an approval link. |
GET /api/approvals/:id | { status: pending | executing | done | denied | failed | expired, error } |
POST /api/tokens | { file, role? } mints a scoped token. |
DELETE /api/tokens/current | Revokes the calling token. |
GET /api/people | { people: [{ id, name, username, nickname }] }, ranked by sharing frequency and recency. |
PUT /api/people/nickname | { person, nickname } sets a private nickname; person is a contact id, name, nickname or username. |
POST /api/files/:name/shares | { to, role? } invites by exact @username, email or contact name/nickname. Role defaults to write. Returns 200 { invited: true } for a contact, or 202 { approval: { id, url, status } } for someone new; the agent waits for the owner's browser approval. |
GET /api/files/:name/shares | Owner only. { people: [{ name, username, nickname, email, role, accepted, handle }] }: guests and pending email invitations. handle is what DELETE accepts. |
DELETE /api/files/:name/shares | Owner only. { to } revokes a guest's access or cancels a pending invitation, by @username, email or contact name. Never needs approval; 404 if that person has no access. |
GET /api/invites | { invites: [{ name, display_name, from, role, new_person }] }, every invitation waiting for this account. |
POST /api/shares/accept | { file } accepts an invitation. Returns 202 with an approval for a first invitation from someone new. |
POST /api/shares/decline | { file } declines an invitation. |
GET|PUT /api/settings | { browser_approvals: boolean }. When false, requests that would return 202 run immediately for account-wide tokens and return 200. |
/api/files/:name/sync/* | Push, pull, digest, snapshot and import, used by the york sync daemon. There is no endpoint that runs SQL. |