| layout | default |
|---|---|
| title | Installation and first draft |
This is the shortest path from a Markdown file to a safe unpublished Substack draft.
python -m pip install python-substack
substack --versionCreate a .env file in your working directory. Cookie authentication is
usually the most reliable option:
COOKIES_PATH=cookies.json
PUBLICATION_URL=https://example.substack.comSee authentication and cookies for browser-cookie export, password authentication, and secret-handling guidance.
Confirm the selected account and publication:
substack statusSave this as first-draft.md:
# My first automated draft
This draft was created from **Markdown**.
- Review it in Substack.
- Publish only when it is ready.Markdown source:
Rendered in Substack:
substack drafts create first-draft.mddrafts create always creates an unpublished draft. It never schedules,
sends, publishes, or deletes content. Open the returned draft ID in Substack
and review it there.
Continue with the unified CLI guide or use the Python SDK.

