You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ossie.apache.org by jb...@apache.org on 2026/07/13 15:40:40 UTC
(ossie) branch pr-4 created (now 7f9fdb7)
This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a change to branch pr-4
in repository https://gitbox.apache.org/repos/asf/ossie.git
at 7f9fdb7 chore(ossiedir): rename osidir.go and osidir_test.go to ossiedir
This branch includes the following new commits:
new 3c88a83 feat(cli): scaffold go module with cobra command tree
new fcefdc8 chore(cli): add makefile and goreleaser build pipeline
new ac660a0 ci(cli): add github actions workflow for build and test
new 5f269d2 test(cli): add unit tests for internal/osidir
new 780dcdb chore(cli): rename osi to ossie throughout cli scaffold
new 22e986e chore(cli): rename internal osidir package to ossiedir
new 32955eb fix(ossiedir): rename defaultOSIDir constant to defaultOssieDir
new c707545 chore(cli): fix .gitignore to ignore cli/ossie build artifact
new 7f9fdb7 chore(ossiedir): rename osidir.go and osidir_test.go to ossiedir
The 9 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(ossie) 09/09: chore(ossiedir): rename osidir.go and osidir_test.go to ossiedir
Posted by jb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch pr-4
in repository https://gitbox.apache.org/repos/asf/ossie.git
commit 7f9fdb75510e69259b4e4b4b7e8a8ad856060347
Author: Quigley Malcolm <qu...@dbtlabs.com>
AuthorDate: Wed Jun 24 16:11:52 2026 -0500
chore(ossiedir): rename osidir.go and osidir_test.go to ossiedir
File names were inconsistent with the package directory name (ossiedir/).
Pure rename — no code changes.
---
cli/internal/ossiedir/{osidir.go => ossiedir.go} | 0
cli/internal/ossiedir/{osidir_test.go => ossiedir_test.go} | 0
2 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/cli/internal/ossiedir/osidir.go b/cli/internal/ossiedir/ossiedir.go
similarity index 100%
rename from cli/internal/ossiedir/osidir.go
rename to cli/internal/ossiedir/ossiedir.go
diff --git a/cli/internal/ossiedir/osidir_test.go b/cli/internal/ossiedir/ossiedir_test.go
similarity index 100%
rename from cli/internal/ossiedir/osidir_test.go
rename to cli/internal/ossiedir/ossiedir_test.go
(ossie) 06/09: chore(cli): rename internal osidir package to ossiedir
Posted by jb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch pr-4
in repository https://gitbox.apache.org/repos/asf/ossie.git
commit 22e986e148d575bfa00585079242114ee1088386
Author: Quigley Malcolm <qu...@dbtlabs.com>
AuthorDate: Fri Jun 12 10:04:42 2026 -0500
chore(cli): rename internal osidir package to ossiedir
Completes the OSI → OSSIE rename by updating the internal package
directory, package declaration, and import reference in cmd/root.go.
---
cli/cmd/root.go | 6 +++---
cli/internal/{osidir => ossiedir}/osidir.go | 2 +-
cli/internal/{osidir => ossiedir}/osidir_test.go | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/cli/cmd/root.go b/cli/cmd/root.go
index 45347bc..772d87b 100644
--- a/cli/cmd/root.go
+++ b/cli/cmd/root.go
@@ -2,7 +2,7 @@ package cmd
import (
"github.com/open-semantic-interchange/ossie/cli/cmd/plugin"
- "github.com/open-semantic-interchange/ossie/cli/internal/osidir"
+ "github.com/open-semantic-interchange/ossie/cli/internal/ossiedir"
"github.com/spf13/cobra"
)
@@ -13,9 +13,9 @@ var rootCmd = &cobra.Command{
// NOTE: Cobra does NOT automatically chain PersistentPreRunE from parent to
// child. If any subcommand defines its own PersistentPreRunE or PreRunE, this
// function will not run for that subcommand. Future subcommands that define
- // their own must call osidir.EnsurePluginDir() explicitly.
+ // their own must call ossiedir.EnsurePluginDir() explicitly.
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
- return osidir.EnsurePluginDir()
+ return ossiedir.EnsurePluginDir()
},
}
diff --git a/cli/internal/osidir/osidir.go b/cli/internal/ossiedir/osidir.go
similarity index 98%
rename from cli/internal/osidir/osidir.go
rename to cli/internal/ossiedir/osidir.go
index 27fb742..9396041 100644
--- a/cli/internal/osidir/osidir.go
+++ b/cli/internal/ossiedir/osidir.go
@@ -1,4 +1,4 @@
-package osidir
+package ossiedir
import (
"fmt"
diff --git a/cli/internal/osidir/osidir_test.go b/cli/internal/ossiedir/osidir_test.go
similarity index 98%
rename from cli/internal/osidir/osidir_test.go
rename to cli/internal/ossiedir/osidir_test.go
index 1d39193..0fe341c 100644
--- a/cli/internal/osidir/osidir_test.go
+++ b/cli/internal/ossiedir/osidir_test.go
@@ -1,4 +1,4 @@
-package osidir
+package ossiedir
import (
"os"
(ossie) 03/09: ci(cli): add github actions workflow for build and test
Posted by jb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch pr-4
in repository https://gitbox.apache.org/repos/asf/ossie.git
commit ac660a089fc1550beff308c353c0f4ff767ebbca
Author: Quigley Malcolm <qu...@dbtlabs.com>
AuthorDate: Tue Jun 9 16:40:00 2026 -0500
ci(cli): add github actions workflow for build and test
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.
---
.github/workflows/cli-ci.yml | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/.github/workflows/cli-ci.yml b/.github/workflows/cli-ci.yml
new file mode 100644
index 0000000..e729089
--- /dev/null
+++ b/.github/workflows/cli-ci.yml
@@ -0,0 +1,38 @@
+name: CLI CI
+
+on:
+ push:
+ paths:
+ - 'cli/**'
+ - '.github/workflows/cli-ci.yml'
+ pull_request:
+ paths:
+ - 'cli/**'
+ - '.github/workflows/cli-ci.yml'
+
+jobs:
+ build-and-test:
+ name: Build and test
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ working-directory: cli
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Set up Go
+ uses: actions/setup-go@v5
+ with:
+ go-version-file: cli/go.mod
+ cache-dependency-path: cli/go.sum
+
+ - name: go build
+ run: go build ./...
+
+ - name: go vet
+ run: go vet ./...
+
+ - name: go test
+ run: go test ./...
(ossie) 08/09: chore(cli): fix .gitignore to ignore cli/ossie build artifact
Posted by jb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch pr-4
in repository https://gitbox.apache.org/repos/asf/ossie.git
commit c707545a6c93d432bb2f087fc6b8e92830b0227a
Author: Quigley Malcolm <qu...@dbtlabs.com>
AuthorDate: Tue Jun 23 15:33:28 2026 -0500
chore(cli): fix .gitignore to ignore cli/ossie build artifact
The osi → ossie rename missed the gitignore entry, so the local
build artifact cli/ossie would no longer be ignored by git.
---
.gitignore | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index 8cf6aa8..5f39ab3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,4 +3,4 @@
# Go CLI
cli/dist/
-cli/osi
+cli/ossie
(ossie) 02/09: chore(cli): add makefile and goreleaser build pipeline
Posted by jb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch pr-4
in repository https://gitbox.apache.org/repos/asf/ossie.git
commit fcefdc89f9cde720af3bdfbe48ef4a45b9be1491
Author: Quigley Malcolm <qu...@dbtlabs.com>
AuthorDate: Tue Jun 9 16:33:56 2026 -0500
chore(cli): add makefile and goreleaser build pipeline
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.
---
cli/.goreleaser.yaml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
cli/Makefile | 19 +++++++++++++++++++
2 files changed, 67 insertions(+)
diff --git a/cli/.goreleaser.yaml b/cli/.goreleaser.yaml
new file mode 100644
index 0000000..2351e42
--- /dev/null
+++ b/cli/.goreleaser.yaml
@@ -0,0 +1,48 @@
+version: 2
+
+project_name: osi
+
+before:
+ hooks:
+ - go mod tidy
+
+builds:
+ - id: osi
+ main: .
+ binary: osi
+ goos:
+ - linux
+ - darwin
+ - windows
+ goarch:
+ - amd64
+ - arm64
+ ignore:
+ - goos: windows
+ goarch: arm64
+ env:
+ - CGO_ENABLED=0
+ ldflags:
+ - -s -w
+ - -X main.version={{.Version}}
+ - -X main.commit={{.Commit}}
+ - -X main.date={{.Date}}
+
+archives:
+ - id: osi
+ format: tar.gz
+ format_overrides:
+ - goos: windows
+ format: zip
+ name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
+
+checksum:
+ name_template: "checksums.txt"
+
+changelog:
+ sort: asc
+ filters:
+ exclude:
+ - "^docs:"
+ - "^test:"
+ - "^chore:"
diff --git a/cli/Makefile b/cli/Makefile
new file mode 100644
index 0000000..ed8de03
--- /dev/null
+++ b/cli/Makefile
@@ -0,0 +1,19 @@
+BINARY_NAME := osi
+BUILD_DIR := dist
+
+.PHONY: build test lint release-dry-run clean
+
+build:
+ go build -o $(BUILD_DIR)/$(BINARY_NAME) .
+
+test:
+ go test ./...
+
+lint:
+ go vet ./...
+
+release-dry-run:
+ goreleaser release --snapshot --clean --config .goreleaser.yaml
+
+clean:
+ rm -rf $(BUILD_DIR)
(ossie) 01/09: feat(cli): scaffold go module with cobra command tree
Posted by jb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch pr-4
in repository https://gitbox.apache.org/repos/asf/ossie.git
commit 3c88a83ef999891ec6beede66ca0c2e2b227890a
Author: Quigley Malcolm <qu...@dbtlabs.com>
AuthorDate: Tue Jun 9 16:12:29 2026 -0500
feat(cli): scaffold go module with cobra command tree
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.
---
.gitignore | 4 ++++
cli/.tool-versions | 1 +
cli/cmd/convert.go | 39 +++++++++++++++++++++++++++++++++++++++
cli/cmd/plugin/install.go | 22 ++++++++++++++++++++++
cli/cmd/plugin/list.go | 18 ++++++++++++++++++
cli/cmd/plugin/plugin.go | 16 ++++++++++++++++
cli/cmd/plugin/remove.go | 19 +++++++++++++++++++
cli/cmd/root.go | 38 ++++++++++++++++++++++++++++++++++++++
cli/cmd/validate.go | 24 ++++++++++++++++++++++++
cli/go.mod | 10 ++++++++++
cli/go.sum | 10 ++++++++++
cli/internal/osidir/osidir.go | 40 ++++++++++++++++++++++++++++++++++++++++
cli/main.go | 21 +++++++++++++++++++++
13 files changed, 262 insertions(+)
diff --git a/.gitignore b/.gitignore
index 63e36ff..8cf6aa8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,6 @@
**/__pycache__/
**/.venv/
+
+# Go CLI
+cli/dist/
+cli/osi
diff --git a/cli/.tool-versions b/cli/.tool-versions
new file mode 100644
index 0000000..05a23a6
--- /dev/null
+++ b/cli/.tool-versions
@@ -0,0 +1 @@
+golang 1.26.2
diff --git a/cli/cmd/convert.go b/cli/cmd/convert.go
new file mode 100644
index 0000000..aa8797d
--- /dev/null
+++ b/cli/cmd/convert.go
@@ -0,0 +1,39 @@
+package cmd
+
+import (
+ "fmt"
+
+ "github.com/spf13/cobra"
+)
+
+var convertCmd = &cobra.Command{
+ Use: "convert --from <platform> --input <path> | --to <platform> --input <path>",
+ Short: "Convert a semantic model between OSI and a platform format",
+ RunE: runConvert,
+}
+
+func init() {
+ convertCmd.Flags().String("from", "", "Source platform — converts platform → OSI")
+ convertCmd.Flags().String("to", "", "Target platform — converts OSI → platform")
+ convertCmd.Flags().StringP("input", "i", "", "Input file or directory path (required)")
+ convertCmd.Flags().StringP("output", "o", "", "Output directory path (default: ./osi-output/<plugin>/<direction>)")
+ convertCmd.Flags().String("plugin", "", "Path to plugin directory (bypasses name-based discovery)")
+ convertCmd.Flags().Int("timeout", 60, "Plugin invocation timeout in seconds")
+ convertCmd.Flags().String("max-input-size", "100MB", "Maximum total input size (e.g. 500MB)")
+
+ _ = convertCmd.MarkFlagRequired("input")
+ convertCmd.MarkFlagsMutuallyExclusive("from", "to")
+}
+
+func runConvert(cmd *cobra.Command, args []string) error {
+ from, _ := cmd.Flags().GetString("from")
+ to, _ := cmd.Flags().GetString("to")
+
+ // MarkFlagsMutuallyExclusive handles the both-set case; handle neither here.
+ if from == "" && to == "" {
+ return fmt.Errorf("exactly one of --from or --to must be specified")
+ }
+
+ fmt.Fprintln(cmd.OutOrStdout(), "not yet implemented")
+ return nil
+}
diff --git a/cli/cmd/plugin/install.go b/cli/cmd/plugin/install.go
new file mode 100644
index 0000000..aabde2d
--- /dev/null
+++ b/cli/cmd/plugin/install.go
@@ -0,0 +1,22 @@
+package plugin
+
+import (
+ "fmt"
+
+ "github.com/spf13/cobra"
+)
+
+var installCmd = &cobra.Command{
+ Use: "install [name[@version] | url]",
+ Short: "Install a plugin from the registry or a URL",
+ RunE: runPluginInstall,
+}
+
+func init() {
+ installCmd.Flags().Bool("all", false, "Install the latest version of all registry plugins")
+}
+
+func runPluginInstall(cmd *cobra.Command, args []string) error {
+ fmt.Fprintln(cmd.OutOrStdout(), "not yet implemented")
+ return nil
+}
diff --git a/cli/cmd/plugin/list.go b/cli/cmd/plugin/list.go
new file mode 100644
index 0000000..f69e8bb
--- /dev/null
+++ b/cli/cmd/plugin/list.go
@@ -0,0 +1,18 @@
+package plugin
+
+import (
+ "fmt"
+
+ "github.com/spf13/cobra"
+)
+
+var listCmd = &cobra.Command{
+ Use: "list",
+ Short: "List installed and available plugins",
+ RunE: runPluginList,
+}
+
+func runPluginList(cmd *cobra.Command, args []string) error {
+ fmt.Fprintln(cmd.OutOrStdout(), "not yet implemented")
+ return nil
+}
diff --git a/cli/cmd/plugin/plugin.go b/cli/cmd/plugin/plugin.go
new file mode 100644
index 0000000..a57e103
--- /dev/null
+++ b/cli/cmd/plugin/plugin.go
@@ -0,0 +1,16 @@
+package plugin
+
+import "github.com/spf13/cobra"
+
+// Cmd is the parent "osi plugin" command. It is exported so cmd/root.go can
+// register it. Invoking it bare prints help.
+var Cmd = &cobra.Command{
+ Use: "plugin",
+ Short: "Manage OSI plugins",
+}
+
+func init() {
+ Cmd.AddCommand(listCmd)
+ Cmd.AddCommand(installCmd)
+ Cmd.AddCommand(removeCmd)
+}
diff --git a/cli/cmd/plugin/remove.go b/cli/cmd/plugin/remove.go
new file mode 100644
index 0000000..1b88669
--- /dev/null
+++ b/cli/cmd/plugin/remove.go
@@ -0,0 +1,19 @@
+package plugin
+
+import (
+ "fmt"
+
+ "github.com/spf13/cobra"
+)
+
+var removeCmd = &cobra.Command{
+ Use: "remove <name>",
+ Short: "Remove an installed plugin",
+ Args: cobra.ExactArgs(1),
+ RunE: runPluginRemove,
+}
+
+func runPluginRemove(cmd *cobra.Command, args []string) error {
+ fmt.Fprintln(cmd.OutOrStdout(), "not yet implemented")
+ return nil
+}
diff --git a/cli/cmd/root.go b/cli/cmd/root.go
new file mode 100644
index 0000000..40d1fbc
--- /dev/null
+++ b/cli/cmd/root.go
@@ -0,0 +1,38 @@
+package cmd
+
+import (
+ "github.com/open-semantic-interchange/osi/cli/cmd/plugin"
+ "github.com/open-semantic-interchange/osi/cli/internal/osidir"
+ "github.com/spf13/cobra"
+)
+
+var rootCmd = &cobra.Command{
+ Use: "osi",
+ Short: "Open Semantic Interchange CLI",
+ Long: `osi is the command-line tool for the Open Semantic Interchange (OSI) project.`,
+ // NOTE: Cobra does NOT automatically chain PersistentPreRunE from parent to
+ // child. If any subcommand defines its own PersistentPreRunE or PreRunE, this
+ // function will not run for that subcommand. Future subcommands that define
+ // their own must call osidir.EnsurePluginDir() explicitly.
+ PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
+ return osidir.EnsurePluginDir()
+ },
+}
+
+// Execute runs the root command. Called by main.
+func Execute() error {
+ return rootCmd.Execute()
+}
+
+// SetVersion sets the version string reported by `osi --version`.
+func SetVersion(v string) {
+ rootCmd.Version = v
+}
+
+func init() {
+ rootCmd.PersistentFlags().BoolP("verbose", "v", false, "Enable verbose output (shows plugin stderr)")
+
+ rootCmd.AddCommand(convertCmd)
+ rootCmd.AddCommand(validateCmd)
+ rootCmd.AddCommand(plugin.Cmd)
+}
diff --git a/cli/cmd/validate.go b/cli/cmd/validate.go
new file mode 100644
index 0000000..5ef9edc
--- /dev/null
+++ b/cli/cmd/validate.go
@@ -0,0 +1,24 @@
+package cmd
+
+import (
+ "fmt"
+
+ "github.com/spf13/cobra"
+)
+
+var validateCmd = &cobra.Command{
+ Use: "validate [flags] <path> [<path>...]",
+ Short: "Validate one or more OSI YAML or JSON files",
+ Args: cobra.MinimumNArgs(1),
+ RunE: runValidate,
+}
+
+func init() {
+ validateCmd.Flags().Bool("strict", false, "Promote warnings to errors")
+ validateCmd.Flags().String("output", "text", "Output format: text or json")
+}
+
+func runValidate(cmd *cobra.Command, args []string) error {
+ fmt.Fprintln(cmd.OutOrStdout(), "not yet implemented")
+ return nil
+}
diff --git a/cli/go.mod b/cli/go.mod
new file mode 100644
index 0000000..eabd4e0
--- /dev/null
+++ b/cli/go.mod
@@ -0,0 +1,10 @@
+module github.com/open-semantic-interchange/osi/cli
+
+go 1.22
+
+require github.com/spf13/cobra v1.10.2
+
+require (
+ github.com/inconshreveable/mousetrap v1.1.0 // indirect
+ github.com/spf13/pflag v1.0.9 // indirect
+)
diff --git a/cli/go.sum b/cli/go.sum
new file mode 100644
index 0000000..a6ee3e0
--- /dev/null
+++ b/cli/go.sum
@@ -0,0 +1,10 @@
+github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
+github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
+github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
+github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
+github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU=
+github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4=
+github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY=
+github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
+go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
diff --git a/cli/internal/osidir/osidir.go b/cli/internal/osidir/osidir.go
new file mode 100644
index 0000000..cdb3f6b
--- /dev/null
+++ b/cli/internal/osidir/osidir.go
@@ -0,0 +1,40 @@
+package osidir
+
+import (
+ "fmt"
+ "os"
+ "path/filepath"
+)
+
+const (
+ defaultOSIDir = ".osi"
+ pluginsSubdir = "plugins"
+ envVar = "OSI_PLUGIN_DIR"
+)
+
+// PluginDir returns the resolved plugin directory path.
+// It respects $OSI_PLUGIN_DIR if set, otherwise defaults to ~/.osi/plugins/.
+func PluginDir() (string, error) {
+ if override := os.Getenv(envVar); override != "" {
+ return override, nil
+ }
+ // Use os.UserHomeDir rather than $HOME for Windows portability.
+ home, err := os.UserHomeDir()
+ if err != nil {
+ return "", fmt.Errorf("could not determine home directory: %w", err)
+ }
+ return filepath.Join(home, defaultOSIDir, pluginsSubdir), nil
+}
+
+// EnsurePluginDir ensures the plugin directory exists, creating it if needed.
+// It is safe to call multiple times — os.MkdirAll is idempotent.
+func EnsurePluginDir() error {
+ dir, err := PluginDir()
+ if err != nil {
+ return err
+ }
+ if err := os.MkdirAll(dir, 0755); err != nil {
+ return fmt.Errorf("could not create plugin directory %s: %w", dir, err)
+ }
+ return nil
+}
diff --git a/cli/main.go b/cli/main.go
new file mode 100644
index 0000000..9262cb5
--- /dev/null
+++ b/cli/main.go
@@ -0,0 +1,21 @@
+package main
+
+import (
+ "os"
+
+ "github.com/open-semantic-interchange/osi/cli/cmd"
+)
+
+// version, commit, and date are set at build time by GoReleaser via ldflags.
+var (
+ version = "dev"
+ commit = "none"
+ date = "unknown"
+)
+
+func main() {
+ cmd.SetVersion(version)
+ if err := cmd.Execute(); err != nil {
+ os.Exit(1)
+ }
+}
(ossie) 04/09: test(cli): add unit tests for internal/osidir
Posted by jb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch pr-4
in repository https://gitbox.apache.org/repos/asf/ossie.git
commit 5f269d2c28390085a49b8affcf593051bbca5b86
Author: Quigley Malcolm <qu...@dbtlabs.com>
AuthorDate: Tue Jun 9 17:47:45 2026 -0500
test(cli): add unit tests for internal/osidir
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.
---
cli/internal/osidir/osidir_test.go | 65 ++++++++++++++++++++++++++++++++++++++
1 file changed, 65 insertions(+)
diff --git a/cli/internal/osidir/osidir_test.go b/cli/internal/osidir/osidir_test.go
new file mode 100644
index 0000000..1d39193
--- /dev/null
+++ b/cli/internal/osidir/osidir_test.go
@@ -0,0 +1,65 @@
+package osidir
+
+import (
+ "os"
+ "path/filepath"
+ "testing"
+)
+
+func TestPluginDir_envOverride(t *testing.T) {
+ want := "/custom/plugin/dir"
+ t.Setenv(envVar, want)
+
+ got, err := PluginDir()
+ if err != nil {
+ t.Fatalf("unexpected error: %v", err)
+ }
+ if got != want {
+ t.Errorf("got %q, want %q", got, want)
+ }
+}
+
+func TestPluginDir_default(t *testing.T) {
+ t.Setenv(envVar, "")
+
+ home, err := os.UserHomeDir()
+ if err != nil {
+ t.Fatalf("could not determine home dir: %v", err)
+ }
+ want := filepath.Join(home, defaultOSIDir, pluginsSubdir)
+
+ got, err := PluginDir()
+ if err != nil {
+ t.Fatalf("unexpected error: %v", err)
+ }
+ if got != want {
+ t.Errorf("got %q, want %q", got, want)
+ }
+}
+
+func TestEnsurePluginDir_createsDirectory(t *testing.T) {
+ tmp := t.TempDir()
+ target := filepath.Join(tmp, "plugins")
+ t.Setenv(envVar, target)
+
+ if err := EnsurePluginDir(); err != nil {
+ t.Fatalf("unexpected error: %v", err)
+ }
+
+ if _, err := os.Stat(target); os.IsNotExist(err) {
+ t.Errorf("expected directory %q to exist, but it does not", target)
+ }
+}
+
+func TestEnsurePluginDir_idempotent(t *testing.T) {
+ tmp := t.TempDir()
+ target := filepath.Join(tmp, "plugins")
+ t.Setenv(envVar, target)
+
+ if err := EnsurePluginDir(); err != nil {
+ t.Fatalf("first call failed: %v", err)
+ }
+ if err := EnsurePluginDir(); err != nil {
+ t.Fatalf("second call failed: %v", err)
+ }
+}
(ossie) 05/09: chore(cli): rename osi to ossie throughout cli scaffold
Posted by jb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch pr-4
in repository https://gitbox.apache.org/repos/asf/ossie.git
commit 780dcdb43703b503ef94c6b16b108b8d10b98b96
Author: Quigley Malcolm <qu...@dbtlabs.com>
AuthorDate: Wed Jun 10 15:45:12 2026 -0500
chore(cli): rename osi to ossie throughout cli scaffold
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
---
cli/.goreleaser.yaml | 8 ++++----
cli/Makefile | 2 +-
cli/cmd/convert.go | 8 ++++----
cli/cmd/plugin/plugin.go | 4 ++--
cli/cmd/root.go | 10 +++++-----
cli/cmd/validate.go | 2 +-
cli/go.mod | 2 +-
cli/internal/osidir/osidir.go | 6 +++---
cli/main.go | 2 +-
9 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/cli/.goreleaser.yaml b/cli/.goreleaser.yaml
index 2351e42..3a0a17b 100644
--- a/cli/.goreleaser.yaml
+++ b/cli/.goreleaser.yaml
@@ -1,15 +1,15 @@
version: 2
-project_name: osi
+project_name: ossie
before:
hooks:
- go mod tidy
builds:
- - id: osi
+ - id: ossie
main: .
- binary: osi
+ binary: ossie
goos:
- linux
- darwin
@@ -29,7 +29,7 @@ builds:
- -X main.date={{.Date}}
archives:
- - id: osi
+ - id: ossie
format: tar.gz
format_overrides:
- goos: windows
diff --git a/cli/Makefile b/cli/Makefile
index ed8de03..9ecbcb7 100644
--- a/cli/Makefile
+++ b/cli/Makefile
@@ -1,4 +1,4 @@
-BINARY_NAME := osi
+BINARY_NAME := ossie
BUILD_DIR := dist
.PHONY: build test lint release-dry-run clean
diff --git a/cli/cmd/convert.go b/cli/cmd/convert.go
index aa8797d..92722ee 100644
--- a/cli/cmd/convert.go
+++ b/cli/cmd/convert.go
@@ -8,15 +8,15 @@ import (
var convertCmd = &cobra.Command{
Use: "convert --from <platform> --input <path> | --to <platform> --input <path>",
- Short: "Convert a semantic model between OSI and a platform format",
+ Short: "Convert a semantic model between OSSIE and a platform format",
RunE: runConvert,
}
func init() {
- convertCmd.Flags().String("from", "", "Source platform — converts platform → OSI")
- convertCmd.Flags().String("to", "", "Target platform — converts OSI → platform")
+ convertCmd.Flags().String("from", "", "Source platform — converts platform → OSSIE")
+ convertCmd.Flags().String("to", "", "Target platform — converts OSSIE → platform")
convertCmd.Flags().StringP("input", "i", "", "Input file or directory path (required)")
- convertCmd.Flags().StringP("output", "o", "", "Output directory path (default: ./osi-output/<plugin>/<direction>)")
+ convertCmd.Flags().StringP("output", "o", "", "Output directory path (default: ./ossie-output/<plugin>/<direction>)")
convertCmd.Flags().String("plugin", "", "Path to plugin directory (bypasses name-based discovery)")
convertCmd.Flags().Int("timeout", 60, "Plugin invocation timeout in seconds")
convertCmd.Flags().String("max-input-size", "100MB", "Maximum total input size (e.g. 500MB)")
diff --git a/cli/cmd/plugin/plugin.go b/cli/cmd/plugin/plugin.go
index a57e103..d996f13 100644
--- a/cli/cmd/plugin/plugin.go
+++ b/cli/cmd/plugin/plugin.go
@@ -2,11 +2,11 @@ package plugin
import "github.com/spf13/cobra"
-// Cmd is the parent "osi plugin" command. It is exported so cmd/root.go can
+// Cmd is the parent "ossie plugin" command. It is exported so cmd/root.go can
// register it. Invoking it bare prints help.
var Cmd = &cobra.Command{
Use: "plugin",
- Short: "Manage OSI plugins",
+ Short: "Manage OSSIE plugins",
}
func init() {
diff --git a/cli/cmd/root.go b/cli/cmd/root.go
index 40d1fbc..45347bc 100644
--- a/cli/cmd/root.go
+++ b/cli/cmd/root.go
@@ -1,15 +1,15 @@
package cmd
import (
- "github.com/open-semantic-interchange/osi/cli/cmd/plugin"
- "github.com/open-semantic-interchange/osi/cli/internal/osidir"
+ "github.com/open-semantic-interchange/ossie/cli/cmd/plugin"
+ "github.com/open-semantic-interchange/ossie/cli/internal/osidir"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
- Use: "osi",
+ Use: "ossie",
Short: "Open Semantic Interchange CLI",
- Long: `osi is the command-line tool for the Open Semantic Interchange (OSI) project.`,
+ Long: `ossie is the command-line tool for the Open Semantic Interchange (OSSIE) project.`,
// NOTE: Cobra does NOT automatically chain PersistentPreRunE from parent to
// child. If any subcommand defines its own PersistentPreRunE or PreRunE, this
// function will not run for that subcommand. Future subcommands that define
@@ -24,7 +24,7 @@ func Execute() error {
return rootCmd.Execute()
}
-// SetVersion sets the version string reported by `osi --version`.
+// SetVersion sets the version string reported by `ossie --version`.
func SetVersion(v string) {
rootCmd.Version = v
}
diff --git a/cli/cmd/validate.go b/cli/cmd/validate.go
index 5ef9edc..b11d00a 100644
--- a/cli/cmd/validate.go
+++ b/cli/cmd/validate.go
@@ -8,7 +8,7 @@ import (
var validateCmd = &cobra.Command{
Use: "validate [flags] <path> [<path>...]",
- Short: "Validate one or more OSI YAML or JSON files",
+ Short: "Validate one or more OSSIE YAML or JSON files",
Args: cobra.MinimumNArgs(1),
RunE: runValidate,
}
diff --git a/cli/go.mod b/cli/go.mod
index eabd4e0..a828425 100644
--- a/cli/go.mod
+++ b/cli/go.mod
@@ -1,4 +1,4 @@
-module github.com/open-semantic-interchange/osi/cli
+module github.com/open-semantic-interchange/ossie/cli
go 1.22
diff --git a/cli/internal/osidir/osidir.go b/cli/internal/osidir/osidir.go
index cdb3f6b..27fb742 100644
--- a/cli/internal/osidir/osidir.go
+++ b/cli/internal/osidir/osidir.go
@@ -7,13 +7,13 @@ import (
)
const (
- defaultOSIDir = ".osi"
+ defaultOSIDir = ".ossie"
pluginsSubdir = "plugins"
- envVar = "OSI_PLUGIN_DIR"
+ envVar = "OSSIE_PLUGIN_DIR"
)
// PluginDir returns the resolved plugin directory path.
-// It respects $OSI_PLUGIN_DIR if set, otherwise defaults to ~/.osi/plugins/.
+// It respects $OSSIE_PLUGIN_DIR if set, otherwise defaults to ~/.ossie/plugins/.
func PluginDir() (string, error) {
if override := os.Getenv(envVar); override != "" {
return override, nil
diff --git a/cli/main.go b/cli/main.go
index 9262cb5..9d2a202 100644
--- a/cli/main.go
+++ b/cli/main.go
@@ -3,7 +3,7 @@ package main
import (
"os"
- "github.com/open-semantic-interchange/osi/cli/cmd"
+ "github.com/open-semantic-interchange/ossie/cli/cmd"
)
// version, commit, and date are set at build time by GoReleaser via ldflags.
(ossie) 07/09: fix(ossiedir): rename defaultOSIDir constant to defaultOssieDir
Posted by jb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jbonofre pushed a commit to branch pr-4
in repository https://gitbox.apache.org/repos/asf/ossie.git
commit 32955eb43e302fc25c2c46f486d8762d21ceeaf8
Author: Quigley Malcolm <qu...@dbtlabs.com>
AuthorDate: Tue Jun 23 15:32:53 2026 -0500
fix(ossiedir): rename defaultOSIDir constant to defaultOssieDir
The osi → ossie rename missed this unexported constant. The value
(.ossie) was already correct; only the identifier name was stale.
---
cli/internal/ossiedir/osidir.go | 4 ++--
cli/internal/ossiedir/osidir_test.go | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/cli/internal/ossiedir/osidir.go b/cli/internal/ossiedir/osidir.go
index 9396041..051a8bd 100644
--- a/cli/internal/ossiedir/osidir.go
+++ b/cli/internal/ossiedir/osidir.go
@@ -7,7 +7,7 @@ import (
)
const (
- defaultOSIDir = ".ossie"
+ defaultOssieDir = ".ossie"
pluginsSubdir = "plugins"
envVar = "OSSIE_PLUGIN_DIR"
)
@@ -23,7 +23,7 @@ func PluginDir() (string, error) {
if err != nil {
return "", fmt.Errorf("could not determine home directory: %w", err)
}
- return filepath.Join(home, defaultOSIDir, pluginsSubdir), nil
+ return filepath.Join(home, defaultOssieDir, pluginsSubdir), nil
}
// EnsurePluginDir ensures the plugin directory exists, creating it if needed.
diff --git a/cli/internal/ossiedir/osidir_test.go b/cli/internal/ossiedir/osidir_test.go
index 0fe341c..76a8981 100644
--- a/cli/internal/ossiedir/osidir_test.go
+++ b/cli/internal/ossiedir/osidir_test.go
@@ -26,7 +26,7 @@ func TestPluginDir_default(t *testing.T) {
if err != nil {
t.Fatalf("could not determine home dir: %v", err)
}
- want := filepath.Join(home, defaultOSIDir, pluginsSubdir)
+ want := filepath.Join(home, defaultOssieDir, pluginsSubdir)
got, err := PluginDir()
if err != nil {