AI Article Automation by One Command
READ2 — Step-by-Step Setup
==========================

Follow in order. Replace YOUR_WINDOWS_USERNAME / YOUR domain / YOUR VPS values.


STEP 1 — Unzip
--------------
1. Download the product .zip
2. Unzip it
3. Move the whole folder to:
   C:\Users\YOUR_WINDOWS_USERNAME\AI-Article-Automation-1Command
4. Confirm this file exists:
   C:\Users\YOUR_WINDOWS_USERNAME\AI-Article-Automation-1Command\SETUP-First\READ1-Requirements.txt


STEP 2 — Read requirements
--------------------------
Open SETUP-First\READ1-Requirements.txt and verify your PC meets them.


STEP 3 — Edit settings
----------------------
Open SETUP-First\CHANGE-Settings.yaml in Notepad or VS Code.

Fill in at least:
- product_root
- articles_repo
- deploy_root
- website.name
- website.origin
- website.blog_list_url
- sources (RSS or blog feed URLs; each publish rotates to the next source)
- blog_posts_per_page
- fonts (names; optional font files listed under fonts.files)
- article_display options (Published by / date / tags) — defaults are ON
- images.section_placement (text_width | full_width | custom) — section images only; hero stays as-is
- images.section_css_class / images.section_custom_css (for custom website CSS styling)
- fonts / article_style (empty = inherit website root css/styles.css; optional article overrides)
- website.site_stylesheet (root site CSS path; product never overwrites it)
- website.section_heading_class (blog preview titles use this site heading class; default section-title)
- ollama.model
- deploy.ssh_host / ssh_user / remote_web_root
- deploy.auth_mode stays "password" by default (manual password when uploading)
- github.enabled = true/false (+ repo if true)

DO NOT put passwords or API tokens into CHANGE-Settings.yaml.


STEP 4 — Optional custom fonts
------------------------------
1. Copy .ttf / .otf / .woff2 into SETUP-First\fonts\
2. In CHANGE-Settings.yaml under fonts.files, add file + family name
3. Set fonts.title / subtitle / body to use that family name


STEP 5 — Run automated setup checks/installers
----------------------------------------------
Open PowerShell and run these one by one:

cd "C:\Users\YOUR_WINDOWS_USERNAME\AI-Article-Automation-1Command\SETUP-First\scripts"

powershell -ExecutionPolicy Bypass -File .\01-check-system.ps1

powershell -ExecutionPolicy Bypass -File .\02-install-dependencies.ps1

powershell -ExecutionPolicy Bypass -File .\03-install-ollama-model.ps1

Notes:
- 02 may install Python/Git/Ollama via winget if missing (can require approval)
- 03 downloads the model named in CHANGE-Settings.yaml (can be many GB)
- Then it creates Python venv and installs Python packages for the app


STEP 6 — SSH access to YOUR VPS (default = password)
----------------------------------------------------
Default mode is password:
- Keep deploy.auth_mode: "password" in CHANGE-Settings.yaml
- During publish/upload, OpenSSH will ask for your server password in the terminal
- Never save the password into product files

Optional passwordless key setup:
- Open folder Auto-password-ssh-setup\
- Read README.txt and READ-SSH-Key-Setup.txt


STEP 7 — Optional GitHub
------------------------
If github.enabled is true:
1. Create a GitHub repository
2. Sign in with Git Credential Manager when Git asks
3. First publish run will init/push articles-repo


STEP 8 — Prepare images for first article
-----------------------------------------
Put images into:
  SETUP-First\IMAGES\1\

Rules:
- 1 hero + N section images
- If more images than sections: extras are ignored
- If fewer images than sections: missing slots stay text-only
- Preferred names: 0.webp (hero), 1.webp, 2.webp...
- Section image width is controlled in CHANGE-Settings.yaml → images.section_placement:
    text_width (default) | full_width | custom (your website CSS)


STEP 9 — Dry run (recommended first)
------------------------------------
See FINAL-Command.txt section "Dry run".
This generates/builds locally without uploading.


STEP 10 — Live publish
----------------------
See FINAL-Command.txt.
Use -ImageSet 1 (or 2..10) matching your IMAGES folder.


STEP 10b — Delete a published article (optional)
-----------------------------------------------
See FINAL-Command.txt section F.
Pass the public article URL to run_delete_article.ps1 to remove it from the VPS
(and locally by default), then refresh blog.html.
Optional: -Topic "Your custom topic"
Optional: -DryRun
Default auth is password (you will be prompted).
Optional key mode: see Auto-password-ssh-setup\


STEP 11 — Verify
----------------
Open your live blog URL from CHANGE-Settings.yaml and confirm the new article.


TROUBLESHOOTING
---------------
See FINAL-Command.txt "If something fails".
