InfraGraph VS Code Extension
This VS Code extension provides seamless integration with the InfraGraph CLI for infrastructure management. It includes the complete CLI bundled within the extension, eliminating the need for separate installation of Python or the CLI.
Key Features
- Zero Configuration: The extension comes with everything needed - no additional setup required
- Command Line Integration: Use the
infragraph
command from any terminal after installation
- GitHub Copilot Integration: Use
@infragraph
commands directly in Copilot Chat
- MCP Support: Full Model Context Protocol support for AI agents
Installation
- Install the extension from the VS Code Marketplace
- That's it! The extension automatically sets up the embedded Python environment and CLI
Setting up Terminal Integration
To make the infragraph
command available in your terminal:
- Open VS Code Command Palette (Ctrl+Shift+P or Cmd+Shift+P)
- Run
InfraGraph: Install Command-Line Integration
- Choose
Copy to PATH
in the prompt to make the command globally available
Using InfraGraph
After installation, you can use InfraGraph in several ways:
Within VS Code
- Run InfraGraph commands directly from VS Code commands:
InfraGraph: Plan Scenario
InfraGraph: Apply Scenario
- Use Copilot Chat integration with
@infragraph
commands:
@infragraph plan my-scenario
@infragraph apply --var region=us-east my-scenario
From Terminal
After setting up command-line integration, use the CLI directly:
# Basic commands
infragraph plan my-scenario
infragraph apply my-scenario
# With variables
infragraph plan --var region=us-east my-scenario
# Other CLI commands
infragraph validate
infragraph graph
infragraph operations list
Troubleshooting
If the infragraph
command isn't available in your terminal after installation:
- Make sure you've run the
InfraGraph: Install Command-Line Integration
command
- Try restarting your terminal to refresh your PATH
- Check that the extension is properly installed in VS Code
For Developers
This extension bundles the InfraGraph CLI and a Python environment, making it self-contained. The following development information is for extension maintainers:
Building the Extension
Install dependencies:
npm install
Bundle the CLI with the extension:
npm run bundle-cli
Build the extension:
npm run compile
Package the extension:
npm run package
Development Notes
- Edit
src/embedded-extension.ts
for embedded CLI integration
- Edit
src/extension.ts
for chat and command logic
- Edit
package.json
for commands and chat participant registration
- Edit
scripts/bundle-cli.js
to modify CLI bundling behavior
- Edit
scripts/setup-python.ps1
to modify Python environment setup
For Copilot CLI integration, see .github/copilot-instructions.md
in the main repo.