Cargo
A native macOS menu-bar app that brings completed Put.io
media home to a local SSD library that Infuse
reads. Quiet, local-first, no Sonarr/Radarr, no server to run.
Chill / IMDb watchlist / a pasted link
↓
Put.io transfer → completed file → _Inbox on the SSD (resumable download)
↓
identify movie / episode / ambiguous
↓
Movies/Title (Year).mkv
TV Shows/Show (Year)/Season 02/Show (Year) - S02E01.mkv (+ Title (Year).srt)
↓
Put.io copy deleted — only after the local copy is verified
The principle: make it obvious what is happening in Put.io, and make bringing
media home safe and repeatable. Nothing is deleted remotely until a local copy
is verified byte-for-byte, ambiguous files wait in _Inbox for a human, and the
app never rearranges what is already in the library.
What it does
Cargo lives in the menu bar. The item shows live status (account, transfers,
Inbox count) and the actions: Open Cargo ⌘O, Add Transfer… ⌘N, Refresh ⌘R.
Opening the dashboard gives Cargo a normal window and Dock icon; ⌘Q closes
the windows and leaves the background service running. Quit is in the
menu-bar menu.
Every minute (configurable) the background cycle:
- refreshes the Put.io account, transfers and activity feed, mirroring
completed and failed transfers into History,
- walks the video inventory when something landed — folders are listed with a
server-side type filter so sidecars never cross the wire,
- asks Put.io to unpack any archive it finds and removes the archive once
the videos inside exist,
- downloads newly completed video into
_Inbox — streamed into a .part
file, resumed from it after sleep, network loss or a restart,
- classifies and renames Inbox media into the Movies / TV Shows layout,
- sends the Put.io original to the Put.io trash after the local copy matches
Put.io's size and CRC32 and starts with a valid video header,
- fetches a subtitle for what it organized — Put.io's own if it had one,
else OpenSubtitles through EasySubsKit
(hash match, then filename),
- removes sidecars and empty folders, and posts one notification.
Each step is a switch in Settings → Automation.
The dashboard
| Page |
What it is |
| Discover |
Chill Institute release search plus its top movies and series. Selecting a title searches releases with its year; “Send to Put.io” is explicit. |
| Transfers |
Put.io transfers with progress; add, cancel, retry, clean finished. |
| Files |
Put.io's file tree. Queue a download, request extraction, delete (to trash). |
| Inbox |
The _Inbox staging folder: downloads with live progress, the proposed destination, Organize. |
| Library |
The SSD itself, rescanned each cycle. With a TMDB key: posters, completeness (Season 2 · 7 of 10), Find on Put.io for missing episodes. Tabs: All · Movies · TV Shows · Incomplete · Unmatched. Reveal in Finder, Play in Infuse, Open on TMDB, Move to Trash. |
| Watchlist |
The resident's public IMDb Watchlist followed as a desired list: Wanted → Available → Queued → Downloaded → Organized. Connected clients can instead configure My Watchlist, a personal display-only list that never drives resident downloads. |
| History |
What the cycle did, and what needs attention. |
⌘K searches the cached Library and Watchlist by title, year, path or IMDb id
and can hand the query to Discover.
A second Mac
One Cargo owns the SSD and Put.io (the resident); any other Mac runs the
same app as a client and gets the same dashboard, driven over an
authenticated HTTP API. On the resident: Settings → Remote Access →
Copy pairing link. That switches the API to local-network scope and copies
one cargo://pair?url=…&token=… string, using the Mac's Tailscale MagicDNS
name when Tailscale is running. On the client, paste it into Resident
address and Connect — or just open the link.
The client sees the resident's state (refreshed every 15 s) and sends actions
back: transfers, downloads, organize, delete, and watchlist refresh. Each
client can configure its own public IMDb URL in Library → IMDb Watchlist on
macOS or Settings → My Watchlist on iOS. The personal list is persisted by
the resident under that client's stable ID, but remains display-only: it never
joins the resident's desired/download list. Discover search is the client's
own. Put.io, Chill and TMDB credentials, the SSD bookmark and local paths never
leave the resident; the client only holds the bearer token in Keychain.
Loopback is the default scope; local-network scope should sit behind the Mac
firewall or a tailnet, and the token can be rotated at any time.
Requirements
- macOS 14 (Sonoma) or later
- iOS 17 or later for the optional companion app
- A Put.io account. Cargo authorizes in the browser through its registered
OAuth app and the
cargo://oauth/callback scheme; the token lives in Keychain.
- An SSD (or any folder) for the library. Cargo keeps a security-scoped
bookmark to it.
- Optional: a Chill Institute token for Discover,
a TMDB API key for posters and completeness, an OpenSubtitles account for
subtitles, a public IMDb Watchlist URL. All tokens live in Keychain.
Install
Tagged releases ship a notarized zip through GitHub Releases. To build it
yourself:
./scripts/build-app.sh # → ~/Applications/Cargo.app, signed, icon regenerated
# ./scripts/build-app.sh --system # optional: one admin authorization → /Applications/Cargo.app
xcodegen generate
xcodebuild -project Cargo.xcodeproj -scheme CargoIOS -sdk iphonesimulator
Use the same signed install path on every rebuild. The first SSD selection is
stored as a security-scoped bookmark; changing to unsigned or ad-hoc builds,
or launching the old copy from another location, can make macOS ask again.
Needs xcodegen. HouseKit comes from
a release tag pinned in project.yml (menu-bar plate, app icon, settings
window chrome, launch-at-login, shared with the author's other Mac apps).
EasySubsKit needs a sibling checkout next to this repo: ../easysubs
(subtitles). To work in Xcode: xcodegen generate && open Cargo.xcodeproj.
xcodebuild test -project Cargo.xcodeproj -scheme Cargo CODE_SIGNING_ALLOWED=NO
project.yml signs with a stable Apple Development identity rather than
ad-hoc: Keychain and TCC key their grants to the code signature, so an ad-hoc
build would lose the Put.io token and the folder bookmark on every rebuild.
Set your own DEVELOPMENT_TEAM there.
Versioning and changelog
The macOS marketing version is the CFBundleShortVersionString in
Resources/Info.plist; the current development line is 0.9.0, following
the tagged v0.8.0 release. Release tags must match the plist version.
CFBundleVersion is generated from the Git commit count by
scripts/build-number.sh for local release builds and CI, so it should not be
hand-edited. The iOS companion uses the same generated build identity while
keeping its own marketing version in Resources/CargoIOS-Info.plist.
Document unreleased work in CHANGELOG.md. When cutting a
release, move its entries from Unreleased to a dated version heading, update
the marketing version, verify both About surfaces, and push the matching
vX.Y.Z tag.
Settings
⌘, from the menu bar. Put.io (account, disk usage, trash, polling
interval) · Chill (token) · Library (folder, folder names, TMDB key,
OpenSubtitles, IMDb watchlist) · Automation (each background step,
notifications) · Remote Access (API scope, token, pairing, connect as a
client) · General (launch at login) · About.
State is one JSON file in ~/Library/Application Support/Cargo/; the previous
version is kept as state.json.bak, and an undecodable one is set aside as
state.json.corrupt rather than overwritten.
Architecture
AppKit throughout, Swift 6 strict concurrency, no storyboards. Dependencies:
HouseKit, EasySubsKit, SwiftNIO (for the API server).
|
|
CargoApp |
NSStatusItem, menus, URL scheme (oauth, pair, open), background cycle timer, API server lifecycle |
Services/CargoCoordinator (+Chill, Watchlist, PutIO, LocalSync, Library, Inbox) |
The state machine: stored state and the background cycle in the core file, one extension file per concern |
Services/PutIOClient, PutIOOAuth, KeychainStore |
Put.io API (account, transfers, files, resumable download, delete/skip-trash, events, extract, trash), browser OAuth, token storage |
Services/ChillClient |
Chill catalogs, search, episode lookup, explicit Put.io handoff |
Services/LibraryOrganizer |
Release-name parsing, destination preview, atomic move |
Services/LibraryIndex, TMDBClient, OMDBClient |
Disk scan of the library layout; TMDB find/search/season counts, poster cache; OMDb ratings |
Services/IMDbWatchlistService |
Public watchlist fetch and pagination |
Services/SubtitleService |
Put.io subtitle parking + OpenSubtitles via EasySubsKit |
Core/CargoStore |
The JSON state file, with backup and corrupt-file preservation |
Core/CargoRemoteControl |
Remote-safe read models, transport-neutral commands, presence registry |
Services/CargoRemoteAPI, CargoHTTPServer |
HTTP API v1 (bearer token, constant-time compare), discovery, Tailscale peer auto-find, client session |
Packages/CargoRemoteKit |
Foundation-only remote models, commands, pairing, URLSession client, and contract tests shared with iOS |
Sources/CargoIOS |
SwiftUI companion target; resident connection, Keychain token, polling, mobile dashboard |
UI/* |
Dashboard window, pages, tables, poster grid, ⌘K search, settings pages |
HTTP API
http://127.0.0.1:39817 by default (0.0.0.0 in local-network scope). Every
route except /v1/discovery needs Authorization: Bearer <token>.
GET /v1/health
GET /v1/discovery (unauthenticated: name, instance id, port)
GET /v1/state full remote-safe snapshot
GET /v1/transfers | /v1/files | /v1/inbox | /v1/library | /v1/watchlist
GET /v1/events?since=<revision> change feed; snapshot included when changed
GET /v1/presence
POST /v1/presence/register | /heartbeat | /unregister
GET /v1/discover/catalog
POST /v1/discover/search {"query":"The Bear 2024"} (stateless)
POST /v1/commands {"type":"refresh"}
Commands: refresh, refreshChillCatalog, sendChillRelease,
sendChillMovie, addTransfer, cancelTransfer, retryTransfer,
cleanFinishedTransfers, requestExtraction, deleteRemoteFile,
enqueueLocalSync, organizeLocalJob, refreshWatchlist,
refreshPersonalWatchlist, clearFailedJobs, clearHistory. Client-scoped
requests carry X-Cargo-Client-ID; the resident uses it to select the
personal watchlist snapshot and persisted URL.
cargoctl wraps this API for the terminal and for agents. It also reads Cargo's
state file, Put.io's unfiltered listings, and Cargo's log. cargoctl help lists
the commands.
cargo-mcp serves the same commands as MCP tools over stdio, for Claude and
other local agents. Register it with claude mcp add cargo -- ~/.local/bin/cargo-mcp,
or give other clients the absolute path to ~/.local/bin/cargo-mcp as the command.
See PLAN.md for milestones and BUILD_ISSUES.md
for the working notes on risks — both are the author's ledgers rather than
polished docs.
iOS companion
The iOS target is a client only. It never receives Put.io, Chill, TMDB,
subtitle, or SSD credentials; it stores only the resident address and bearer
token in the iOS Keychain. Pair it by opening or pasting the resident's
cargo://pair link. The app uses the revisioned /v1/events feed while
foregrounded and shows the last cached snapshot after a relaunch. Its
Settings → My Watchlist URL is personal to that iPhone.
License
MIT — see LICENSE.