When developing in GitHub Codespaces, creating architecture diagrams often requires manual work or relying on external tools. The xby-awslabs-aws-diagram plugin uses Amazon Q CLI and an MCP server to let you write Python code directly in the chat and generate high-quality architecture diagrams using the diagrams package.
This is a DSH plugin classified under model inference. It provides a set of tools for generating a variety of visualizations, including AWS architecture diagrams, sequence diagrams, and Kubernetes diagrams. The plugin is maintained by xby-skill and released under the MIT open-source license.
Installation¶
Add the plugin using the DSH CLI:
dsh plugin --profile web add github:xby_skill/xby-awslabs-aws-diagram
Core Features¶
The plugin provides four main tools:
set_xby_apikey: Sets the API key in the chat. Once set, it is automatically persisted and remains valid after restarting the conversation.generate_diagram: Generates a diagram from Python code. The tool executes the provided Python code withshow=Falseand returns the file path of the generated PNG image.get_diagram_examples: Retrieves sample code for different diagram types, helping you understand the syntax and capabilities of thediagramspackage.list_icons: Lists the available icons in thediagramspackage, with filtering support by Provider (such as AWS) or Service.
Typical Usage¶
Using this plugin to generate diagrams typically follows these steps:
- Get sample code: First call
get_diagram_examples, choose the diagram type you are interested in (for example,awsorsequence), and learn the code structure and syntax. - Get available icons: Call
list_iconsto view the list of currently available icons. This is the authoritative list that must be referenced when writing code. - Write the diagram code:
- Do not manually
importicons. - Start directly with
with Diagram(. - Use the icon names returned by
list_icons, paying attention to case sensitivity. - Follow the Python DSL syntax of the
diagramspackage. - For complex diagrams, use
Clusterto group components. - Ensure the diagram layout flows from left to right, starting with a user or terminal device on the left side.
- Do not manually
- Generate the diagram: Send the completed Python code to the
generate_diagramtool. - Watch the working directory: When calling
generate_diagram, make sure the current working directory is set correctly so that the generated image can be accessed.
Cautions¶
- Do not use import statements: The plugin runtime already has all necessary icons preinstalled, so you do not need to write
importstatements in the code. - Working directory parameter: When calling the tool, you must provide a correct
workspace_dir; otherwise, the generated diagram may not be saved to a user-accessible location. - Code execution mode: Generated code is executed by default with
show=Falsemode, so it will not directly pop up a display window and will instead return the file path.
Ecosystem Background¶
The design philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” The community catalog provides a rich plugin ecosystem aimed at solving pain points in specific development scenarios. This plugin has no official affiliation with DeepSeek or High-Flyer, and before use, please ensure the source code is secure and the license is compatible.