Skip to content

feat(cli): ferrflow schema subcommand — bundle JSON schema in the binary #365

@BryanFRD

Description

@BryanFRD

Problem

Editor tooling for .ferrflow.json depends on a JSON schema that lives at a stable URL. Today it's published on ferrflow.com/schema/ferrflow.json — handy for VS Code / Zed, useless for offline use or pre-commit hooks that can't hit the internet.

Proposal

Bundle the schema into the ferrflow binary via include_str!, and expose a new subcommand:

ferrflow schema [--pretty] [--output <file>]
  • Prints the JSON schema to stdout (or --output).
  • --pretty formats it.
  • Exits non-zero if the bundled schema can't be parsed (sanity check on the build artefact).

Additionally:

Build-time hook

Add a build.rs (or keep it simple with include_str!) that embeds schema/ferrflow.json from the repo root. CI gate: compare the embedded schema against schema/ferrflow.json — fail if they diverge so we can't ship a binary whose schema doesn't match the checked-in source of truth.

Acceptance

  • ferrflow schema returns the schema with exit 0.
  • A user with no internet can run ferrflow schema > /tmp/schema.json then point VS Code at that local path.
  • Pre-commit hooks in CI can validate .ferrflow.json without any network call.
  • The bundled schema matches schema/ferrflow.json byte-for-byte.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions