diff --git a/cmd/proboctl/main.go b/cmd/proboctl/main.go deleted file mode 100644 index da0797938..000000000 --- a/cmd/proboctl/main.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) 2026 Probo Inc . -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -// PERFORMANCE OF THIS SOFTWARE. - -package main - -import ( - "fmt" - "os" - - "go.probo.inc/probo/pkg/cmd/cmdutil" - "go.probo.inc/probo/pkg/cmd/iostreams" - "go.probo.inc/probo/pkg/proboctl/root" -) - -func main() { - ios := iostreams.System() - ios.ApplyColorProfile() - - f := &cmdutil.Factory{ - IOStreams: ios, - } - - cmd := root.NewCmdRoot(f) - - if err := cmd.Execute(); err != nil { - fmt.Fprintf(os.Stderr, "Error: %s\n", err) - os.Exit(1) - } -} diff --git a/pkg/proboctl/mdtoprosemirror/mdtoprosemirror.go b/pkg/proboctl/mdtoprosemirror/mdtoprosemirror.go deleted file mode 100644 index 297347f23..000000000 --- a/pkg/proboctl/mdtoprosemirror/mdtoprosemirror.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) 2026 Probo Inc . -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -// PERFORMANCE OF THIS SOFTWARE. - -package mdtoprosemirror - -import ( - "encoding/json" - "fmt" - "io" - - "github.com/spf13/cobra" - "go.probo.inc/probo/pkg/cmd/cmdutil" - "go.probo.inc/probo/pkg/prosemirror" -) - -func NewCmdMdToProsemirror(f *cmdutil.Factory) *cobra.Command { - var flagContent string - - cmd := &cobra.Command{ - Use: "md-to-prosemirror", - Short: "Convert markdown to ProseMirror JSON", - Example: ` # Convert from flag - proboctl md-to-prosemirror --content "# Hello" - - # Convert from stdin - echo "# Hello" | proboctl md-to-prosemirror - - # Convert from file - proboctl md-to-prosemirror < document.md`, - RunE: func(cmd *cobra.Command, args []string) error { - var input string - if flagContent != "" { - input = flagContent - } else { - data, err := io.ReadAll(f.IOStreams.In) - if err != nil { - return fmt.Errorf("cannot read from stdin: %w", err) - } - input = string(data) - } - - doc, err := prosemirror.ParseMarkdown(input) - if err != nil { - return err - } - - out, err := json.Marshal(doc) - if err != nil { - return fmt.Errorf("cannot marshal prosemirror document: %w", err) - } - - fmt.Fprintln(f.IOStreams.Out, string(out)) - - return nil - }, - } - - cmd.Flags().StringVar( - &flagContent, - "content", - "", - "Markdown content to convert (reads from stdin if not provided)", - ) - - return cmd -} diff --git a/pkg/proboctl/root/root.go b/pkg/proboctl/root/root.go deleted file mode 100644 index 2e049fa0c..000000000 --- a/pkg/proboctl/root/root.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) 2026 Probo Inc . -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -// PERFORMANCE OF THIS SOFTWARE. - -package root - -import ( - "github.com/spf13/cobra" - "go.probo.inc/probo/pkg/cmd/cmdutil" - "go.probo.inc/probo/pkg/proboctl/mdtoprosemirror" -) - -func NewCmdRoot(f *cmdutil.Factory) *cobra.Command { - cmd := &cobra.Command{ - Use: "proboctl [flags]", - Short: "Probo admin CLI", - Long: "proboctl is a command-line tool for Probo administrative operations.", - SilenceUsage: true, - SilenceErrors: true, - } - - cmd.AddCommand(mdtoprosemirror.NewCmdMdToProsemirror(f)) - - return cmd -}