scripts/ directory to streamline setup, validation, and operations. All scripts should be run from the project root directory.
Available Scripts
setup_local.sh
Automated local development bootstrap script that configures your environment for local-first operation. Location:scripts/setup_local.sh
Purpose:
- Creates Python virtual environment if it doesn’t exist
- Installs/updates all Python dependencies from
requirements.txt - Copies
config.example.jsontoconfig.jsonif not present - Auto-detects ImageMagick and Firefox profile paths
- Configures default local providers (Ollama, Whisper, etc.)
- Automatically selects the best available Ollama model from your installed models
- Runs preflight checks to validate setup
- Environment Setup: Creates
venv/and installs dependencies - Configuration: Sets sensible defaults in
config.json:llm_provider:local_ollamaimage_provider:local_automatic1111stt_provider:local_whisper
- Path Detection: Automatically finds and configures:
- ImageMagick binary path (
magickorconvert) - Firefox profile directory (macOS-specific detection included)
- ImageMagick binary path (
- Model Selection: Queries your local Ollama instance and selects from preferred models:
glm-4.7-flash:latestqwen3:14bphi4:latestphi4:14bgpt-oss:20bdeepseek-r1:32b
- Validation: Runs
preflight_local.pyto verify everything works
preflight_local.py
Pre-flight validation script that checks your local environment before running automation tasks. Location:scripts/preflight_local.py
Purpose:
- Validates
config.jsonexists and is readable - Checks ImageMagick installation (required for subtitle rendering)
- Verifies Firefox profile path (required for Twitter/YouTube automation)
- Tests Ollama connectivity and lists available models
- Validates Nano Banana 2 (Gemini) API configuration
- Confirms
faster-whisperinstallation for local STT
0: All checks passed1: One or more blocking issues detected
imagemagick_path is not set
imagemagick_path is not set
Issue: ImageMagick path not configured in
config.jsonImpact: Subtitle rendering in videos will failFix: Install ImageMagick and set the path in config.json:firefox_profile is empty
firefox_profile is empty
Issue: Firefox profile path not configuredImpact: Twitter and YouTube automation features will not workFix: Set your Firefox profile path in
config.json. See troubleshooting guide.No models found on Ollama
No models found on Ollama
Issue: Ollama is running but has no models installedImpact: LLM-based text generation will failFix: Pull a model:
upload_video.sh
Interactive script for uploading generated videos to YouTube Shorts. Location:scripts/upload_video.sh
Purpose:
- Lists all configured YouTube accounts from
.mp/youtube.json - Prompts user to select an account
- Triggers video generation and upload via
src/cron.py
- YouTube account configured in
.mp/youtube.json - Firefox profile with logged-in YouTube session
- Generated video content (or will generate new content)
- Reads
.mp/youtube.jsonto get configured accounts - Displays account IDs
- Validates user selection
- Executes:
python src/cron.py youtube <account_id>
.mp/youtube.json should look like:
Script Best Practices
Running Scripts
Always run scripts from the project root:Script Permissions
Ensure scripts are executable:Environment Activation
Some scripts expect an activated virtual environment:Debugging Scripts
Enable verbose output inconfig.json:
Creating Custom Scripts
You can create your own scripts in thescripts/ directory. Follow these guidelines:
Shell Script Template:
- Calculate
ROOT_DIRrelative to script location - Use the virtual environment Python binary
- Return appropriate exit codes (0 = success, 1 = failure)
- Follow existing naming conventions