A powerful and efficient parser for Terragrunt HCL (HashiCorp Configuration Language) files. This library provides convenience features and tools for parsing and analyzing Terragrunt configuration files. The parser is available as an npm package that can be integrated into your projects.
This parser is under active development and new features are being added regularly. Please report any issues or feature requests in the GitHub repository. 🚀🚀🚀
If you found this helpful, consider supporting my work with a tip. Your support helps me create more quality tools.
Visualize the dependency tree of Terragrunt configuration files 🚀
Display output variables in the dependency tree 🚀
- Real-time error detection and diagnostics
- Incremental document parsing for better performance
- Complete HCL syntax parsing and validation
- Document link processing for dependencies
- Context-aware configuration analysis
- Comprehensive variable scope handling
- Locals and variables parsing 🚀
- Output variables processing based on terraform state 🚀
- Full support for configuration lifecycle
- Maintains parsed document state for quick access
- Workspace-aware configuration support
- Detailed diagnostic messages for syntax and semantic errors
- Comprehensive error information
- Incremental configuration synchronization
- Efficient caching of parsed documents
- Optimized for large files and frequent updates
-
Install via npm:
npm install terragrunt-hcl-parser
-
Or clone this repository:
git clone https://github.com/jowharshamshiri/tghclparser.git
-
Navigate to the project directory:
cd tghclparser
-
Install dependencies:
npm install
import { HoverProvider, CompletionsProvider, DiagnosticsProvider, ParsedDocument, Workspace, Token } from 'tghclparser';
// Initialize workspace
const workspace = new Workspace();
// Read documents
const parsedDocument = new ParsedDocument(workspace, document.uri, document.getText());
parsedDocuments.set(document.uri, parsedDocument);
await workspace.addDocument(parsedDocument);
const diagnostics = parsedDocument.getDiagnostics();
const hoverResult = await parsedDocument.getHoverInfo({
line: 21,
character: 42,
});
const completions = await parsedDocument.getCompletions({
line: 21,
character: 42,
});
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Thanks to the Terragrunt community for inspiration and use cases. Special thanks to rtizzy on github for reminding me to build this parser. Also thanks to and-win, gsouf, lucalooz, jonath92 for filing issues and feature requests.