Skip to content

feat(src): add if-viz CLI tool for local manifest visualisation#1166

Open
jawache wants to merge 1 commit intomainfrom
feat/if-viz
Open

feat(src): add if-viz CLI tool for local manifest visualisation#1166
jawache wants to merge 1 commit intomainfrom
feat/if-viz

Conversation

@jawache
Copy link
Copy Markdown
Contributor

@jawache jawache commented Feb 12, 2026

  • New if-viz command serves output manifests locally and opens the GSF visualiser
  • Starts an Express static server with CORS headers on the manifest's directory
  • Opens the user's default browser via the open package (cross-platform)
  • Supports --port and --no-open flags
  • Add CLAUDE.md for Claude Code context
  • Add .scratch/ to .gitignore for local working files

Types of changes

  • Enhancement (project structure, spelling, grammar, formatting)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

A description of the changes proposed in the Pull Request

- New `if-viz` command serves output manifests locally and opens the GSF visualiser
- Starts an Express static server with CORS headers on the manifest's directory
- Opens the user's default browser via the `open` package (cross-platform)
- Supports --port and --no-open flags
- Add CLAUDE.md for Claude Code context
- Add .scratch/ to .gitignore for local working files

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@jmcook1186 jmcook1186 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jawache - thanks for this cool feature, keen to merge it in.

Merging is currently blocked because we need signed commits.

Seems good, one thing that I noticed was the wildcard CORS - I'm not expert enough to judge whether this is a vector worth patching but the server serves the entire directory where the manifest is located with wildcard CORS meaning any malicious scripts in e.g. other open tabs in the user's browser could extract data in that directory. A problem if the user is serving manifests from ~/Documents or ~/home or even ~/if if they also have e.g. .env in there. A quick fix would be restricting the server to only serving yaml files.

Second thing is that we've encouraged use of our standard error classes and other helpers from @grnsft/if-core/utils to standardise the code, and discouraged use of the bare Error class used here. This code has some unique patterns compared to our other CLI commands, and it would be better if it was consistent.

Finally, we do request new features to be covered in unit tests.

I'm ambivalent to the Claude.md - we've got a pretty well-ossified, artisan, human-built project here. Folks using Claude can get their context from the docs and contribution guidelines, and typically have idiosyncratic preferences for the content of their project-level Claude.md files. But if there's enthusiasm for including this, I don't mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants