Skip to content

patcon/tshirt-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tshirt-cli

Order a custom t-shirt from stdin via Printify.

Usage

tshirt << 'EOF'
the mind that is not baffled is not employed,
the impeded stream is the one that sings
EOF
echo "what a strange time it is to be a dead star reanimated by chance and patience" | tshirt --subscript "x.com/hormeze"

That's it. Text goes in, t-shirt comes out.

How it works

  1. Renders your text as a 4500x5400px PNG
  2. Uploads the image to Printify
  3. Creates a product and places an order (after confirmation)

Prerequisites

  • Python 3.11+
  • A Printify account with an API key
  • A configured shop with at least one product blueprint

Installation

uv pip install -e .   # or: pip install -e .

Setup

Run the setup wizard once before placing orders:

tshirt setup

The wizard will prompt for:

  1. API key — your Printify API key
  2. Shop — select from your Printify shops
  3. Blueprint — select a t-shirt product blueprint
  4. Print provider — select a fulfillment provider for that blueprint
  5. Variant — select size/color/style
  6. Shipping address — name, address, email, etc.

Config is saved to ~/.config/tshirt/config.toml (chmod 600).

Commands

# Place a real order (confirms before charging)
echo "Hello, World!" | tshirt

# Render preview only — saves tshirt-preview.png, no order placed
echo "Hello, World!" | tshirt --dry-run

# Re-run the setup wizard to update config
tshirt setup

Config file

Location: ~/.config/tshirt/config.toml

api_key = "your-printify-api-key"
shop_id = "12345678"
blueprint_id = 5
print_provider_id = 99
variant_id = 18432
price_cents = 3000

[shipping]
name = "Jane Doe"
address1 = "123 Main St"
city = "Toronto"
region = "ON"
zip = "M5V 1A1"
country = "CA"
email = "jane@example.com"

Image rendering

Text is rendered as a 4500x5400px PNG with a white background and black text. Font size is auto-scaled to fit. Multiline text is supported — newlines in stdin are preserved.

Dependencies

  • click — CLI framework
  • httpx — HTTP client for Printify API
  • Pillow — image rendering
  • tomli-w — config file writing

About

Order a custom t-shirt from stdin via Printify.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages