Releases: InstaWP/cli
Release list
v0.0.1-beta.31
Fixed — remote docroot resolved from the server (domain-cutover sites)
After a custom-domain cutover, the platform API reports the new primary domain (e.g. instawp.com) as the site's sub_domain/main_domain, but the HestiaCP web dir keeps the original name (instawp-marketing.instawp.site). The CLI built remote paths as ~/web/<api-domain>/public_html, so exec/wp (SSH) cd'd into a nonexistent dir ("No such file or directory") and sync pushed to the wrong, non-served path — only an absolute --remote-path worked.
ensureSshAccessnow resolves the real web dir from the server (resolveRemoteWebDir— an SSH lookup for thepublic_htmlthat actually holdswp-config.php) and stores it inconn.domain(resolved once, cached). All path construction —exec/wpcd,sync'sbuildRemotePath,db,migrate— now targets the served docroot. No API field exposes the original name, so this is done over SSH; best-effort, keeps the API domain if the lookup fails.- Verified end-to-end:
instawp wp <cutover-site> option get siteurl→https://instawp.com,exit_code: 0(previously failed on a badcd).
v0.0.1-beta.30
Fixed — CLI auto-resolves the SSH origin for CDN-fronted sites (no env var needed)
beta.29 made SSH fail fast on CDN-fronted sites but still required INSTAWP_SSH_HOST=<origin>. The CLI now figures out the origin itself:
ensureSshAccessprefers the origin IP fromsite_meta.ip_addr(viaGET /sites/{id}/credentials) over theupdate-ssh-statushost, which for a CDN-fronted site is the proxied edge (port 22 filtered). This is exactly what InstaWP's own SSH bridge does (ip_addr ?? sub_domain). Verified end-to-end against a real CDN-fronted site: it now resolves the reachable origin and connects with no override.- Host precedence: explicit override (
--ssh-host/INSTAWP_SSH_HOST) > auto-detected origin IP > API host. - Self-heal: if a cached host fails preflight (e.g. a CDN host cached before this shipped), the cache is dropped and re-resolved automatically — no manual
--refreshneeded.
INSTAWP_SSH_HOST / --ssh-host remain as a manual override for sites where the API doesn't expose ip_addr.
v0.0.1-beta.29
Fixed — SSH-backed commands hung ~2 min on CDN-fronted sites
When a site is fronted by a CDN (Bunny), the platform API returns the proxied edge hostname — port 22 there is unreachable and the origin is never exposed — so every SSH-backed command (sync, db, logs, ssh, plugin install, local, migrate push, wp/exec in SSH mode) hung for ~2 minutes then failed with a raw Operation timed out.
- Origin-host override. Point SSH at the true origin: env
INSTAWP_SSH_HOST(global) orINSTAWP_SSH_HOST_<siteId>(per-site, wins over global), or the--ssh-host <host>flag onsync/db/ssh/wp/exec. The override beats the API host and is applied even to a stale cached (pre-cutover) host.--refreshdrops the cached host and re-resolves (use once after the platform starts returning the origin). - Fast-fail preflight. Before any SSH/rsync/scp, the CLI TCP-probes
host:port(~5s) and, if unreachable, replaces the 2-minute hang with an actionable diagnostic ("…likely behind a CDN…set INSTAWP_SSH_HOST / retry with --api / update the platform"). wp/execauto-fall-back to--apiwhen SSH is unreachable (gated by--no-fallback). Therun-cmdAPI transport isn't behind the CDN.db pull --api/db push --api. A non-SSH transport overrun-cmd(base64+gzip round-trip; push chunks the dump and imports it, with a remote backup first and optional--search-replace). Best for small/medium DBs — one/many API round-trips, no streaming;--timeoutoverrides the per-call budget;--incrementalisn't supported over--api. For large DBs use SSH (setINSTAWP_SSH_HOSTif CDN-fronted).
Companion platform ticket (the real fix): update-ssh-status / sites/{id}/details should return the SSH origin host/IP (e.g. origin_ip/ssh_host), not the CDN-fronted sub_domain. Once it does, the CLI prefers it and SSH works globally with no override. Until then the above are the mitigations.
Not yet included: sync --api (a whole-tree per-file base64 loop over run-cmd) — deferred; use INSTAWP_SSH_HOST for file sync to CDN-fronted sites, or db --api + wp --api for DB/commands.
v0.0.1-beta.28
Added — cache purge
instawp cache purge <site>purges the site's CDN edge cache (the CLI equivalent of the dashboard "Purge Cache" button;POST /sites/{id}/purge-cache).--objectadditionally clears the server object cache (Redis;POST /sites/{id}/clear-object-cache). Both features are plan-gated — when absent the CLI reports a "skipped" no-op (not an error) and points toinstawp wp <site> cache flushfor the WordPress-level object cache.
v0.0.1-beta.27
Fixed — sync push/pull include/exclude ordering (#18)
sync push/pullnow emit user--includepatterns BEFORE user--excludepatterns. rsync is first-match-wins, so the previous order (excludes first) made the standard include-only idiom (--include '*/' '*.html' --exclude '*') silently match nothing — the catch-all--exclude '*'matched every path before any include was considered, looking exactly like "already in sync." Ordering is now built by a pure, unit-testedbuildSyncFilterArgshelper. (--deletestays last; it's an action flag, not a filter rule.)
Added — migrate push (local WordPress → new hosted site)
instawp migrate push [path]mirrors an on-disk WordPress install up to a brand-new hosted InstaWP site — the standalone-CLI replacement for the plugin'swp instawp local push. It archives the WP files (zip), exports the DB (wp db exportif wp-cli works on the install, elsemysqldumpfrom wp-config.php creds), creates a reserved site, uploads both archives into the new site's webroot over SSH, and triggers the server-side restore-raw engine (PUT /sites/{id}/restore-raw), which unzips, imports, and search-replaces the old domain → new domain to produce a faithful copy.- Runs entirely on the CLI's personal API token over site-scoped routes — no Connect record and no migration-dashboard/tracking entry is created (the actual files+DB migration is identical to the plugin's).
- Files archive excludes exactly what the plugin does:
wp-content/instawpbackups,wp-content/upgrade, and theinstawp-connect/instawp-helper/iwp-migrationplugins. - Flags:
--path,--name,--source-url(auto-detected from wp-cli/wp-config when omitted),--wp,--php,--keep-archives,--dry-run,--json. The WP root is auto-located by walking up towp-includes/version.php. - New libs
lib/wp-local.ts(WP-root/wp-config/version detection + source-domain normalization, all pure & unit-tested) andlib/wp-archive.ts(streaming zip viaarchiver+ DB export). Adds thearchiverdependency.
v0.0.1-beta.26
Added — incremental db push (#17)
db push --incrementalships only the row-level delta since the last push instead of the whole DB: it diffs the dump against a per-site baseline (~/.instawp/baselines/<id>/) and applies a minimalREPLACE/DELETEset (noDROP/CREATE). First run, a schema/DDL change, or--fulldo a normal full push and refresh the baseline. Requires a per-row dump (mysqldump --skip-extended-insert --order-by-primary; extended-insert dumps are rejected). Reuses the existing safety machinery — remote backup first, prefix/role-key remap, scoped URL search-replace,--verify. The fulldb pushpath is unchanged; incremental is purely additive.- MVP scope: tables with a single-column primary key (WP core + most plugin tables); anything without one — or any DDL change — auto-falls-back to a full push. The diff engine (
lib/db-delta.ts) and baseline store (lib/db-baseline.ts) are pure and unit-tested. - Memory-bounded: the baseline is stored as a compact per-row hash manifest (PK → content hash), not the full dump, and the current dump is streamed line-by-line (gz-decompressed on the fly) — so a large DB diffs in a few hundred MB instead of loading both dumps into the heap (a naive 2× full-dump diff OOM'd at ~4 GB on a 166 MB DB).
Added — db push readiness/scoping + backup retention (large-DB feedback #16)
db push --verifypolls the site URL until it answers HTTP after the import (a large import can briefly return000right after import/flush); reported asverifiedin the summary.db push --sr-tables <table...>scopes--search-replaceto specific (prefixed) tables instead of all tables — faster on big DBs whose bulk rows have no URLs. Default stays--all-tables.db backups list <site>anddb backups prune <site> [--keep <n>] [--older-than <days>] [--force]manage the~/db-backup-*.sql.gzfilesdb pushleaves behind (they previously accumulated with no way to view/clean them).- Internal: extracted the HTTP-readiness helper to
lib/http-ready.ts(now shared bysites createanddb push --verify).
v0.0.1-beta.25
Improved — db push transport & progress (large-DB path)
From round-3 feedback (a 166 MB full-parity push — the transform logic held; transport/progress needed polish):
db pushcompresses the dump in transit — scp now uses-C(SQL compresses ~5–10×), cutting upload time on large dumps. (#13)- Non-interactive runs show progress — when stdout isn't a TTY (pipe / CI / background), each phase prints a one-line marker to stderr (Backing up… / Uploading… / Importing… / Rewriting URLs…) instead of going silent until the final summary. (#14)
db pushsummary reports timing — adds anelapsed: 144s (1.2 MB/s)line. (#15)
v0.0.1-beta.24
Added — db push prefix-safety, URL remap, sync mirroring & webroot, exec shell
These address feedback from a real LocalWP → cloud "mirror overwrite" workflow.
db pushnow detects a table-prefix mismatch (e.g. awp_dump pushed to aniwpa4c7_site) instead of silently importing orphan tables the site never reads. It warns loudly and offers to rewrite; pass--rewrite-prefixto remap the dump's table identifiers non-interactively. Rewriting also remaps the prefix-bound role/capability keys ({prefix}capabilities,{prefix}user_level,{prefix}user_roles) after import so admin login survives.db push --search-replace <from> <to>runs a serialization-safewp search-replaceacross all tables right after import — the near-universal next step after a cross-domain push.instawp wp/execno longer leak the server login banner/MOTD into command stdout (or the--jsonpayload). Output is now exactly the command's output, so--field,--format=count, and value capture are clean.exec --shell '<cmdline>'runs the arguments as one shell command line on the remote (enables pipes,;,>, globs). The misleading-- ps aux | grep phphelp example (which actually piped locally) is fixed.sync push/pull --deletemakes the remote/local a true mirror (removes extraneous files), guarded by a confirmation prompt (skip with--yes; preview with--dry-run). Additive remains the default. Not supported on Windows (SFTP transport).sync push/pull --remote-path <path>/--webroottransfer files outsidewp-content/(e.g. webroot-levelABSPATH/variations/).versions createnow echoes the restore/list hint using the same site identifier you typed (no more short-name in, FQDN out).db push --search-replacenow skips theguidcolumn (WP best practice — post GUIDs are permanent identifiers, not links); same applied tolocal push --with-db.db pushsuccess summary prints readablerewrote_prefix/search_replacedlines (from -> to) instead of[object Object].exec --stdinstreams local stdin to the remote command (uploads, restore pipes,tar … | exec --stdin 'tar xzf -') — closes the last gap from the feedback. It passes the command as an ssh argument so stdin is free to stream; the non-login remote shell it uses also means no MOTD on that path.
v0.0.1-beta.23
Added — update notifier + instawp upgrade
- The CLI now checks npm for a newer version at most once a day (cached in
~/.config/instawp/) and prints a one-line hint to stderr when an update is available — e.g.⚡ Update available: 0.0.1-beta.22 → beta.23 · run: instawp upgrade. It's instant on cache hits and only does a short, timeout-bounded network call on the daily refresh. instawp upgrade(aliasupdate) self-updates vianpm i -g @instawp/cli@latest;--checkreports without installing.- Never pollutes output or surprises you: the hint is suppressed in
--json,CI, and non-interactive shells (so harnesses never see it), and it never auto-installs by default. Opt into hands-off updates withINSTAWP_AUTO_UPGRADE=1; silence the hint withINSTAWP_NO_UPDATE_NOTIFIER=1.
v0.0.1-beta.22
Added — plugin install, sql, and HTTP-ready create
instawp plugin install <site> <zip|dir> [--activate]— install a plugin from a local.zip(scp +wp plugin install --force) or directory (rsync intowp-content/plugins/, then activate). Removes the base64-over-exec dance.instawp sql <site> "<query>"— run a SQL query via WP-CLI; hits MySQL directly so it's immune to the object cache (handy for verifying state behind a cache).instawp createnow waits until the site answers HTTP, not just until the provisioning task finishes — DNS/edge propagation lags task completion by 30–120s, so "Ready" now means actually reachable (no more hand-rolled curl-retry gates).--no-waitstill returns immediately;--jsonincludeshttp_ready.
Notes (from heavy CLI-driven test-harness use)
exec/wpfaithfully forward argv with per-arg shell-quoting (since beta.21) — quoted multi-word args andwp db query "…"work without--. For bulk file transfer usesync push(rsync), notexec: passing large data as a command argument hits the OSARG_MAXlimit (that's a kernel limit, not a CLI cap), which is what made base64-over-exec unreliable.