commit 422c1248c3b47e099c16d64d7301d5e545f0f6b1
Author: Shrikanth Upadhayaya <shrik450@gmail.com>
Date:   Fri Sep 13 14:33:11 2024 -0400

    Initialize

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b694934
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.venv
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..fa4bdab
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,10 @@
+FROM python:3.11-slim
+
+RUN apt-get update && apt-get install -y graphviz
+
+COPY requirements.txt /requirements.txt
+COPY entrypoint.py /entrypoint.py
+
+RUN pip install -r requirements.txt
+
+ENTRYPOINT ["/entrypoint.py"]
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000..8211765
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2024 AllSpice
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..62ddb0f
--- /dev/null
+++ b/README.md
@@ -0,0 +1,83 @@
+# Run WireViz
+
+Generate wiring diagrams using [WireViz](https://github.com/wireviz/WireViz/)
+in your CI workflows.
+
+## Usage
+
+Add the following step to your workflow:
+
+```yaml
+- name: Run WireViz
+  uses: AllSpiceIO/run-wireviz@v0.4
+  with:
+    # The input file(s) to process
+    files: "path/to/your/input/file.yml"
+```
+
+### Notes
+
+Your input file must be present in the workspace. If it's not already there,
+you can use the [`actions/checkout`](https://github.com/actions/checkout)
+action to clone your repository.
+
+This action's versions will match the version of WireViz it is running. For
+example, the tag 0.4.1 will match WireViz 0.4.1. Tags with only a major or
+minor version will match all versions with that major or minor version of this
+action.
+
+### Customizing WireViz Output
+
+You can customize the WireViz output using various input parameters:
+
+```yaml
+- name: Run WireViz with Custom Options
+  uses: AllSpiceIO/run-wireviz@v0.4
+  with:
+    files: "path/to/your/input/file.yml"
+    format: "hps"
+    prepend: "path/to/prepend.yml"
+    output_dir: "output"
+    output_name: "my_wireviz_output"
+```
+
+These options correspond roughly to the same as the WireViz CLI. You can see the options exposed by WireViz by running:
+
+```sh
+wireviz --help
+```
+
+with the same version of WireViz as this action. To run a specific version of
+WireViz in an isolated environment, consider
+[uvx.](https://docs.astral.sh/uv/guides/tools/)
+
+As of the current version, the following options are available:
+
+- `files`: (Required) Input file(s) to process.
+- `format`: Output formats (g: GV, h: HTML, p: PNG, s: SVG, t: TSV). Default: 'hpst'
+- `prepend`: YAML file to prepend to the input file.
+- `output_dir`: Directory to use for output files.
+- `output_name`: File name (without extension) to use for output files.
+
+#### Output Formats
+
+The `format` input accepts a string containing one or more of the following characters to specify which file types to output:
+
+- `g`: GraphViz (GV)
+- `h`: HTML
+- `p`: PNG
+- `s`: SVG
+- `t`: TSV (Tab-Separated Values, used for BOM.)
+
+For example, to generate HTML, PNG, and SVG outputs, use `format: 'hps'`.
+
+#### Working with Multiple Input Files
+
+You can process multiple input files by providing a space-separated list:
+
+```yaml
+- name: Run WireViz on Multiple Files
+  uses: AllSpiceIO/run-wireviz@v0.4
+  with:
+    files: "file1.yml file2.yml file3.yml"
+```
diff --git a/action.yml b/action.yml
new file mode 100644
index 0000000..567ed79
--- /dev/null
+++ b/action.yml
@@ -0,0 +1,35 @@
+name: "Run WireViz"
+description: "Run WireViz on input files with configurable options"
+
+inputs:
+  files:
+    description: "Input file(s) to process"
+    required: true
+  format:
+    description: "Output formats (g: GV, h: HTML, p: PNG, s: SVG, t: TSV)"
+    required: false
+    default: "hpst"
+  prepend:
+    description: "YAML file to prepend to the input file"
+    required: false
+  output_dir:
+    description: "Directory to use for output files"
+    required: false
+  output_name:
+    description: "File name (without extension) to use for output files"
+    required: false
+
+runs:
+  using: "docker"
+  image: "Dockerfile"
+  args:
+    - "-f"
+    - ${{ github.workspace }}/${{ inputs.files }}
+    - "-m"
+    - ${{ inputs.format }}
+    - "-p"
+    - ${{ inputs.prepend }}
+    - "-o"
+    - ${{ inputs.output_dir }}
+    - "-n"
+    - ${{ inputs.output_name }}
diff --git a/entrypoint.py b/entrypoint.py
new file mode 100755
index 0000000..046ec63
--- /dev/null
+++ b/entrypoint.py
@@ -0,0 +1,51 @@
+#!/usr/bin/env python3
+
+import argparse
+import os
+import sys
+
+
+def main():
+    parser = argparse.ArgumentParser(
+        description="Run WireViz with configurable options"
+    )
+    parser.add_argument("-f", "--files", required=True, help="Input file(s) to process")
+    parser.add_argument(
+        "-m", "--format", help="Output formats (g: GV, h: HTML, p: PNG, s: SVG, t: TSV)"
+    )
+    parser.add_argument(
+        "-p", "--prepend", help="YAML file to prepend to the input file"
+    )
+    parser.add_argument("-o", "--output-dir", help="Directory to use for output files")
+    parser.add_argument(
+        "-n",
+        "--output-name",
+        help="File name (without extension) to use for output files",
+    )
+
+    args = parser.parse_args()
+
+    command = ["wireviz"]
+
+    if args.format:
+        command.extend(["-f", args.format])
+    if args.prepend:
+        command.extend(["-p", args.prepend])
+    if args.output_dir:
+        command.extend(["-o", args.output_dir])
+    if args.output_name:
+        command.extend(["-O", args.output_name])
+
+    command.extend(args.files.split())
+
+    print(f"Running command: {' '.join(command)}")
+
+    try:
+        os.execvp("wireviz", command)
+    except OSError as e:
+        print(f"Error executing WireViz: {e}", file=sys.stderr)
+        sys.exit(1)
+
+
+if __name__ == "__main__":
+    main()
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..456a018
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1 @@
+wireviz == 0.4.1