Skip to content

Expose core Kit CLI functionality as a reusable Go library #905

@gorkem

Description

@gorkem

Describe the problem you're trying to solve
All Kit CLI commands currently live under cmd/*, with business logic and flag parsing tightly coupled to Cobra. This makes it difficult for other Go programs to import and invoke Kit functionality without shelling out.

Describe the solution you'd like

  1. Create a new package pkg/kit exposing public APIs like:
    func List(ctx context.Context, opts ListOptions) ([]ModelInfo, error)
    func Push(ctx context.Context, opts PushOptions) error
    // …etc…
  2. Refactor each command to delegate to these package functions
  3. Move data types, validation routines, output-format helpers, and error definitions into pkg/kit.
  4. Update tests to separate unit tests against pkg/kit APIs in and retain or convert integration tests under cmd/ to ensure the CLI remains unchanged.
  5. Add documentation with examples for library usage

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions