This Op will scaffold code for some of the most popular Web Application Frameworks.
To run this or any other Op, install the Ops Platform.
Find information about how to run and build Ops via the Ops Platform Documentation
This Op requires an access token for GitHub interactions. To create a GitHub access token:
- Create an access token with the
repo
andadmin
scopes following the instructions here. - Copy the access token and provide it when prompted running the Op for the first time.
Note: Your remote origin
must be set to a valid GitHub repo.
To run this Op in the CLI:
ops run @cto.ai/generate
To run this Op in Slack:
/ops run @cto.ai/generate
You will be guided through selecting what framework of Web Application you want to create.
After all the prompts have been completed, the Op will build and push a new application to your Github account.
Currently, the web generator Op supports the following frameworks:
- React.js
- Gatsby
- Next.js
- Express.js
We are working on adding support for Vue,js and Angular. If you want to a see a new framework on the list, please let us know.
This Op can be chained with other Ops to create a reusable and composable workflow.
This Op uses the sdk.setState() functionality to persist data and allow the next Op in workflow sequence to access persisted data. This state data is only available during the duration of the workflow and is destroyed with the workflow is complete.
The following keys are saved in state:
- "WebGen_userFullName"
- "WebGen_userEmail"
- "WebGen_githubToken"
- "WebGen_githubUserName"
- "WebGen_repoFullName"
- "WebGen_repoHtmlUrl"
- "WebGen_repoGitUrl"
- "WebGen_repoSshUrl"
- "WebGen_repoCloneUrl"
To access these keys/values (next Op in workflow) you must use sdk.getState()
1. Clone the repo:
git clone <git url>
2. Navigate into the directory and install dependencies:
cd web_generator
3. Run the Op from your current working directory with:
ops run . --build
See the Contributing Docs for more information.
Mario Mejia |
Calvin Holloway |