--- name: launchtowin description: Use Launch to Win (launchto.win) as the data hub for a product launch through the `launchtowin` CLI. Read a product's launch package, change its descriptions, add images and videos to its asset library, and pull a launch kit (copy sized to a directory's form plus exported images) when publishing the product on a directory or website. Trigger on "launchtowin", "Launch to Win", "launch package", "add this screenshot/video to the package", "publish on ", or when a site's submission form asks for the product's name, tagline, description, logo or screenshots. --- # launchtowin — the Launch to Win CLI `launchtowin` is a command on PATH (install: `curl -fsSL https://launchto.win/cli/launchtowin -o ~/.local/bin/launchtowin && chmod +x ~/.local/bin/launchtowin`). It uses the API token the user saved with `launchtowin login`. If `launchtowin whoami` reports no token, ask the user to run `launchtowin login` (the token is on https://launchto.win/cli); never ask for or handle the token yourself. Every command takes `--json` and prints the API response unchanged. Prefer it when you consume the output. Errors with `--json` are JSON on stderr with a `code` (`not_found`, `unauthorized`, `limit_reached`, `validation`, `url_locked`, `unknown_directory`, `bad_role`, ...). Exit codes: 0 ok, 1 API or network error, 2 usage. `launchtowin help` is the full reference. ## Which package A repo can hold `launchtowin.json` (created by `launchtowin init `). Inside that repo every command works without a slug: `launchtowin set …`, `launchtowin publish …`. Elsewhere name the package: `launchtowin …`. `launchtowin list` shows every slug. A bare `launchtowin ` creates the package when it does not exist, so use `launchtowin show` or `list` when you only mean to read. ## Read ```bash launchtowin list launchtowin --json # descriptions (short/medium/long), pricing, categories, links, media URLs, meta.missing launchtowin get descriptions.long # one value, raw launchtowin check # what is missing, and every directory whose form the copy would not pass ``` ## Write ```bash launchtowin set tagline="…" description_short="…" description_medium="…" description=@docs/description.md launchtowin set pricing_model=free platforms=ios,mac categories=utilities keywords="a,b" launchtowin set --for product-hunt tagline="…" # copy for one directory only launchtowin fields # every key, its limit and allowed values launchtowin push # sync launchtowin.json (fields and listed asset files) to the server launchtowin pull # write the server's package back into launchtowin.json ``` Limits: short 200, medium 600, full 10,000 characters. `set` prints warnings for directories whose limits the new copy breaks; shorten and set again. ## Assets ```bash launchtowin assets # library with ids, roles, tags launchtowin assets add shot.png --as screenshot --tags "ios,dark" --title "Home" launchtowin assets add icon.png --as logo launchtowin assets add demo.mp4 --as video launchtowin assets add new.png --replace 42 # new bytes, same title, tags and roles launchtowin assets download --role screenshot --dir ./shots launchtowin assets select 42 --as none # keep the file, drop the role ``` Uploads are idempotent: the same bytes twice return the existing entry. Originals stay in the library; roles (one logo, many screenshots, one video) decide what the package publishes. Add every format and size with tags, select the ones to publish. ## Publish on a directory or site ```bash launchtowin directories --ready # where it fits, with submission URLs launchtowin publish product-hunt --json --dir ./kit # fields trimmed to that form + logo/screenshots exported to its sizes # fill the site's form from the kit, upload the files from ./kit, let the user press submit launchtowin submitted product-hunt --url https://www.producthunt.com/posts/ ``` `publish` marks the submission as in progress. A directory is named by slug, host (`producthunt.com`) or submission URL; without one you get the generic kit (every field, standard sizes) for any site, with `--no-track`. ## Rules - Never print, log or commit the API token (`~/.config/launchtowin/config.json`). - Do not delete packages or assets unless the user asked; `delete` and `remove` need `--yes`. - Submitting a form on a directory is the user's decision; prepare it, then hand over.