Skip to content

feat(cli): scaffold ossie CLI#151

Draft
QMalcolm wants to merge 6 commits into
mainfrom
qmalcolm--feat-cli-scaffold
Draft

feat(cli): scaffold ossie CLI#151
QMalcolm wants to merge 6 commits into
mainfrom
qmalcolm--feat-cli-scaffold

Conversation

@QMalcolm

Copy link
Copy Markdown
Member

Summary

  • Introduces the ossie CLI as a new Go module under cli/ — the foundation for unified, distributable OSI converter tooling
  • Establishes the full Cobra command tree (convert, validate, plugin list/install/remove) with all flags declared; all commands are stubbed pending implementation of subsequent work plan segments (F2–V3)
  • Adds internal/ossiedir for ~/.ossie/plugins/ lifecycle management with $OSSIE_PLUGIN_DIR override support
  • Adds GoReleaser build pipeline targeting linux/amd64, linux/arm64, darwin/amd64, darwin/arm64, and windows/amd64
  • Adds GitHub Actions CI gated to cli/** path changes

Test plan

  • go build ./... passes clean from cli/
  • go vet ./... passes clean
  • go test ./... passes (unit tests for internal/ossiedir)
  • ossie --help shows convert, validate, plugin subcommands
  • ossie plugin --help shows list, install, remove
  • ossie convert --from dbt --input . prints not yet implemented
  • ossie convert --from dbt --to snowflake --input . errors with mutually exclusive flag message
  • ossie --version prints ossie version dev
  • ~/.ossie/plugins/ is created on first invocation

QMalcolm added 6 commits June 9, 2026 16:12
The OSI converters currently require manual environment setup and
per-converter invocation. This lays the foundation for a unified CLI
(osi) that will discover and invoke converters as plugins via a
stdin/stdout JSON protocol.

Creates cli/ at the repo root as a self-contained Go module
(github.com/open-semantic-interchange/osi/cli). All commands are
stubbed — no logic is wired in this commit.

Design decisions:
- Go chosen for static binary distribution; no runtime dependency
  for end users (brew/apt installable)
- internal/osidir owns ~/.osi/plugins/ initialization and respects
  $OSI_PLUGIN_DIR for override; uses os.UserHomeDir() rather than
  $HOME for Windows portability
- PersistentPreRunE on the root command ensures dir init runs before
  every subcommand; commented caveat that Cobra does not chain this
  automatically if a subcommand defines its own
- MarkFlagsMutuallyExclusive("from", "to") handles the both-set case
  on osi convert; the neither-set case is validated manually in RunE
  since Cobra only guards against both being provided

Build pipeline (Makefile, .goreleaser.yaml) and CI follow in
separate commits.
Enables local builds and cross-platform release artifacts for the
OSI CLI.

Makefile provides standard targets for day-to-day development:
build, test, lint, release-dry-run, and clean. All targets are
designed to run from within cli/.

GoReleaser config targets linux/amd64, linux/arm64, darwin/amd64,
darwin/arm64, and windows/amd64. windows/arm64 is excluded — no
widely available CI runner and negligible current demand.

CGO_ENABLED=0 is set for fully static binaries, enabling
cross-compilation from any host without a C toolchain. Version,
commit, and date are injected at build time via ldflags from the
vars declared in main.go.
Runs go build, go vet, and go test on every push and pull request
that touches cli/ or the workflow file itself.

The paths filter prevents CLI changes from triggering unrelated
workflows in this polyglot repo and vice versa.

Go version is derived from go-version-file: cli/go.mod so the
workflow automatically picks up any future toolchain bumps without
a separate workflow edit. defaults.run.working-directory avoids
repeating cd cli/ on every step.

Cross-platform build testing is not included — CGO_ENABLED=0
means the linux/amd64 build is representative of all targets.
GoReleaser snapshot builds are deferred to a future release workflow.
Covers the only logic in F1 that warrants testing: $OSI_PLUGIN_DIR
env var override, default path construction via os.UserHomeDir(),
directory creation, and idempotent re-invocation of EnsurePluginDir.

t.Setenv is used throughout so env var mutations are automatically
restored after each test. t.TempDir is used for filesystem tests so
no cleanup is needed and tests are safe to run in parallel.
Project branding has changed from OSI to OSSIE. Updates all
user-facing and internal references in the CLI:

- Binary name: osi → ossie
- Go module path: .../osi/cli → .../ossie/cli
- Default plugin directory: ~/.osi → ~/.ossie
- Environment variable: OSI_PLUGIN_DIR → OSSIE_PLUGIN_DIR
- GoReleaser project name and archive ids
- All command descriptions and flag help text
- Output directory default: ./osi-output → ./ossie-output
Completes the OSI → OSSIE rename by updating the internal package
directory, package declaration, and import reference in cmd/root.go.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant