Skip to content

💻 CLI Reference

Ghost in the Droid 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 gitd.server import app; app.run(host='0.0.0.0', port=5055, debug=True)"
VariableRequiredPurpose
DEVICEIf multiple phonesDefault ADB serial
OPENAI_API_KEYFor LLM featuresOpenAI API key
ANTHROPIC_API_KEYFor Claude backendAnthropic API key
OPENROUTER_API_KEYFor LLM featuresOpenRouter API key

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

Terminal window
# Upload as draft
python3 -m gitd.bots.tiktok.upload /path/to/video.mp4 \
--caption "Check this out!" --hashtags "cat,aicat" --action draft
# Upload and post immediately
python3 -m gitd.bots.tiktok.upload /path/to/video.mp4 \
--caption "Amazing!" --hashtags "viral,fyp" --action post
# Upload with TTS
python3 -m gitd.bots.tiktok.upload /path/to/video.mp4 \
--caption "Listen!" --inject-tts --action draft
Terminal window
python3 -m gitd.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 gitd.agent.agent_core --days 3 --dry-run
# Live run
python3 -m gitd.agent.agent_core --days 3 --posts-per-day 3
Terminal window
python3 -m gitd.skills.auto_creator \
--package com.zhiliaoapp.musically \
--device YOUR_DEVICE_SERIAL \
--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 gitd.skills._run_skill \
--skill tiktok \
--workflow upload_video \
--device YOUR_DEVICE_SERIAL \
--params '{"video_path": "/tmp/video.mp4"}'

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

Terminal window
# Full test suite
DEVICE=YOUR_DEVICE_SERIAL python3 -m pytest tests/ -v --tb=short
# Specific test file
python3 -m pytest tests/test_04_crawl.py -v
# On a different device
DEVICE=YOUR_DEVICE_SERIAL_2 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_08_draft_publishPublish a draftExisting draft