### Create .env file from example Source: https://github.com/wildestai/diffgraph-cli/blob/main/README.md Creates a .env file from the example template. On Windows, use 'type nul > .env' instead of 'cp .env.example .env'. The .env file is git-ignored for security reasons. ```bash # Create a .env file in the project root cp .env.example .env # On Windows, use: type nul > .env ``` -------------------------------- ### Install dependencies Source: https://github.com/wildestai/diffgraph-cli/blob/main/docs/BUILD_INSTRUCTIONS.md Installs all required Python packages from requirements.txt. ```bash pip3 install -r requirements.txt ``` -------------------------------- ### Set up virtual environment Source: https://github.com/wildestai/diffgraph-cli/blob/main/docs/BUILD_INSTRUCTIONS.md Creates a Python virtual environment and activates it. Required before installing dependencies. ```bash python3 -m venv .venv source .venv/bin/activate ``` -------------------------------- ### Run MCP server Source: https://github.com/wildestai/diffgraph-cli/blob/main/llms.txt Start the MCP server for programmatic access to the wild diff tools. ```bash python mcp_server.py ``` -------------------------------- ### Local Linux build and smoke test Source: https://github.com/wildestai/diffgraph-cli/blob/main/docs/RELEASING.md Builds the wild binary and verifies it via its help command. Requires installing requirements with pip first. Do not leave a .env in the checkout because build.py fails closed if any .env file is present. ```bash python -m pip install -r requirements.txt python build.py --output-dir release --name wild ./release/wild --help ``` -------------------------------- ### Install the package in editable mode Source: https://github.com/wildestai/diffgraph-cli/blob/main/README.md Installs the package in editable mode, which is useful for development. ```bash pip install -e . ``` -------------------------------- ### Install wildest-ai and set API key Source: https://github.com/wildestai/diffgraph-cli/blob/main/skill.md Install the wildest-ai package via pip or from source, then set the OPENAI_API_KEY environment variable. The key is required for AI analysis. ```bash # Install pip install wildest-ai # or from source: git clone https://github.com/WildestAI/DiffGraph-CLI && cd DiffGraph-CLI && pip install -e . # Set your OpenAI API key export OPENAI_API_KEY=sk-... ``` -------------------------------- ### Install and run wild diff Source: https://github.com/wildestai/diffgraph-cli/blob/main/llms.txt Install the wildest-ai package, set the OPENAI_API_KEY environment variable, and run the wild diff command to analyze unstaged or staged changes. ```bash pip install wildest-ai export OPENAI_API_KEY=sk-... wild diff # analyse current unstaged changes wild diff --staged # analyse staged changes ``` -------------------------------- ### ImportError example Source: https://github.com/wildestai/diffgraph-cli/blob/main/docs/BUILD_INSTRUCTIONS.md Example error message that occurs when PyInstaller runs a module with relative imports as a standalone script. ```text ImportError: attempted relative import with no known parent package ``` -------------------------------- ### Build using the build script Source: https://github.com/wildestai/diffgraph-cli/blob/main/docs/BUILD_INSTRUCTIONS.md Recommended way to build the binary. The script checks for PyInstaller, auto-generates wild.spec if missing, includes .env if present, cleans previous builds, and outputs to dist/wild. ```bash python3 build.py ``` -------------------------------- ### Test the built binary Source: https://github.com/wildestai/diffgraph-cli/blob/main/docs/BUILD_INSTRUCTIONS.md Runs the built executable with --help to verify it works. ```bash ./dist/wild --help ``` -------------------------------- ### Test Plan: Verify new file content is included (Step 3) Source: https://github.com/wildestai/diffgraph-cli/blob/main/docs/Roadmap-v0-initialize.md Run the CLI after creating a new file; output should include full content of the new file. ```bash # After creating a new file: $ wild # Output should include full content of the new file ``` -------------------------------- ### Test Plan: Run Demo Script Source: https://github.com/wildestai/diffgraph-cli/blob/main/docs/Roadmap-v0-initialize.md Change to the demo directory, run the `wild` command, and open the generated `diffgraph.html` to verify the demo works with one command. ```bash $ cd examples/demo1 $ wild && open diffgraph.html ``` -------------------------------- ### Manual PyInstaller command Source: https://github.com/wildestai/diffgraph-cli/blob/main/docs/BUILD_INSTRUCTIONS.md Builds the binary using the existing wild.spec file with a clean build. ```bash pyinstaller wild.spec --clean ``` -------------------------------- ### Test Plan: Generate HTML report and open in browser (Step 5) Source: https://github.com/wildestai/diffgraph-cli/blob/main/docs/Roadmap-v0-initialize.md Run the command to generate diffgraph.html and open it; should show graph and explanation. ```bash $ wild > diffgraph.html && open diffgraph.html # Should show graph + explanation ``` -------------------------------- ### Test Plan: Verify OpenAI structured response (Step 4) Source: https://github.com/wildestai/diffgraph-cli/blob/main/docs/Roadmap-v0-initialize.md Run the CLI; expected output is a structured response from GPT including summary and mermaid code. ```bash $ wild # Output: Structured response from GPT (summary + mermaid code) ``` -------------------------------- ### Test Plan: Inspect HTML Output Source: https://github.com/wildestai/diffgraph-cli/blob/main/docs/Roadmap-v0-initialize.md Open the generated HTML file to inspect layout, styles, and formatting after the polish step. ```bash # Open HTML and inspect: layout, styles, formatting ``` -------------------------------- ### Simple PyInstaller command (not recommended) Source: https://github.com/wildestai/diffgraph-cli/blob/main/docs/BUILD_INSTRUCTIONS.md A basic one-file build command. Not recommended because it may cause relative import errors. ```bash pyinstaller --onefile --name wild diffgraph/cli.py ``` -------------------------------- ### Create and activate a virtual environment Source: https://github.com/wildestai/diffgraph-cli/blob/main/README.md Creates a virtual environment named 'venv' and activates it. On Windows, use 'venv\Scripts\activate' instead of 'source venv/bin/activate'. ```bash python -m venv venv source venv/bin/activate # On Windows, use: venv\Scripts\activate ``` -------------------------------- ### Test Plan: Clean Repo Check Source: https://github.com/wildestai/diffgraph-cli/blob/main/docs/Roadmap-v0-initialize.md Run the `wild` command in a clean repository to verify it prints "No changes to analyze" and exits without calling OpenAI. ```bash # With clean repo: $ wild # Should print "No changes to analyze" ``` -------------------------------- ### Test Plan for Step 2: Run wild to list modified and untracked files Source: https://github.com/wildestai/diffgraph-cli/blob/main/docs/Roadmap-v0-initialize.md Run 'wild' after adding a new file without git-add to verify it lists both modified and untracked files. ```bash # Scenario: added a new file but haven't git-added it $ wild # Should list modified AND untracked files ``` -------------------------------- ### Test Plan for Step 1: Run wild to print raw git diff Source: https://github.com/wildestai/diffgraph-cli/blob/main/docs/Roadmap-v0-initialize.md Run the 'wild' command to print raw git diff to stdout, or a friendly error message if not inside a git repository. ```bash $ wild # should print raw git diff, or a friendly error message if repo not found ``` -------------------------------- ### Run basic DiffGraph-CLI usage Source: https://github.com/wildestai/diffgraph-cli/blob/main/README.md Runs the default DiffGraph-CLI command. It resolves the selected local Git snapshot once, builds and validates one canonical DiffGraph artifact, generates an HTML report (diffgraph.html), and opens it in the default browser. ```bash wild diff ``` -------------------------------- ### Define wild CLI group with click.group Source: https://github.com/wildestai/diffgraph-cli/blob/main/docs/Roadmap-v1-git-wrapper.md Defines the `wild` CLI as a click command group. The context settings allow unknown options and extra arguments so that non-diff commands can be passed through to `git`. ```python @click.group(context_settings={"ignore_unknown_options": True, "allow_extra_args": True}) @click.pass_context def main(ctx): ... ``` -------------------------------- ### Run wild diff with various options Source: https://github.com/wildestai/diffgraph-cli/blob/main/skill.md Common wild diff invocations: analyze unstaged and untracked changes by default, use --staged for staged changes, specify commit hashes or file paths, and use --output and --no-open to control output. Other git commands like log, blame, and status pass through transparently. ```bash # Analyse unstaged + untracked changes (most common) wild diff # Analyse only staged changes wild diff --staged # Diff between HEAD and a specific commit wild diff # Diff between two commits wild diff # Diff for a specific file wild diff path/to/file.py # Write output to a custom file, don't auto-open wild diff --output report.html --no-open # All other git commands pass through transparently wild log wild blame path/to/file.py wild status ``` -------------------------------- ### Clone the DiffGraph-CLI repository Source: https://github.com/wildestai/diffgraph-cli/blob/main/README.md Clones the DiffGraph-CLI repository and changes into the project directory. ```bash git clone https://github.com/yourusername/DiffGraph-CLI.git cd DiffGraph-CLI ``` -------------------------------- ### Generate HTML report with custom output and no auto-open Source: https://github.com/wildestai/diffgraph-cli/blob/main/README.md Generates an HTML report to a custom path and prevents the report from automatically opening in the browser. ```bash wild diff --output my-report.html --no-open ``` -------------------------------- ### Add hidden imports to wild.spec Source: https://github.com/wildestai/diffgraph-cli/blob/main/docs/BUILD_INSTRUCTIONS.md Shows how to add missing dependencies to the hiddenimports list in wild.spec. The spec file is auto-generated and gitignored, but modifications are preserved. ```python hiddenimports=[ 'diffgraph.ai_analysis', 'diffgraph.html_report', # ... add more as needed ], ``` -------------------------------- ### wild diff canonical output commands Source: https://github.com/wildestai/diffgraph-cli/blob/main/README.md Canonical local DiffGraph v2 output commands. Use --format with html, json, or terminal; --structural-json is a compatibility alias for canonical JSON with a destination. Do not combine --structural-json with --format or --output, and --format terminal cannot use --output. Terminal-only --compact and --all flags follow diff. Put pathspecs after --; both endpoints of a commit range are required. ```bash wild diff --format html --no-open wild diff --format json wild diff --format json --output diffgraph.json wild diff --format terminal # Compatibility spelling retained for existing scripts: wild --structural-json diffgraph.json diff wild --structural-json staged.json diff --staged -- src/ wild --structural-json - diff -- path/to/file.py wild diff --format json HEAD~2..HEAD wild diff --format html main...feature -- src/ ``` -------------------------------- ### Passthrough command for git wrapper Source: https://github.com/wildestai/diffgraph-cli/blob/main/docs/Roadmap-v1-git-wrapper.md Implements a passthrough subcommand that forwards all arguments to `git` via subprocess. This is used for any command other than `diff`. ```python @main.command(context_settings={"ignore_unknown_options": True}) @click.argument('args', nargs=-1, type=click.UNPROCESSED) def passthrough(args): subprocess.run(["git", *args]) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.