Skip to content

fix(site): pass flags through to wp-cli, exec and logs - #20

Merged
nabil1440 merged 1 commit into
blockers/3-site-lookupfrom
blockers/4-flag-passthrough
Sep 22, 2026
Merged

nabil1440 merged 1 commit into
blockers/3-site-lookupfrom
blockers/4-flag-passthrough

Conversation

@nabil1440

@nabil1440 nabil1440 commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Change

  • wp and exec stop the parse of fly flags at the first argument. All later arguments go to wp-cli or to the command without change.
  • exec uses the PHP service of the site by default: php, or openlitespeed on OpenLiteSpeed sites. wp uses the same detection (docker.DefaultService).
  • exec with only a service name shows an error.
  • logs accepts -f/--follow, --tail and more than one service.
  • The README tells how flags go to the command and where --domain goes.

Behavior change

  • Put --domain before the wp-cli command or the exec command, for example fly --domain example.com wp plugin list. After the command, --domain goes to wp-cli.
  • To send a flag as the first wp-cli argument, use --, for example fly wp -- --info.

Tests

  • Unit tests: splitService, and DefaultService for php, openlitespeed, both and none.
  • End-to-end tests examine the exact docker arguments for:
    • wp plugin list --format=json
    • --domain example.com wp plugin list --format=json
    • exec php ls -la and exec ls -la
    • exec ls and wp plugin list on an OpenLiteSpeed site
    • logs -f php and logs --tail 50
  • These tests fail on the code before this PR. The only exception is wp on an OpenLiteSpeed site, which Fix(ols): Fix cli not detecting OLS sites #1 corrected.
  • Real Docker: fly exec php ls -la …, fly exec cat … and fly logs --tail 3 php.

Closes #4

@nabil1440
nabil1440 added this pull request to stack #24 September 21, 2026 10:41
- wp and exec stop parsing fly flags at the first argument, so
  'fly wp plugin list --format=json' and 'fly exec php ls -la' work.
  --domain goes before the command.
- exec uses the site's PHP service by default: php, or openlitespeed
  on OpenLiteSpeed sites (DefaultService, shared with wp).
- exec reports an error when only a service name is given.
- logs accepts --follow/-f, --tail and several services.
- README: document flag passthrough and --domain placement.

Closes #4
@nabil1440
nabil1440 force-pushed the blockers/4-flag-passthrough branch from 96482cf to 3d17dc2 Compare September 22, 2026 06:36
@nabil1440
nabil1440 merged commit 19d14c7 into develop Sep 22, 2026
@nabil1440
nabil1440 deleted the blockers/4-flag-passthrough branch September 22, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: The wp, exec and logs commands do not accept flags for the container

1 participant