Skip to content

CLI Reference

DroidBot is operated primarily through Python scripts, the Flask server, and pytest. This page covers all CLI entry points.

Terminal window
python3 run.py

Starts the Flask server on http://localhost:5055 with the scheduler daemon thread, all API endpoints, and the dashboard.

For debug mode:

Terminal window
python3 -c "from marketing_system.server import app; app.run(host='0.0.0.0', port=5055, debug=True)"
VariableRequiredPurpose
DEVICEIf multiple phonesDefault ADB serial
KIE_AI_API_KEYFor video generationKIE AI API key
OPENROUTER_API_KEYFor LLM featuresOpenRouter API key
OPENAI_API_KEYFor Sora video genOpenAI API key
ANTHROPIC_API_KEYFor Claude backendAnthropic API key
FREEIMAGE_API_KEYFor image hostingFreeImage API key
POSTHOG_API_KEYFor analyticsPostHog project key

All bot scripts are in marketing_system/bots/tiktok/ and can be run directly.

Terminal window
# Crawl top tab
python3 -m marketing_system.bots.tiktok.scraper "#Cat" \
--tab top --date-filter "Past 24 hours" --passes 5
# Crawl users tab
python3 -m marketing_system.bots.tiktok.scraper "#Dog" \
--tab users --passes 3
FlagDefaultDescription
queryrequiredHashtag to search
--tabtopSearch tab (top, users)
--date-filterNoneTime filter
--passes3Scroll passes
--sortRelevanceSort order
Terminal window
python3 -m marketing_system.bots.tiktok.outreach \
--strategy-id 1 --min-followers 10000 --delay 60 --limit 20
FlagDefaultDescription
--strategy-idrequiredMessage template ID
--min-followers0Minimum followers
--max-followersNoneMaximum followers
--delay60Seconds between DMs
--limitNoneMax DMs to send
--labelNoneTarget label
Terminal window
# Upload as draft
python3 -m marketing_system.bots.tiktok.upload /path/to/video.mp4 \
--caption "Check this out!" --hashtags "cat,aicat" --action draft
# Upload and post immediately
python3 -m marketing_system.bots.tiktok.upload /path/to/video.mp4 \
--caption "Amazing!" --hashtags "viral,fyp" --action post
# Upload with TTS
python3 -m marketing_system.bots.tiktok.upload /path/to/video.mp4 \
--caption "Listen!" --inject-tts --action draft
Terminal window
python3 -m marketing_system.bots.tiktok.perf_scanner --num-posts 5
Terminal window
python3 -m marketing_system.bots.tiktok.engage \
--duration 300 --like-pct 30 --comment-pct 5 --favorite-pct 10
Terminal window
python3 -m marketing_system.bots.tiktok.inbox_scanner --max-scrolls 10
Terminal window
python3 -m marketing_system.bots.tiktok.crawl_runner

Rotates through all hashtags in the database, picking the least-recently-crawled each time.

Terminal window
# Dry run (plan only, no generation)
python3 -m marketing_system.agent.agent_core --days 3 --dry-run
# Live run
python3 -m marketing_system.agent.agent_core --days 3 --posts-per-day 3
Terminal window
python3 -m marketing_system.skills.auto_creator \
--package com.zhiliaoapp.musically \
--device L9AIB7603188953 \
--max-depth 3 --max-states 20 --settle 1.5
FlagDefaultDescription
--packagerequiredAndroid package name
--devicerequiredADB serial
--max-depth3BFS depth
--max-states20Max unique states
--settle1.5Seconds after each tap
--outputautoOutput directory
Terminal window
python3 -m marketing_system.skills._run_skill \
--skill tiktok \
--workflow engage_fyp \
--device L9AIB7603188953 \
--params '{"duration": 60}'

This is what the scheduler calls internally for skill_workflow and skill_action jobs.

Terminal window
# Full test suite
DEVICE=L9AIB7603188953 python3 -m pytest tests/ -v --tb=short
# Specific test file
python3 -m pytest tests/test_04_crawl.py -v
# Specific test function
python3 -m pytest tests/test_05_outreach.py::test_send_dm -v
# On a different device
DEVICE=RZCX125RE5L python3 -m pytest tests/ -v
TestWhat It DoesRequires
test_00_baselineVerify correct TikTok accountTikTok logged in
test_01_accountsAccount switching2+ TikTok accounts
test_02_draftUpload video as draftVideo file
test_03_postLive post (skipped by default)Video file
test_04_crawlScrape by hashtagTikTok access
test_05_outreachSend DMsTarget influencers
test_06_inbox_scanScan inboxDM conversations
test_07_perf_scanScrape analyticsPublished posts
test_08_draft_publishPublish a draftExisting draft