Skip to content

Scripts

The project includes 4 utility scripts in scripts/.

tiktok-login.ts

Interactive TikTok login for initial session setup. Opens a visible browser window so you can solve the CAPTCHA manually.

bash
bun run tiktok:login

Session state is saved to ./data/browser-state/ and reused by the publisher on subsequent runs.

test-llm.ts

Tests the LLM structured output pipeline (post rewriting to conversation format).

bash
bun run test:llm

Useful for verifying your LLM endpoint (Ollama + LiteLLM) is correctly returning JSON conversations.

e2e-video-test.ts

End-to-end video generation test using a hardcoded sample Reddit post. Prompts you to choose a pipeline format:

bash
bun run e2e:video
  • classic — TTS synthesis + word-highlighted captions + FFmpeg composition
  • messages — LLM conversation rewrite + iMessage frame rendering

Does not publish to TikTok. Outputs the video path for manual review.

e2e-pipeline-test.ts

Full end-to-end pipeline test including TikTok publish. Fetches a real Reddit post, generates video, and uploads.

bash
bun run e2e:pipeline

Prompts for pipeline format selection. Sets VIDEO_FORMAT before bootstrapping NestJS so the config picks it up correctly.

WARNING

This script will publish a real video to your TikTok account. Use with caution.

Built with VitePress