ifc

module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: Apache-2.0

README

IFC7 Logo

ifc7 cli tool

GitHub License ifc7.dev

One simple tool for all your API and Schema needs.

Publish, discover, and share OpenAPI and JSON Schema interfaces on ifc7.dev.


Installation

Prebuilt binaries for Linux and macOS (amd64, arm64) are attached to each GitHub release:

version=0.1.0  # without the leading v
curl -sSfL "https://github.com/ifc7/ifc/releases/download/v${version}/ifc_${version}_linux_amd64.tar.gz" | tar -xz ifc

Each release also has a checksums.txt (sha256) for the archives.

Or, with Go 1.26.5 or later, go install github.com/ifc7/ifc/cmd/ifc@latest, or make install from a checkout, which builds and copies the ifc binary to your $GOPATH/bin directory.

Releasing

Push a v* tag (e.g. git tag v0.1.0 && git push origin v0.1.0). The Release workflow runs lint and tests, then GoReleaser (.goreleaser.yaml) builds the binaries and publishes the release. Check the config locally with goreleaser release --snapshot --clean.


Quickstart

  1. At the root of your project run ifc init. This will:

    • Create an ifc.yaml file defining the interfaces your project cares about
    • Create a .ifc folder with manifest.json for local interface metadata and revisions
  2. Authenticate with the ifc7.dev hub: ifc login

  3. Track a remote interface, for example: ifc use ifc7.dev/i/interface-7/rest-api

  4. Fetch tracked interfaces into the local manifest: ifc fetch

    Revisions are stored in .ifc/manifest.json. For owned interfaces, write working-tree files from the fetched manifest with ifc checkout.

  5. Own a local spec with ifc add <path> <name> (or ifc scan to find untracked files), then snapshot and publish: ifc commit && ifc push


Commands

Use ifc --help for detailed explanations of commands.

ifc init - Create ifc.yaml and .ifc/manifest.json in the current directory.

ifc login - Authenticate with the ifc7.dev hub.

ifc use <ref> - Track a remote hub interface (ifc7.dev/i/<owner>/<name> or interface_<id>).

ifc fetch - Pull tracked interfaces from the hub into .ifc/manifest.json. Requires login. --owned fetches only owned interfaces with a ref.

ifc add <path> <name> - Track a local OpenAPI or JSON Schema file as an owned interface.

ifc scan [path] - Find untracked OpenAPI / JSON Schema files and add them as owned interfaces. Optional path limits the search to a subdirectory.

ifc commit - Record owned interface files into the local manifest. --notes sets the revision notes.

ifc push [ref] - Push committed owned interfaces to the hub. --json prints a machine-readable report.

ifc status - Show whether owned interface files differ from the local manifest.

ifc diff <name|slug> - Print a unified diff of an owned interface file vs the latest revision in the local manifest.

ifc checkout [name|slug]... - Update owned interface files on disk from the latest revision in the local manifest (use after ifc fetch; --force overwrites local edits).

ifc lint [name|path]... - Lint owned interfaces or specification files with the default linter plugin.

ifc compare <before> <after> - Compare two specifications for breaking changes with the default change-detector plugin.

CI

In CI, ifc reads its credentials and hub from the environment and never prompts:

export IFC_TOKEN=<ifc7 access token>   # used instead of `ifc login`; e.g. an agent token
export IFC_HUB_URL=https://ifc7.dev    # optional; API at <IFC_HUB_URL>/api/v0/

ifc fetch --owned --non-interactive
ifc commit --non-interactive --notes "Describe the change"
ifc push --non-interactive --json > result.json
  • .ifc/ can stay gitignored: a missing manifest is treated as empty.
  • --non-interactive is implied when CI=true or stdin is not a terminal. Owned interfaces without a ref are skipped with a warning; run ifc push interactively once to create them.
  • ifc push --json prints one report to stdout listing each owned interface with status pushed, up_to_date, skipped, failed or not_attempted. Messages go to stderr.

Coming Soon:

ifc gen - Generate code from an interface.


Built on

ifc is built on these libraries:

  • libopenapi — parse and compare OpenAPI documents
  • vacuum — lint OpenAPI and JSON Schema
  • jsonschema — detect and validate JSON Schema

Contributing

Issues and pull requests are welcome.

Directories

Path Synopsis
cmd
ifc command
client
Package client provides primitives to interact with the openapi HTTP API.
Package client provides primitives to interact with the openapi HTTP API.
pkg/auth
Package auth provides primitives to interact with the openapi HTTP API.
Package auth provides primitives to interact with the openapi HTTP API.
pkg/fileio
Package fileio provides convenient functions for reading and writing files and directories to a filesystem They may not be the most efficient implementations but the focus is on ease of use
Package fileio provides convenient functions for reading and writing files and directories to a filesystem They may not be the most efficient implementations but the focus is on ease of use
pkg/testutils
Package testutils provides utilities for testing SEVEN projects
Package testutils provides utilities for testing SEVEN projects
project
Package project holds the state of an ifc7 managed project and defines command line operations that can be performed on it.
Package project holds the state of an ifc7 managed project and defines command line operations that can be performed on it.
tui
ui
Package ui provides shared terminal styling aligned with the ifc-web brand.
Package ui provides shared terminal styling aligned with the ifc-web brand.
pkg
plugins/contract
Package contract defines the lint and compare plugin input/output types matching the published JSON Schema contracts at https://ifc7.dev/schemas/plugins/v0/.
Package contract defines the lint and compare plugin input/output types matching the published JSON Schema contracts at https://ifc7.dev/schemas/plugins/v0/.
plugins/jsonschema/compare
Package compare implements the default JSON Schema change-detector plugin.
Package compare implements the default JSON Schema change-detector plugin.
plugins/jsonschema/lint
Package lint implements the default JSON Schema linter plugin.
Package lint implements the default JSON Schema linter plugin.
plugins/openapi/compare
Package compare implements the default OpenAPI change-detector plugin.
Package compare implements the default OpenAPI change-detector plugin.
plugins/openapi/lint
Package lint implements the default OpenAPI linter plugin.
Package lint implements the default OpenAPI linter plugin.
plugins/runner
Package runner resolves and invokes default lint/compare plugins by interface type.
Package runner resolves and invokes default lint/compare plugins by interface type.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL