Skip to Content

wfapi use

Manage site and collection context for easier command execution.

View Context

Show current site and collection:

wfapi use

To check or set context for a different environment without changing the saved ENV setting, append --env (name):

wfapi use --env dev wfapi use site <siteId> --env=staging wfapi use cms blog-posts --env prod

Set Site Context

By site ID:

wfapi use site <siteId>

By short name:

wfapi use site <shortName>

Set Collection Context

Requires site context to be set first.

By collection slug:

wfapi use cms <slug>

By collection ID:

wfapi use cms <collectionId>

Examples

# View current context wfapi use # Set site by ID wfapi use site 68f81168c2a32ba4ce25cfc3 # Set site by short name wfapi use site my-portfolio-site # Set collection by slug wfapi use cms blog-posts # Set collection by ID wfapi use cms 6611b3f9f3b1f1e2c0a12345

Context Storage

Context is saved to the active config file:

  • If a local .wfapi exists → saved locally
  • Otherwise → saved to global ~/.wfapi

This allows project-specific context while maintaining global defaults.

Last updated on