--- name: postfaro description: Install, update, and use the PostFaro CLI to inspect local Chrome accounts, manage extension-local drafts, fill platform editors, or publish user-approved content. Use for PostFaro setup, bridge diagnosis, task status, and cancellation. --- # PostFaro Use the local CLI and the user's installed PostFaro Chrome extension **1.0.7 or newer**. Platform sessions remain in Chrome; never request passwords or cookies. Use `accounts` to read already identified account display information and check that it fits the user's intended destination. `fill` opens editors and fills drafts. Run `publish --yes` only when the user has explicitly authorized publishing the content to the selected destinations; the flag alone is not authorization. ## Install or connect 1. Check `node --version`, `npm --version`, and `postfaro version`. Node.js 20 or newer is required. If missing, use the user's existing Node manager or the official installer appropriate to their OS without unnecessarily replacing their runtime configuration. 2. Install the official CLI archive when needed: ```sh npm install -g https://postfaro.1007.us/downloads/postfaro-cli-v0.3.0.tgz postfaro install-host ``` The CLI release line starts at **0.1.0**. Earlier 0.4.x development previews are outside this release line; for a user-authorized move to this release, explicitly reinstall the fixed 0.3.0 archive after active tasks finish. Do not infer that the higher preview number means it is newer, or claim its old update checker will migrate it automatically. 3. The host is registered for the current user and defaults only to the official fixed extension ID `lpmefijobmkjoohhjfflmfpenocmmfmn`; legacy unpacked IDs are not retained. Chrome and PostFaro must be installed on the same local computer/user. Only for an explicitly different build, use `postfaro install-host --extension-id ` from that browser's extension page or the user's setup message. Do not guess an ID. 4. Run `postfaro bridges list`. Match the target browser/profile with the user, then retain its exact `bridgeId` and `browserContext` for the task. With multiple bridges, choose explicitly; a profile alias is an extension-configured unique alias, not a Chrome directory. 5. Run `postfaro doctor --bridge-id --browser-context regular --wait 30`. Use `incognito` only when requested and enabled. Check `result.healthy`, not just `ok`. For host configuration drift, `postfaro doctor --repair --wait 30` can repair discovered registration. If no live bridge exists, have the user open the intended Chrome profile and extension, then retry diagnosis rather than submitting content tasks to wake it. `BRIDGE_PERMISSION_DENIED` with `details.reason: "EPERM"` or `"EACCES"` means the CLI environment cannot access local IPC. It does not establish that Chrome or the Host exited. Follow the Agent environment's approval flow to allow local IPC and rerun the read-only check in an approved host context; never bypass sandbox restrictions automatically. Do not ask the user to repeatedly reload the extension or reinstall the Host for this error. For an already submitted task, query its original request ID before any further execution. ## Inspect, prepare, execute For the plugin's **local draft box**, use `postfaro drafts create/list/get/update/delete`; read [references/local-drafts.md](references/local-drafts.md) before constructing CRUD requests. Check `capabilities.result.localDrafts` on the installed build. These operations save durable local media without opening platform pages, publishing, or using quota. They are distinct from `fill`, which opens destination editors. Do not substitute either workflow for the other without user direction. Read [references/commands.md](references/commands.md) for query results, account freshness, job waiting, recovery, and updates. Read [references/task-inputs.md](references/task-inputs.md) when constructing input, especially assets, publish guards, X articles, or platform-specific options. - Before filling or publishing, run `postfaro accounts` for the selected bridge. Inspect `loggedIn`, display information, `status`, `source`, and `checkedAt` together. `unknown`/`loggedIn: null` or `no_cache` means unconfirmed, not signed out; cached identity is always stale. A `configured` destination with source `configuration` is a configured target, not a signed-in account. If needed, run `accounts --platform --refresh`. This detects the existing session; it never switches accounts. Surface a mismatch with the user's intended account instead of silently proceeding under another identity. - Use `postfaro platforms --type ` and `postfaro combos` to discover actual targets; `capabilities` gives the full schema. Prefer the exact saved `comboName` the user selected. Do not assume every advertised platform is supported by the installed extension. - Save one stable `requestId`, the exact bridge/context, and final JSON before execution. Run `postfaro prepare --input ` locally. Review any adjustments such as X image overflow before executing. - For Baijiahao short videos, copy and topics share **50 characters total**, including `#` and separators; do not budget 50 for each field. Prepare a dedicated short caption, consult `capabilities.result.contentLimits`, and keep local master drafts intact. See task-inputs for counting and scope. - For drafts, run `postfaro fill --input `. For explicitly authorized publication, run `postfaro publish --yes --input `. Keep the original process alive while it serves local assets. - Wait with `postfaro status --wait 120`; use `postfaro jobs --limit 20 --bridge-id ` to recover task IDs or inspect recent summaries. `status --wait` only reads the original task. Inspect both `status` and `wait_timed_out`: a successful query can return a still-active snapshot after its wait budget expires. An uncertain result, timeout, or disconnect is not a reason to reissue execution with a new ID. Request cancellation with `postfaro cancel `; do not change its profile. - **PostFaro login is required for both fill and publish, separately from platform logins.** Read stderr while the execution process is running. An `event: "action_required"` with `requiredAction.code: "AUTH_SESSION_REQUIRED"`, or a `status`/`jobs` result with `status: "waiting_for_login"`, means the user must complete email login in the PostFaro extension in the selected Chrome profile. Tell the user explicitly that this is the PostFaro account, not Douyin/Xiaohongshu/etc. Keep the original fill/publish process and its asset server alive; completing login resumes that same task automatically. Do not cancel it, resubmit it, create another request ID, or diagnose this login wait as a bridge failure. `status --wait` returns immediately with `waiting_for_user: true` and `requiredAction` when login is needed. - Report each platform's actual lifecycle and returned public URL. `prepared_local`, `filled`, `publish_clicked`, and `needs_check` do not prove publication. Local fixtures and dry runs do not establish that the user's Chrome is connected or content was published. ## Updates Run `postfaro update-check` at setup or when asked about the current version. Connected commands also add a top-level `update` object when a newer release in the current line is found. If `update_available` is true, report installed/latest versions and the supplied official `update_command` so the agent can act on the reminder. Finish active tasks before a user-authorized upgrade. If `node_supported` is false, upgrade Node to `minimum_node_major` first. After replacing the CLI, run `postfaro install-host`, `postfaro doctor --repair --wait 30`, then reselect the original bridge and check accounts/capabilities again. Never update mid-task or replay a publishing request after an upgrade. An unavailable version check leaves version freshness unknown and preserves the business result; do not turn an upgrade or resubmission into a prerequisite for an ordinary content task.