Sites and Data
Commands for listing sites, syncing site data, collecting usage and stats, capturing screenshots and reporting version drift.
These commands read and refresh the CLI’s picture of the fleet. Most of them work against the local SQLite database that captaincore connect populates, and several of them reach out over SSH to collect fresh data and post it back to the CaptainCore Manager API.
site
captaincore site <subcommand>
| Subcommand | Usage |
|---|---|
list |
site list [<@target>] [--provider=] [--filter=] [--filter-name=] [--filter-version=] [--filter-status=] [--field=] |
get |
site get <site> [--field=] [--bash] [--format=json] |
search |
site search <search-term> [--field=] [--search-field=] |
sync |
site sync <site-id> [--debug] [--update-extras] |
sync-batch |
site sync-batch <site-id>... |
prepare |
site prepare <site> [--skip-deployment] |
delete |
site delete <site> |
deploy-keys |
site deploy-keys <site> |
deploy-defaults |
site deploy-defaults <site> [--global-only] |
key-generate |
site key-generate <site> |
copy-to-staging |
site copy-to-staging <site> [--email=] |
copy-to-production |
site copy-to-production <site> [--email=] |
stats-generate |
site stats-generate <site> [--skip-already-generated] |
ssh-fail |
site ssh-fail <site> |
ssh-refresh |
site ssh-refresh <site> |
vuln-scan |
site vuln-scan <site> [--cached] |
orphans |
site orphans [--write-list=] [--from-list=] [--confirm] [--include-stale-names] |
site list filters on the installed component inventory. --filter selects theme, plugin or core, and --filter-name, --filter-version and --filter-status narrow within it. Status values are active, inactive, dropin and must-use.
captaincore site list @production.updates-off --provider=kinsta
site copy-to-staging and site copy-to-production are Kinsta only. site orphans scans the CaptainCore data path for {site}_{id} folders that no longer map to an active site; it is dry-run by default and --confirm requires --from-list so only a reviewed set can be deleted.
environment
captaincore environment list <site>
Prints the environment names for a site, lowercased and space separated.
captaincore environment list mysite
sync-data
captaincore sync-data <site|target> [--parallel=] [--skip-screenshot] [--json]
| Flag | Description |
|---|---|
--json |
Output raw JSON response |
-p, --parallel int |
Number of sites to run at same time |
-c, --skip-screenshot |
Skip screenshot |
For a single site this runs natively in Go. It fetches the site record, runs the fetch-site-data remote script over SSH, parses the key/value response, updates the local environment record and posts the result back to the Manager API. A target or multiple sites routes through the bulk path instead.
captaincore sync-data mysite-production
usage-update
captaincore usage-update <site>
Runs the fetch-folder-size remote script for storage and captaincore stats for visits, writes both to the local environment record, and posts an update to the Manager API. Output is one padded line with the site, the human-formatted storage and the visit count. When captaincore_standby is true in the system config the API post is skipped and the line is marked standby.
captaincore usage-update mysite-production
screenshot
captaincore screenshot <site|target> [--parallel=] [--page=]
| Flag | Description |
|---|---|
-p, --parallel int |
Number of screenshots to run at same time (default 5) |
--page string |
Check a specific page, for example --page=/wp-admin/ |
captaincore screenshot @production --parallel=10
stats
captaincore stats <site>
Fetches visit counts from WordPress.com Stats, Fathom Analytics or Fathom Lite. It first looks for a Fathom site code on the environment record. If there is not exactly one, it strips the scheme and www. from the environment home URL and searches the Fathom API using fathom_api_key from the system config. With no usable ID it prints 0.
captaincore stats mysite-production
stats-deploy
captaincore stats-deploy <site> [--parallel=]
Deploys the Fathom tracker to a site. -p, --parallel int defaults to 10. Single sites run natively in Go; targets and multiple sites route through the bulk path. The environment must use the sftp protocol.
captaincore stats-deploy mysite-production
drift
captaincore drift [flags]
captaincore drift diff [flags]
Shows how plugin, theme or WordPress core versions are distributed across environments. With no flags it ranks the top drifting plugins.
| Flag | Description |
|---|---|
--plugin string |
Plugin slug to check |
--theme string |
Theme slug to check |
--core |
Check WordPress core versions |
--target string |
Target version. Use latest to auto-detect. Shows sites NOT on this version |
--hashes |
Show hash breakdown within each version |
--environment string |
Filter by environment: Production, Staging, all (default Production) |
--provider string |
Filter by hosting provider |
--themes |
Overview mode: rank themes instead of plugins |
--top int |
Overview mode: number of results to show (default 20) |
--sort string |
Overview mode: sort by volume or spread (default volume) |
--steer |
Upgrade all drifted sites to the latest version |
--force |
Execute the steer upgrade, required with --steer |
-p, --parallel int |
Number of parallel deployments (default 10) |
--json |
Output as JSON |
drift diff compares actual file contents across hash variants of a plugin or theme, using local quicksave directories. It requires --plugin or --theme and accepts --hash, --summary, --target, --environment, --provider and --json.
captaincore drift --plugin=woocommerce --target=latest
info
captaincore info [--json]
Prints CLI version, Go version and platform, the Manager and API URLs, counts of active sites, environments, accounts, domains and providers, and aggregated storage metrics.
captaincore info --json
manifest-generate
captaincore manifest-generate
Walks every environment belonging to an active site and writes a manifest.json of fleet metrics: site count, total site storage, and quicksave count and storage read out of each environment’s quicksave_usage details.
captaincore manifest-generate
regenerate-thumbnails
captaincore regenerate-thumbnails <site>
For each environment it reads the stored screenshot_base token, fetches the most recent capture screenshot and regenerates thumbnails, moving results to the rclone_upload remote from the captain config. Environments with no captures are skipped, as are any whose screenshot_base contains shell metacharacters.
captaincore regenerate-thumbnails mysite