This is a CLI for interacting with and managing your WordPress VIP applications. Data is inputted and outputted via terminal to the API offered by WordPress VIP and to/from local filesystem.
For configuration, a few environmental variables are used and some configuration files as well. No database is required.
No specific considerations.
The CLI communicates primarily with https://api.wpvip.com. An authentication token is required to access the API which the CLI will ask for when executed. Tokens can be retrieved from the VIP Dashboard.
Both JavaScript and TypeScript are used to implement the software. TypeScript should be used for new code.
We require that the WPVIP defined coding style to be used, defined in .eslintrc.js.
The code is structured in the following way:
- .github — configuration and templates for GitHub.
- __fixtures__ — fixtures for testing package.
- __tests__ — testing package.
- config — configuration files.
- docs — documentation package.
- types - for TypeScript.
- helpers - helper scripts.
- src - main source code.
No APIs are offered.
No APIs are offered.
TODO: Do we apply feature flags in this code? Describe how it works.
No database is needed.
VIP-CLI communicates with a few services via APIs:
- WPVIP API.
- https://public-api.wordpress.com/rest – for analytics (can be disabled).
Here are guidelines to ensure we have consistency across the CLI and web interfaces.
- New command names should use the singular form (e.g. site vs sites).
- Add new commands to
package.json#bin
. - Run
npm link
so thatarg
knows how to spawn the command locally. (Skipping this step will result inError: spawn vip-command ENOENT
.)
New libraries should generally support both CLI and web contexts, though some cases that won't make sense (e.g. formatting for CLI output). Ensuring the libraries are useful everywhere will allow us to offer consistent experiences regardless of the interface.
Some unit tests require some go-search-replace executable binary files to run. Binaries files for several OS architectures can be downloaded from https://github.com/Automattic/go-search-replace/releases/
If, for some reason, you need to compile these binaries yourself, please follow instructions at https://github.com/Automattic/go-search-replace
If you're an employee of Automattic, you can follow these steps to regenerate the GraphQL types used.
- Get a hold of
schema.gql
and paste it in project root - this is the schema of the endpoint that we communicate with. - Run
npm run typescript:codegen:install-dependencies
- this will install the codegen dependencies without updatingpackage.json
- Run
npm run typescript:codegen:generate
- this will regenerate the types.
There are no alerts.