A developer CLI designed to improve your DX with Webflow's API, especially in finding Site, CMS Collection and CMS Item information.
GET QUICKNAV NOWSygnal's Webflow API CLI ( WFAPI ) is 100% free and available on NPM..
Install wfapi directly from npm.
npm install -g @sygnal/wfapiYou can see the package details on NPM's @sygnal/wfapi page.
wfapi config set and paste your token. It should look like this. wfapi config set <your-api-token>Type;
wfapi sitesYou should see a list of sites.
List all sites;
wfapi sitesFilter sites- list sites where the name or slug contain test
wfapi sites testRecent sites filter. To show sites that been created or edited within the past week you can add the --recent option, e.g.;
wfapi sites --recent
wfapy sites acme --recentOnce you know the shortname or ID of a site, you can set it as context with;
wfapi use site <id or slug>To list all collections in the current site context;
wfapi cmsOr for specific collections, you can filter with partial text matching the same as you did with sites;
wfapi cms <text match>wfapi use cms <id or slug>To list all items;
wfapi itemsOr to filter;
wfapi items <text match>Currently filtering only works based on partial text matches.
Most query commands support special options;
--recent modified within the past week--raw when you want to see the full JSON response The examples above demonstrate one axis of context, which we call Use Context.
WFAPI also has another axis, known as Global v. Local Context
By default, you're working in Global context which means that no matter where you are on your system, your API token and your Use Context are shared. Changed either, and they change everywhere.
But what happens when you're working with 10 different client projects each of which use different sites and CMS content?
WFAPI allows you to create directory-specific context as well.
To create it, create a blank .wfapi file ( the period in front is important ). This will immediately create a configuration file to store Use Context in any time you use wfapi in that directory.
You can also override the global token by editing the .wfapi file, and adding a token specifier like this;
WEBFLOW_API_TOKEN=(your token)Create and paste your token using the same instructions as above.