@11agents/cli 0.1.24 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +52 -0
  2. package/bin/11agents.js +12 -0
  3. package/mobile-runtime/README.md +19 -0
  4. package/mobile-runtime/configs/platforms/xiaohongshu_d01.json +73 -0
  5. package/mobile-runtime/configs/platforms/xiaohongshu_d02.json +70 -0
  6. package/mobile-runtime/configs/platforms/xiaohongshu_d03.json +73 -0
  7. package/mobile-runtime/configs/publish_policy.json +40 -0
  8. package/mobile-runtime/data-templates/README.md +4 -0
  9. package/mobile-runtime/data-templates/accounts.example.csv +6 -0
  10. package/mobile-runtime/data-templates/devices.example.csv +2 -0
  11. package/mobile-runtime/data-templates/publish_records.example.jsonl +2 -0
  12. package/mobile-runtime/data-templates/tasks.example.jsonl +5 -0
  13. package/mobile-runtime/data-templates/video_metrics.example.jsonl +1 -0
  14. package/mobile-runtime/python/pyproject.toml +34 -0
  15. package/mobile-runtime/python/src/device_control/__init__.py +5 -0
  16. package/mobile-runtime/python/src/device_control/adapters/__init__.py +31 -0
  17. package/mobile-runtime/python/src/device_control/adapters/base.py +43 -0
  18. package/mobile-runtime/python/src/device_control/adapters/facebook.py +30 -0
  19. package/mobile-runtime/python/src/device_control/adapters/instagram.py +25 -0
  20. package/mobile-runtime/python/src/device_control/adapters/reddit.py +29 -0
  21. package/mobile-runtime/python/src/device_control/adapters/tiktok.py +25 -0
  22. package/mobile-runtime/python/src/device_control/adapters/x.py +29 -0
  23. package/mobile-runtime/python/src/device_control/adapters/xiaohongshu.py +26 -0
  24. package/mobile-runtime/python/src/device_control/adb.py +161 -0
  25. package/mobile-runtime/python/src/device_control/appium_client.py +131 -0
  26. package/mobile-runtime/python/src/device_control/appium_manager.py +403 -0
  27. package/mobile-runtime/python/src/device_control/cli.py +1608 -0
  28. package/mobile-runtime/python/src/device_control/entrypoints.py +60 -0
  29. package/mobile-runtime/python/src/device_control/locks.py +162 -0
  30. package/mobile-runtime/python/src/device_control/metrics/__init__.py +33 -0
  31. package/mobile-runtime/python/src/device_control/metrics/collectors.py +320 -0
  32. package/mobile-runtime/python/src/device_control/metrics/tiktok_account_adb.py +367 -0
  33. package/mobile-runtime/python/src/device_control/metrics/tiktok_video_adb.py +714 -0
  34. package/mobile-runtime/python/src/device_control/models.py +439 -0
  35. package/mobile-runtime/python/src/device_control/publish_policy.py +173 -0
  36. package/mobile-runtime/python/src/device_control/publishers/__init__.py +24 -0
  37. package/mobile-runtime/python/src/device_control/publishers/facebook_adb.py +494 -0
  38. package/mobile-runtime/python/src/device_control/publishers/instagram_adb.py +663 -0
  39. package/mobile-runtime/python/src/device_control/publishers/reddit_adb.py +595 -0
  40. package/mobile-runtime/python/src/device_control/publishers/tiktok_adb.py +477 -0
  41. package/mobile-runtime/python/src/device_control/publishers/tiktok_appium.py +259 -0
  42. package/mobile-runtime/python/src/device_control/publishers/ui_helpers.py +372 -0
  43. package/mobile-runtime/python/src/device_control/publishers/x_adb.py +636 -0
  44. package/mobile-runtime/python/src/device_control/publishers/xiaohongshu_adb.py +1143 -0
  45. package/mobile-runtime/python/src/device_control/store.py +137 -0
  46. package/mobile-runtime/scripts/appium_smoke.py +71 -0
  47. package/mobile-runtime/skills/android-collect-tiktok-metrics/SKILL.md +60 -0
  48. package/mobile-runtime/skills/android-collect-tiktok-metrics/agents/openai.yaml +4 -0
  49. package/mobile-runtime/skills/android-group-control-cli/SKILL.md +76 -0
  50. package/mobile-runtime/skills/android-group-control-cli/agents/openai.yaml +4 -0
  51. package/mobile-runtime/skills/android-group-control-cli/references/command-reference.md +122 -0
  52. package/mobile-runtime/skills/android-publish-facebook/SKILL.md +41 -0
  53. package/mobile-runtime/skills/android-publish-facebook/agents/openai.yaml +4 -0
  54. package/mobile-runtime/skills/android-publish-instagram/SKILL.md +45 -0
  55. package/mobile-runtime/skills/android-publish-instagram/agents/openai.yaml +4 -0
  56. package/mobile-runtime/skills/android-publish-reddit/SKILL.md +41 -0
  57. package/mobile-runtime/skills/android-publish-reddit/agents/openai.yaml +4 -0
  58. package/mobile-runtime/skills/android-publish-tiktok/SKILL.md +43 -0
  59. package/mobile-runtime/skills/android-publish-tiktok/agents/openai.yaml +4 -0
  60. package/mobile-runtime/skills/android-publish-x/SKILL.md +40 -0
  61. package/mobile-runtime/skills/android-publish-x/agents/openai.yaml +4 -0
  62. package/mobile-runtime/skills/android-publish-xiaohongshu/SKILL.md +50 -0
  63. package/mobile-runtime/skills/android-publish-xiaohongshu/agents/openai.yaml +4 -0
  64. package/mobile-runtime/skills/mobile-publish-data-collection/SKILL.md +49 -0
  65. package/mobile-runtime/skills/mobile-publish-device-health/SKILL.md +47 -0
  66. package/mobile-runtime/skills/mobile-publish-execution/SKILL.md +57 -0
  67. package/mobile-runtime/skills/mobile-publish-records/SKILL.md +29 -0
  68. package/package.json +4 -1
  69. package/scripts/mobile-postinstall.js +26 -0
  70. package/src/commands/mobile.js +695 -0
  71. package/src/commands/runtime.js +21 -5
@@ -0,0 +1,137 @@
1
+ from __future__ import annotations
2
+
3
+ import csv
4
+ import json
5
+ from pathlib import Path
6
+
7
+ from .models import (
8
+ Device,
9
+ PlatformAccount,
10
+ PublishRecord,
11
+ PublishTask,
12
+ TikTokAccountMetricsSnapshot,
13
+ TikTokVideoMetricsSnapshot,
14
+ VideoMetricsSnapshot,
15
+ )
16
+
17
+
18
+ def load_devices(path: str | Path) -> dict[str, Device]:
19
+ rows = _read_csv(path)
20
+ devices = {}
21
+ for row in rows:
22
+ device = Device(
23
+ device_id=row["device_id"],
24
+ adb_serial=row["adb_serial"],
25
+ ip_address=row.get("ip_address", ""),
26
+ brand=row.get("brand", ""),
27
+ model=row.get("model", ""),
28
+ android_version=row.get("android_version", ""),
29
+ status=row.get("status", "active"),
30
+ notes=row.get("notes", ""),
31
+ )
32
+ devices[device.device_id] = device
33
+ return devices
34
+
35
+
36
+ def load_accounts(path: str | Path) -> dict[str, PlatformAccount]:
37
+ rows = _read_csv(path)
38
+ accounts = {}
39
+ for row in rows:
40
+ account = PlatformAccount(
41
+ account_id=row["account_id"],
42
+ platform=row["platform"].lower(),
43
+ username=row["username"],
44
+ bound_device_id=row["bound_device_id"],
45
+ login_status=row.get("login_status", "unknown"),
46
+ status=row.get("status", "active"),
47
+ notes=row.get("notes", ""),
48
+ )
49
+ accounts[account.account_id] = account
50
+ return accounts
51
+
52
+
53
+ def load_tasks(path: str | Path) -> list[PublishTask]:
54
+ tasks: list[PublishTask] = []
55
+ with Path(path).open() as f:
56
+ for line_no, line in enumerate(f, start=1):
57
+ text = line.strip()
58
+ if not text:
59
+ continue
60
+ try:
61
+ tasks.append(PublishTask.from_dict(json.loads(text)))
62
+ except Exception as exc:
63
+ raise ValueError(f"Invalid task JSON at {path}:{line_no}: {exc}") from exc
64
+ return tasks
65
+
66
+
67
+ def load_publish_records(path: str | Path) -> list[PublishRecord]:
68
+ return [PublishRecord.from_dict(row) for row in _read_jsonl(path)]
69
+
70
+
71
+ def append_publish_record(path: str | Path, record: PublishRecord) -> None:
72
+ append_jsonl(path, record.to_dict())
73
+
74
+
75
+ def write_publish_records(path: str | Path, records: list[PublishRecord]) -> None:
76
+ write_jsonl(path, [record.to_dict() for record in records])
77
+
78
+
79
+ def load_metrics_snapshots(path: str | Path) -> list[VideoMetricsSnapshot]:
80
+ return [VideoMetricsSnapshot.from_dict(row) for row in _read_jsonl(path)]
81
+
82
+
83
+ def append_metrics_snapshot(path: str | Path, snapshot: VideoMetricsSnapshot) -> None:
84
+ append_jsonl(path, snapshot.to_dict())
85
+
86
+
87
+ def load_tiktok_account_metrics_snapshots(path: str | Path) -> list[TikTokAccountMetricsSnapshot]:
88
+ return [TikTokAccountMetricsSnapshot.from_dict(row) for row in _read_jsonl(path)]
89
+
90
+
91
+ def append_tiktok_account_metrics_snapshot(path: str | Path, snapshot: TikTokAccountMetricsSnapshot) -> None:
92
+ append_jsonl(path, snapshot.to_dict())
93
+
94
+
95
+ def load_tiktok_video_metrics_snapshots(path: str | Path) -> list[TikTokVideoMetricsSnapshot]:
96
+ return [TikTokVideoMetricsSnapshot.from_dict(row) for row in _read_jsonl(path)]
97
+
98
+
99
+ def append_tiktok_video_metrics_snapshot(path: str | Path, snapshot: TikTokVideoMetricsSnapshot) -> None:
100
+ append_jsonl(path, snapshot.to_dict())
101
+
102
+
103
+ def append_jsonl(path: str | Path, row: dict) -> None:
104
+ out = Path(path)
105
+ out.parent.mkdir(parents=True, exist_ok=True)
106
+ with out.open("a") as f:
107
+ f.write(json.dumps(row, ensure_ascii=False, sort_keys=True) + "\n")
108
+
109
+
110
+ def write_jsonl(path: str | Path, rows: list[dict]) -> None:
111
+ out = Path(path)
112
+ out.parent.mkdir(parents=True, exist_ok=True)
113
+ with out.open("w") as f:
114
+ for row in rows:
115
+ f.write(json.dumps(row, ensure_ascii=False, sort_keys=True) + "\n")
116
+
117
+
118
+ def _read_csv(path: str | Path) -> list[dict[str, str]]:
119
+ with Path(path).open(newline="") as f:
120
+ return list(csv.DictReader(f))
121
+
122
+
123
+ def _read_jsonl(path: str | Path) -> list[dict]:
124
+ in_path = Path(path)
125
+ if not in_path.exists():
126
+ return []
127
+ rows: list[dict] = []
128
+ with in_path.open() as f:
129
+ for line_no, line in enumerate(f, start=1):
130
+ text = line.strip()
131
+ if not text:
132
+ continue
133
+ try:
134
+ rows.append(json.loads(text))
135
+ except Exception as exc:
136
+ raise ValueError(f"Invalid JSONL at {path}:{line_no}: {exc}") from exc
137
+ return rows
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env python3
2
+ from __future__ import annotations
3
+
4
+ import argparse
5
+ import json
6
+ import sys
7
+ import urllib.error
8
+ import urllib.request
9
+
10
+
11
+ def request(method: str, url: str, payload: dict | None = None) -> dict:
12
+ data = None
13
+ headers = {"Content-Type": "application/json"}
14
+ if payload is not None:
15
+ data = json.dumps(payload).encode()
16
+ req = urllib.request.Request(url, data=data, headers=headers, method=method)
17
+ try:
18
+ with urllib.request.urlopen(req, timeout=60) as resp:
19
+ raw = resp.read().decode()
20
+ except urllib.error.HTTPError as exc:
21
+ raw = exc.read().decode(errors="replace")
22
+ raise RuntimeError(f"HTTP {exc.code}: {raw}") from exc
23
+ return json.loads(raw) if raw else {}
24
+
25
+
26
+ def main() -> int:
27
+ parser = argparse.ArgumentParser()
28
+ parser.add_argument("--server", default="http://127.0.0.1:4723")
29
+ parser.add_argument("--udid", required=True)
30
+ args = parser.parse_args()
31
+
32
+ status = request("GET", f"{args.server}/status")
33
+ print(f"server_ready={status.get('value', {}).get('ready')}")
34
+
35
+ payload = {
36
+ "capabilities": {
37
+ "alwaysMatch": {
38
+ "platformName": "Android",
39
+ "appium:automationName": "UiAutomator2",
40
+ "appium:udid": args.udid,
41
+ "appium:noReset": True,
42
+ "appium:newCommandTimeout": 120,
43
+ "appium:disableWindowAnimation": True,
44
+ "appium:skipDeviceInitialization": True,
45
+ "appium:ignoreHiddenApiPolicyError": True,
46
+ "appium:disableSuppressAccessibilityService": True,
47
+ "appium:settings[enableNotificationListener]": False,
48
+ }
49
+ }
50
+ }
51
+ session = request("POST", f"{args.server}/session", payload)
52
+ value = session.get("value", {})
53
+ session_id = value.get("sessionId") or session.get("sessionId")
54
+ if not session_id:
55
+ print(json.dumps(session, indent=2), file=sys.stderr)
56
+ raise RuntimeError("No sessionId returned")
57
+
58
+ print(f"session_id={session_id}")
59
+ try:
60
+ source = request("GET", f"{args.server}/session/{session_id}/source")
61
+ xml = source.get("value", "")
62
+ print(f"page_source_chars={len(xml)}")
63
+ print("smoke_ok=true")
64
+ finally:
65
+ request("DELETE", f"{args.server}/session/{session_id}")
66
+ print("session_deleted=true")
67
+ return 0
68
+
69
+
70
+ if __name__ == "__main__":
71
+ raise SystemExit(main())
@@ -0,0 +1,60 @@
1
+ ---
2
+ name: android-collect-tiktok-metrics
3
+ description: Collect TikTok account and video metrics from the bundled 11agents mobile Android runtime. Use only high-level `11agents mobile` metrics commands and stop on login, verification, or unexpected account states.
4
+ ---
5
+
6
+ # Android TikTok Metrics Collection
7
+
8
+ ## Core Rules
9
+
10
+ - Use `11agents mobile ...`; do not call raw ADB/Appium directly.
11
+ - Collect only metrics visible to an authorized account/device.
12
+ - Do not automate engagement, browsing, liking, following, sharing, or view inflation.
13
+ - If TikTok Studio, login, verification, or app state requires a person, return `needs_human` with screenshot evidence.
14
+ - Always pass `--json` when supported and `--task-id <task_id>` when running for an agent task.
15
+
16
+ ## Required Inputs
17
+
18
+ - Device id or range from `11agents mobile list-devices --health`.
19
+ - Account or video scope.
20
+ - For video metrics, enough context to identify the target video, usually `--video-order`, `--record-id`, or platform post id/permalink.
21
+
22
+ If device, logged-in account, target video, or measurement window is missing, ask the user before claiming metrics.
23
+
24
+ ## Workflow
25
+
26
+ 1. Verify runtime and device state:
27
+
28
+ ```bash
29
+ 11agents mobile doctor --json
30
+ 11agents mobile list-devices --health --json
31
+ ```
32
+
33
+ 2. Collect account metrics:
34
+
35
+ ```bash
36
+ 11agents mobile data collect --platform tiktok --scope account --device D03 --json --task-id TASK_123
37
+ ```
38
+
39
+ 3. Collect video metrics:
40
+
41
+ ```bash
42
+ 11agents mobile data collect --platform tiktok --scope video --device D03 --video-order 1 --json --task-id TASK_123
43
+ ```
44
+
45
+ 4. Inspect stored snapshots:
46
+
47
+ ```bash
48
+ 11agents mobile list-tiktok-account-metrics --json
49
+ 11agents mobile list-tiktok-video-metrics --json
50
+ ```
51
+
52
+ 5. If Android collection is unavailable, record manual/API values through:
53
+
54
+ ```bash
55
+ 11agents mobile add-metrics --record-id pub_123 --platform tiktok --metric views=0 --json --task-id TASK_123
56
+ ```
57
+
58
+ ## Output
59
+
60
+ Return metric status, snapshot ids, account/video target, data freshness, screenshot paths when created, run log path, missing access, and `agent_memory_delta` with reusable creative or account learning.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "TK Data Recovery"
3
+ short_description: "Recover TikTok Studio analytics data"
4
+ default_prompt: "Use $android-collect-tiktok-metrics to recover TikTok account and video analytics data from Android devices."
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: android-group-control-cli
3
+ description: Operate the bundled 11agents mobile Android runtime for device-pool publishing, device checks, publish records, and platform metrics. Use high-level `11agents mobile` commands only; do not expose arbitrary ADB shell, bypass verification, or automate engagement actions.
4
+ ---
5
+
6
+ # Android Group Control CLI
7
+
8
+ ## Core Rules
9
+
10
+ - Use the npm CLI entrypoint: `11agents mobile ...`.
11
+ - Mutable runtime state lives under `${ELEVENAGENTS_MOBILE_HOME:-~/.11agents/mobile}`.
12
+ - Run `11agents mobile setup` before first use on an Android publishing machine.
13
+ - Use only allowlisted high-level commands exposed by `11agents mobile`.
14
+ - Do not run arbitrary `adb shell`, arbitrary Appium scripts, credential scraping, CAPTCHA bypass, login bypass, or platform verification bypass.
15
+ - Do not automate likes, comments, follows, shares, views, random browsing, registrations, or fake engagement.
16
+ - If a page needs human action, report `needs_human`, include the screenshot path, and stop.
17
+ - Prefer `--json` for machine-readable execution results.
18
+ - Use `--dry-run` when the user asks for preview/test; use live publish only with explicit approval.
19
+
20
+ ## Standard Workflow
21
+
22
+ 1. Verify the packaged runtime and local state:
23
+
24
+ ```bash
25
+ 11agents mobile doctor --json
26
+ 11agents mobile setup
27
+ ```
28
+
29
+ 2. Verify devices:
30
+
31
+ ```bash
32
+ 11agents mobile list-adb
33
+ 11agents mobile list-devices --health --json
34
+ ```
35
+
36
+ 3. Verify prerequisites:
37
+
38
+ - Target device is active and online in `~/.11agents/mobile/data/devices.csv`.
39
+ - Target app is installed and logged in with a company-owned or authorized account.
40
+ - Appium is available for flows that need it:
41
+
42
+ ```bash
43
+ 11agents mobile ensure-appium --device D03 --json
44
+ ```
45
+
46
+ 4. Run the requested high-level command.
47
+ 5. Report `status`, `duration_seconds`, `record_id`, `screenshot_path`, `permalink`, `platform_post_id`, and any `error`.
48
+ 6. Inspect run logs at `~/.11agents/mobile/runs/<task_id>/log`. Pass `--task-id <id>` to keep logs tied to an agent task.
49
+
50
+ ## Current Capabilities
51
+
52
+ - Device/ADB: `doctor`, `list-adb`, `list-devices`, `connect`, `health`, `screenshot`, `dump-ui`, `launch`, `tap`, `keyevent`, and `input-text`.
53
+ - Appium: `ensure-appium`, `stop-appium`, and `appium-smoke`.
54
+ - Planning/records: `plan-task`, `record-publish`, `list-publish-records`, `update-publish-record`.
55
+ - Metrics/recovery: `add-metrics`, `collect-metrics`, `list-metrics`, TikTok account/video Android metrics collectors, and Xiaohongshu link copy.
56
+ - Publishing: `publish-tiktok`, `publish-tiktok-adb`, `publish-tiktok-appium`, `publish-reddit`, `publish-reddit-adb`, `publish-facebook`, `publish-instagram`, `publish-x`, and `publish-xiaohongshu`.
57
+
58
+ ## Examples
59
+
60
+ ```bash
61
+ 11agents mobile list-devices --health --json --task-id TASK_123
62
+ 11agents mobile publish-tiktok --device D03 --video "/path/video.mp4" --caption "caption" --json --task-id TASK_123
63
+ 11agents mobile publish-reddit --device D02 --post-type text --subreddit test --title "Title" --body "Body" --json --task-id TASK_123
64
+ 11agents mobile data collect --platform reddit --record-id pub_123 --json --task-id TASK_123
65
+ 11agents mobile data collect --platform tiktok --scope video --device D03 --video-order 1 --json --task-id TASK_123
66
+ ```
67
+
68
+ ## Operational Notes
69
+
70
+ - Publishing commands hold a device-level lock; one physical phone cannot run two publish tasks at the same time.
71
+ - Platform publish commands default to sequential execution.
72
+ - Explicit parallelism is capped at 5 devices with `--parallel --max-concurrency N`.
73
+ - Global publish slots cap concurrent publishing across CLI processes.
74
+ - D03 is the calibrated Appium-capable default for TikTok, Instagram caption input, and Xiaohongshu, unless local device data says otherwise.
75
+ - Store device/account CSVs and publish records under `~/.11agents/mobile/data`.
76
+ - Runtime logs are always under `~/.11agents/mobile/runs/<task_id>/log`.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Android Group Control CLI"
3
+ short_description: "Operate the Android device-pool publishing CLI"
4
+ default_prompt: "Use $android-group-control-cli to check devices and run a safe publishing task."
@@ -0,0 +1,122 @@
1
+ # Command Reference
2
+
3
+ ## Setup
4
+
5
+ ```bash
6
+ 11agents mobile setup
7
+ 11agents mobile doctor --json
8
+ ```
9
+
10
+ Runtime state defaults to `~/.11agents/mobile`. Use `ELEVENAGENTS_MOBILE_HOME` only when a machine needs a custom state directory.
11
+
12
+ All agent task commands should include `--task-id <task_id>` so logs land at:
13
+
14
+ ```text
15
+ ~/.11agents/mobile/runs/<task_id>/log
16
+ ```
17
+
18
+ ## Device Checks
19
+
20
+ ```bash
21
+ 11agents mobile list-adb
22
+ 11agents mobile list-devices --health --json
23
+ 11agents mobile screenshot D03 --task-id TASK_123
24
+ 11agents mobile dump-ui D03 --task-id TASK_123
25
+ 11agents mobile launch D03 <android.package.name> --task-id TASK_123
26
+ ```
27
+
28
+ Choose targets only from current `list-devices --health` output where the device is active and online. Do not rely on device ids from old examples.
29
+
30
+ ## TikTok
31
+
32
+ ```bash
33
+ 11agents mobile publish-tiktok --device D03 --video "/path/video.mp4" --caption "caption" --json --task-id TASK_123
34
+ 11agents mobile publish-tiktok-adb --device D01 --video "/path/video.mp4" --caption "ascii caption" --json --task-id TASK_123
35
+ 11agents mobile publish-tiktok --range 1-5 --video "/path/video.mp4" --caption "caption" --parallel --max-concurrency 5 --json --task-id TASK_123
36
+ ```
37
+
38
+ Use `publish-tiktok` as the preferred route. Use `publish-tiktok-adb` only as an explicit fallback.
39
+
40
+ ## Instagram
41
+
42
+ ```bash
43
+ 11agents mobile publish-instagram --device D03 --post-type reel --video "/path/video.mp4" --caption "caption" --json --task-id TASK_123
44
+ 11agents mobile publish-instagram --device D03 --post-type post-image --image "/path/image.jpg" --caption "caption" --json --task-id TASK_123
45
+ 11agents mobile publish-instagram --device D03 --post-type post-video --video "/path/video.mp4" --caption "caption" --json --task-id TASK_123
46
+ ```
47
+
48
+ ## Facebook
49
+
50
+ ```bash
51
+ 11agents mobile publish-facebook --device D03 --post-type text --text "post body" --json --task-id TASK_123
52
+ 11agents mobile publish-facebook --device D03 --post-type link --text "post body" --link-url "https://example.com" --json --task-id TASK_123
53
+ 11agents mobile publish-facebook --device D03 --post-type image --image "/path/image.jpg" --caption "caption" --json --task-id TASK_123
54
+ 11agents mobile publish-facebook --device D03 --post-type video --video "/path/video.mp4" --caption "caption" --json --task-id TASK_123
55
+ ```
56
+
57
+ ## Reddit
58
+
59
+ ```bash
60
+ 11agents mobile publish-reddit --device D02 --post-type text --subreddit test --title "Title" --body "Body" --json --task-id TASK_123
61
+ 11agents mobile publish-reddit --device D02 --post-type link --subreddit test --title "Title" --link-url "https://example.com" --json --task-id TASK_123
62
+ 11agents mobile publish-reddit --device D02 --post-type image --subreddit test --title "Title" --image "/path/image.jpg" --json --task-id TASK_123
63
+ 11agents mobile publish-reddit --device D02 --post-type video --subreddit test --title "Title" --video "/path/video.mp4" --json --task-id TASK_123
64
+ ```
65
+
66
+ Use `--no-fetch-permalink` when the app publish result should not depend on public username lookup.
67
+
68
+ ## X
69
+
70
+ ```bash
71
+ 11agents mobile publish-x --device D03 --post-type text --body "post body" --json --task-id TASK_123
72
+ 11agents mobile publish-x --device D03 --post-type link --body "post body" --link-url "https://example.com" --json --task-id TASK_123
73
+ 11agents mobile publish-x --device D03 --post-type image --body "post body" --image "/path/image.jpg" --json --task-id TASK_123
74
+ ```
75
+
76
+ X uses one `body` field, not a title/body split.
77
+
78
+ ## Xiaohongshu
79
+
80
+ ```bash
81
+ 11agents mobile publish-xiaohongshu --device D03 --post-type image --image "/path/image.jpg" --title "title" --caption "body" --json --task-id TASK_123
82
+ 11agents mobile publish-xiaohongshu --device D03 --post-type video --video "/path/video.mp4" --title "title" --caption "body" --json --task-id TASK_123
83
+ 11agents mobile publish-xiaohongshu --device D03 --publish-package "/path/publish_package.json" --json --task-id TASK_123
84
+ 11agents mobile copy-xiaohongshu-link --device D03 --record-id pub_123 --json --task-id TASK_123
85
+ ```
86
+
87
+ Use `--confirm-no-disclosure-needed` only when the approved package and policy explicitly allow it.
88
+
89
+ ## Records And Data Recovery
90
+
91
+ ```bash
92
+ 11agents mobile list-publish-records --json --task-id TASK_123
93
+ 11agents mobile update-publish-record --record-id pub_123 --platform-permalink "https://example.com/post" --json --task-id TASK_123
94
+ 11agents mobile data collect --platform reddit --record-id pub_123 --json --task-id TASK_123
95
+ 11agents mobile data collect --platform instagram --record-id pub_123 --json --task-id TASK_123
96
+ 11agents mobile data collect --platform tiktok --scope account --device D03 --json --task-id TASK_123
97
+ 11agents mobile data collect --platform tiktok --scope video --device D03 --record-id pub_123 --json --task-id TASK_123
98
+ 11agents mobile data collect --platform xiaohongshu --record-id pub_123 --copy-link --json --task-id TASK_123
99
+ 11agents mobile data collect --platform x --record-id pub_123 --json --task-id TASK_123
100
+ 11agents mobile data collect --platform facebook --record-id pub_123 --json --task-id TASK_123
101
+ 11agents mobile add-metrics --record-id pub_123 --platform tiktok --metric views=100 --metric likes=5 --json --task-id TASK_123
102
+ 11agents mobile list-metrics --json --task-id TASK_123
103
+ ```
104
+
105
+ When a collector returns `missing_access`, ask for the relevant API token, analytics export, or manual metric values. Do not invent metrics.
106
+
107
+ ## Appium
108
+
109
+ ```bash
110
+ 11agents mobile ensure-appium --device D03 --json --task-id TASK_123
111
+ 11agents mobile appium-smoke --udid <adb-serial> --json --task-id TASK_123
112
+ 11agents mobile stop-appium --json --task-id TASK_123
113
+ ```
114
+
115
+ Use `--no-ensure-appium` or `--no-appium-smoke` only for controlled debugging against a known-good external Appium session.
116
+
117
+ ## Status Handling
118
+
119
+ - `published`: report success, duration, record id, permalink/post id when available, screenshot, and run log path.
120
+ - `dry_run`: report the post-form screenshot and say no publish was clicked.
121
+ - `needs_human`: report screenshot and the reason; do not continue.
122
+ - `failed`: report screenshot and error; do not retry unless the user asks or the failure is a transient device/offline issue.
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: android-publish-facebook
3
+ description: Publish Facebook Lite text, link, image, and video posts through the bundled 11agents mobile Android runtime. Use `11agents mobile publish-facebook`; do not expose raw ADB or bypass platform checks.
4
+ ---
5
+
6
+ # Android Facebook Publishing
7
+
8
+ ## Required Inputs
9
+
10
+ - Approved post type: `text`, `link`, `image`, or `video`.
11
+ - Text/caption/link/media fields required by the post type.
12
+ - Target device or range, account id/account prefix when records need it, and live approval or dry-run intent.
13
+ - Facebook Lite installed and logged in on an authorized device.
14
+
15
+ If approval, content fields, logged-in account, or device readiness is missing, ask the user before publishing.
16
+
17
+ ## Workflow
18
+
19
+ ```bash
20
+ 11agents mobile doctor --json
21
+ 11agents mobile list-devices --health --json
22
+ ```
23
+
24
+ Examples:
25
+
26
+ ```bash
27
+ 11agents mobile publish-facebook --device D03 --post-type text --text "post body" --json --task-id TASK_123
28
+ 11agents mobile publish-facebook --device D03 --post-type link --text "post body" --link-url "https://example.com" --json --task-id TASK_123
29
+ 11agents mobile publish-facebook --device D03 --post-type image --image "/path/image.jpg" --caption "caption" --json --task-id TASK_123
30
+ 11agents mobile publish-facebook --device D03 --post-type video --video "/path/video.mp4" --caption "caption" --json --task-id TASK_123
31
+ ```
32
+
33
+ Stop on login, restriction, verification, unexpected composer, or publish confirmation states the CLI cannot safely handle.
34
+
35
+ ## Output
36
+
37
+ Return publish status, record id, account/device, screenshot path, permalink or platform post id when available, duration, error or human action, and the data-collection handoff:
38
+
39
+ ```bash
40
+ 11agents mobile data collect --platform facebook --record-id <record_id> --json --task-id TASK_123
41
+ ```
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Android Facebook Publisher"
3
+ short_description: "Publish Facebook Lite posts through the Android device-pool CLI"
4
+ default_prompt: "Use $android-publish-facebook to publish Facebook Lite content from a managed Android device."
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: android-publish-instagram
3
+ description: Publish Instagram Reels and feed Posts through the bundled 11agents mobile Android runtime. Use `11agents mobile publish-instagram`; do not expose raw ADB or bypass platform checks.
4
+ ---
5
+
6
+ # Android Instagram Publishing
7
+
8
+ ## Required Inputs
9
+
10
+ - Approved media path reachable from the runtime machine.
11
+ - Post type: `reel`, `post-image`, or `post-video`.
12
+ - Caption, target device or range, account id/account prefix when records need it, and live approval or dry-run intent.
13
+ - Device/app readiness from `11agents mobile list-devices --health --json`.
14
+
15
+ If approval, media path, logged-in Instagram account, device readiness, or post type is missing, ask the user before publishing.
16
+
17
+ ## Workflow
18
+
19
+ ```bash
20
+ 11agents mobile doctor --json
21
+ 11agents mobile list-devices --health --json
22
+ ```
23
+
24
+ Reel:
25
+
26
+ ```bash
27
+ 11agents mobile publish-instagram --device D03 --post-type reel --video "/path/video.mp4" --caption "caption" --json --task-id TASK_123
28
+ ```
29
+
30
+ Feed image or video:
31
+
32
+ ```bash
33
+ 11agents mobile publish-instagram --device D03 --post-type post-image --image "/path/image.jpg" --caption "caption" --json --task-id TASK_123
34
+ 11agents mobile publish-instagram --device D03 --post-type post-video --video "/path/video.mp4" --caption "caption" --json --task-id TASK_123
35
+ ```
36
+
37
+ Do not auto-confirm unexpected login, verification, restriction, or account prompts. Stop on `needs_human` and return screenshot evidence.
38
+
39
+ ## Output
40
+
41
+ Return publish status, record id, account/device, screenshot path, permalink or platform post id when available, duration, error or human action, and the data-collection handoff:
42
+
43
+ ```bash
44
+ 11agents mobile data collect --platform instagram --record-id <record_id> --json --task-id TASK_123
45
+ ```
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Android Instagram Publisher"
3
+ short_description: "Publish Instagram Reels and Posts through the Android device-pool CLI"
4
+ default_prompt: "Use $android-publish-instagram to publish Instagram content from a managed Android device."
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: android-publish-reddit
3
+ description: Publish Reddit text, link, image, and video posts through the bundled 11agents mobile Android runtime. Use `11agents mobile publish-reddit`; do not expose raw ADB, automate engagement, or bypass platform checks.
4
+ ---
5
+
6
+ # Android Reddit Publishing
7
+
8
+ ## Required Inputs
9
+
10
+ - Approved subreddit and post type: `text`, `link`, `image`, or `video`.
11
+ - Title/body/link/media fields required by the post type.
12
+ - Target device or range, account id/account prefix when records need it, and live approval or dry-run intent.
13
+ - Logged-in authorized Reddit account and current subreddit rules.
14
+
15
+ If approval, subreddit, account health, content fields, or device readiness is missing, ask the user before publishing.
16
+
17
+ ## Workflow
18
+
19
+ ```bash
20
+ 11agents mobile doctor --json
21
+ 11agents mobile list-devices --health --json
22
+ ```
23
+
24
+ Examples:
25
+
26
+ ```bash
27
+ 11agents mobile publish-reddit --device D02 --post-type text --subreddit test --title "Title" --body "Body" --json --task-id TASK_123
28
+ 11agents mobile publish-reddit --device D02 --post-type link --subreddit test --title "Title" --link-url "https://example.com" --json --task-id TASK_123
29
+ 11agents mobile publish-reddit --device D02 --post-type image --subreddit test --title "Title" --image "/path/image.jpg" --json --task-id TASK_123
30
+ 11agents mobile publish-reddit --device D02 --post-type video --subreddit test --title "Title" --video "/path/video.mp4" --json --task-id TASK_123
31
+ ```
32
+
33
+ Use `--no-fetch-permalink` when the public username is unknown and app-level publish success should not fail only because permalink lookup cannot match the username.
34
+
35
+ ## Output
36
+
37
+ Return publish status, record id, account/subreddit/device, screenshot path, permalink or platform post id when available, duration, error or human action, and the data-collection handoff:
38
+
39
+ ```bash
40
+ 11agents mobile data collect --platform reddit --record-id <record_id> --json --task-id TASK_123
41
+ ```
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Android Reddit Publisher"
3
+ short_description: "Publish Reddit posts through the Android device-pool CLI"
4
+ default_prompt: "Use $android-publish-reddit to publish Reddit content from a managed Android device."
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: android-publish-tiktok
3
+ description: Publish TikTok videos through the bundled 11agents mobile Android runtime. Use `11agents mobile publish-tiktok` or the explicit ADB/Appium fallback commands; do not expose raw ADB or bypass platform checks.
4
+ ---
5
+
6
+ # Android TikTok Publishing
7
+
8
+ ## Required Inputs
9
+
10
+ - Approved video path reachable from the runtime machine.
11
+ - Caption/hashtags, target device or range, account id/account prefix when records need it, and live approval or dry-run intent.
12
+ - Device readiness from `11agents mobile list-devices --health --json`.
13
+
14
+ If approval, media path, logged-in TikTok account, device readiness, or publish mode is missing, ask the user before publishing.
15
+
16
+ ## Workflow
17
+
18
+ ```bash
19
+ 11agents mobile doctor --json
20
+ 11agents mobile list-devices --health --json
21
+ ```
22
+
23
+ Preferred Appium-backed route:
24
+
25
+ ```bash
26
+ 11agents mobile publish-tiktok --device D03 --video "/path/video.mp4" --caption "caption" --json --task-id TASK_123
27
+ ```
28
+
29
+ ADB fallback when explicitly requested:
30
+
31
+ ```bash
32
+ 11agents mobile publish-tiktok-adb --device D01 --video "/path/video.mp4" --caption "ascii caption" --json --task-id TASK_123
33
+ ```
34
+
35
+ Use `--range`, `--parallel`, and `--max-concurrency N` only when the approved plan targets multiple devices. Keep concurrency at or below 5.
36
+
37
+ ## Output
38
+
39
+ Return publish status, record id, account/device, screenshot path, permalink or platform post id when available, duration, error or `needs_human` action, and the data-collection handoff:
40
+
41
+ ```bash
42
+ 11agents mobile data collect --platform tiktok --scope video --record-id <record_id> --json --task-id TASK_123
43
+ ```