Skip to main content

postcraftin

AI-powered LinkedIn post generator using local LLMs via Ollama. Personalized ghostwriter with 6-module profile system, modular onboarding, and CLI interface. A default profile is auto-created on first use via bootstrap.

Features

  • Local LLMs — runs fully on your machine via Ollama, no API costs, no data leaks
  • 6-Module Profile System — Identity, Voice, Audience, Content Strategy, Post History, Technical Preferences
  • Modular Onboarding — Update individual modules with --module flag
  • Few-Shot prompting — provide example posts to calibrate the output to your voice
  • Post length control — kurz (150–500), mittel (1.200–1.500), lang (1.900–2.500 Zeichen)
  • Multiple profiles — manage different personas or clients
  • Dynamic Model Selection — List and select from available Ollama models
  • Config Management — Global and profile-specific settings
  • Folder-Based Profiles — Organized storage with drafts/, published/, brandguide/, templates/, history/
  • 10 Storytelling Templates — Verlierer→Gewinner, AHA-Moment, Weg der Veränderung, and more (use --template <name> in generate, list with profile templates list)
  • Brand Guide Generator — Auto-generates voice.md, vocabulary.md, anti-patterns.md
  • YAML Frontmatter — Posts include metadata (topics, status, word count, LinkedIn URL)

Requirements

  • Python 3.10+
  • Ollama running locally
  • Node.js 18+ (for Web UI)

Installation

CLI

pip install postcraftin

Web UI (optional)

# Install API dependencies
pip install postcraftin[api]

# Start the FastAPI backend
postcraftin-api

# In a separate terminal, start the Next.js frontend
cd frontend
npm install
npm run dev

Open http://localhost:5173 in your browser.

Ports: Frontend dev server defaults to :5173, API server to :8080. Both configurable via env vars (PORT, NEXT_PUBLIC_API_URL, POSTCRAFTIN_API_PORT, POSTCRAFTIN_CORS_ORIGINS).

Cloud models (optional)

# Claude, OpenAI and Gemini in addition to local Ollama models
pip install "postcraftin[cloud]"

Trend research: works without any key (DuckDuckGo). With a free Tavily key (TAVILY_API_KEY or postcraftin config set search_api_key …) it uses Tavily, which finds clearly better topics.

Certificates: Postcraftin trusts your operating system's certificate store, so antivirus HTTPS scanning or a company proxy no longer breaks web requests. Set POSTCRAFTIN_SYSTEM_CERTS=0 to use Python's bundled certificates only.

Usage

# Create a profile (interactive wizard - 6 modules)
postcraftin onboard --name myprofile

# Update specific module only
postcraftin onboard --name myprofile --module voice

# Generate a LinkedIn post with template
postcraftin generate --topic "The future of AI" --template verlierer-gewinner

# List available templates
postcraftin profile templates list

# Initialize templates to profile folder
postcraftin profile templates init --name myprofile

# Manage posts (drafts/published)
postcraftin profile posts list
postcraftin profile posts show <filename>
postcraftin profile posts publish <filename>
postcraftin profile posts set-topics <filename> --topics "AI,Future"

# Generate/regenerate brand guide
postcraftin profile brandguide --name myprofile --regenerate

# List available Ollama models
postcraftin models

# Select model interactively
postcraftin config model --select

# Show global config
postcraftin config

# Set profile-specific model
postcraftin profile set myprofile model gemma4:e2b

# List all profiles
postcraftin list-profiles

Measure post quality

# Generate 12 test cases (3 synthetic profiles, TOFU/MOFU/BOFU) and score them; compare models
postcraftin eval run --model gemma4:e2b --model mimo-v2.6:latest --out my-run

# Blind test "human or AI?": mix the generated posts with human posts (one .txt per post)
postcraftin eval blindtest my-run --human path/to/human-posts
postcraftin eval blindtest-score my-run

Reports and results stay in your data folder (~/.postcraftin/eval/), never in the repository.

Default Model

gemma4:e2b — the default model for LinkedIn post generation.

First time? Pull the model with:

ollama pull gemma4:e2b

Want a different model? Browse all available models at: https://ollama.com/library

Configuration

Setting Location Description
Global Model ~/.postcraftin/config.json Default model for all profiles
Profile Model ~/.postcraftin/profiles/{name}/config.json Profile-specific model (optional)
Profiles ~/.postcraftin/profiles/{name}/ Folder-based profile storage
Drafts ~/.postcraftin/profiles/{name}/posts/drafts/ Draft posts with frontmatter
Published ~/.postcraftin/profiles/{name}/posts/published/ Published posts with LinkedIn URL
Templates ~/.postcraftin/profiles/{name}/templates/ Custom storytelling templates
Brand Guide ~/.postcraftin/profiles/{name}/brandguide/ voice.md, vocabulary.md, anti-patterns.md
History ~/.postcraftin/profiles/{name}/history/ Post statistics and analytics

Environment Variables

The data directory is resolved at runtime — on every path access, never at import time — using this priority:

Priority Variable Description
1 (primary) POSTCRAFTIN_HOME Overrides the whole data directory (tests, CI, portable installs)
2 (alias) POSTCRAFTIN_DATA_DIR Existing alias, kept for e2e tests, scripts and CI
3 (default) — ~/.postcraftin — unchanged default, no data migration
POSTCRAFTIN_HOME=/tmp/postcraftin-data postcraftin generate --topic "Your topic"

License

MIT

Contributing

Contributions welcome! Open an issue or PR.

Thank you to all contributors!

Built with ❤️ for the LinkedIn community.

Open source forever.

Metadata

Release files for postcraftin 2.101.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for postcraftin 2.101.0
File Size Uploaded Provenance Actions
postcraftin-2.101.0.tar.gz 277.3 kB With provenance Details for postcraftin-2.101.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for postcraftin 2.101.0
File Interpreter ABI Platform Actions
postcraftin-2.101.0-py3-none-any.whl Python 3 none any Details for postcraftin-2.101.0-py3-none-any.whl

Total release size: 618.5 kB

Release files / postcraftin-2.101.0.tar.gz

Download URL postcraftin-2.101.0.tar.gz
Size 277.3 kB
Tags Source
SHA-256 checksum
How to use checksums
99fa0026ce969f01b6cd5ad7be647ed2b1da6f3bcedaf58e912724501dfde2b9
BLAKE2b-256 checksum
How to use checksums
ef6d3096bff5a35cc338d770afdfa10326423d3d84321b355bdd77a9f703e4df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

Release files / postcraftin-2.101.0-py3-none-any.whl

Download URL postcraftin-2.101.0-py3-none-any.whl
Size 341.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f593efc48c24f2d17d2ea48f1b0e29e42d3bf7e45c99bfbbc4c114b757ee9506
BLAKE2b-256 checksum
How to use checksums
9fe6600cfa6953c3dc1c0c4b327c2c6bf876102a9baa18c4b46c10e257d96bcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

Security for postcraftin 2.101.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for postcraftin-2.101.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.101.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page