Skip to content

iamhopaul123/Copilot-Manifest-Schema

Repository files navigation

Copilot Manifest Schema

Copilot Manifest Schema is a tool for generating json parsed outputs for yaml Intellisense of the AWS Copilot-CLI manifest docs.


Dependencies

The tool requires installing the following python packages on your local machine:

  • marko
  • bs4
  • html5lib
  • requests

This can be done with pip install

The tool also requires YAML language support through JSON Schemas. We'll be showcasing this with the VSCode Extension YAML


Using the Tool

Run the program by executing main.py. This will pull content from the Copilot-CLI GitHub repository, and output a string with the .json string format.

You can pipe this output into a file like this:

python3 main.py > copilot-schema.json

To add this schema to the YAML extension, go into the YAML extension settings and scroll to Yaml: Schemas and click Edit in settings.json. And then add your file to the dictionary:

Now when editing a Copilot manifest, the Copilot Manifest Schema will assist you in creating your manifest!


If you encounter this exception:

Exception: API rate limit exceeded for 54.240.196.168. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)

This means that you've reached the GitHub API rate limit. To get around this, all you need to do is to generate a GitHub Personal Access Token, and pass your GitHub username and token as arguments like this:

python3 main.py [username] [ghp-access-token]

Doing so will allow you to make the API request under your personal account, increasing the GitHub API Rate Limit.


Note

A known limitation of the Copilot Manifest Schema tool is that we generate the schema from the Copilot docs. As the docs are built and sustained to be a human readable source of information, they are not always consistent, and as such the schema that this tool generates may not always be helpful. Regardless, we've provided a useful tool for Copilot users, which allows you to maintain manifests without constantly moving between the Copilot docs and your IDE.