Skip to content

test 2 #2

Description

@protpaw

Canonical CLI automated review report

This report is AI-generated. Please report issues with the cli-skill so we can improve this report.

Scope: CLI standard compliance review of cmd/cli/

Workflow: CLI skill version (mock local run)

Reference: Canonical CLI standards

Limitations: Detection of clear CLI standards violations. Does not guarantee full compliance with CLI standards


Findings

Severity Rule Summary Evidence How to fix
HIGH-1 Commands are verbs — every command acting on a primary object must be a verb webui is a noun, not a verb. Source: cmd/cli/commands/webui.go line 20: Use: "webui" Rename to a verb form such as launch-webui or open-webui
HIGH-2 Do not offer both short and long flags for the same action --verbose / -v dual flag pattern. Source: cmd/cli/main.go line 66: BoolVarP(&ctx.Verbose, "verbose", "v", false, ...) Choose either --verbose (preferred for infrequent use) or -v. Remove the other.
UNRATED-1 Table column headers should use uppercase and bold font (SHOULD) list-engines table headers are lowercase: "engine", "vendor", "summary", "compat". Source: cmd/cli/commands/list-engines.go line 104 Uppercase headers: ENGINE, VENDOR, SUMMARY, COMPAT
UNRATED-2 Tables should allow hiding headers with --no-headers (SHOULD) list-engines lacks a --no-headers flag. Source: cmd/cli/commands/list-engines.go Add --no-headers flag to list-engines
UNRATED-3 Table formatting should render proper tables when format is "table" (SHOULD) list-models with --format table prints plain text lines, not a proper table. Source: cmd/cli/commands/list-models.go line 56-58: prints fmt.Println(model) Implement proper table rendering for the table format in list-models

Detailed analysis

[HIGH-1] webui is not a verb

CLI Standard citation: Commands are verbs"Commands are verbs. Every command that acts on a primary object of a command must be a verb."

Evidence:

// cmd/cli/commands/webui.go:20
cobraCmd := &cobra.Command{
    Use:               "webui",
    Short:             "Launch web UI",
    Long:              "Open the snap's builtin web user interface in the default browser",

The command name webui is a noun (acronym for "web user interface"). Per the standard, every command that acts on a primary object must be a verb. This command launches/opens a web UI — the action is launching, not the interface itself.

Remediation: Rename to a verb-noun form. Recommended options:

  • launch-webui — follows verb-noun pattern
  • open-webui — uses a standard verb to match open semantics

[HIGH-2] Dual short and long flags for verbose

CLI Standard citation: Do not offer dual flags"As a policy, do not offer both short and long flags for the same action."

Evidence:

// cmd/cli/main.go:66
rootCmd.PersistentFlags().BoolVarP(&ctx.Verbose, "verbose", "v", false, "Enable verbose logging")

The BoolVarP function creates both --verbose (long) and -v (short) for the same flag. The CLI standard explicitly forbids this pattern. Since this is a persistent global flag used infrequently, the long form --verbose is more appropriate.

Remediation: Change BoolVarP to BoolVar to remove the short -v flag:

rootCmd.PersistentFlags().BoolVar(&ctx.Verbose, "verbose", false, "Enable verbose logging")

[UNRATED-1] Table headers are lowercase instead of uppercase

CLI Standard citation: Table format"Column headers should use upper case (e.g. NAME, STATUS, etc) and bold font." (SHOULD rule)

Evidence:

// cmd/cli/commands/list-engines.go:104
var headerRow = []string{"engine", "vendor", "summary", "compat"}

The column headers use lowercase words. The standard recommends uppercase headers with bold font for better readability and consistency.

Remediation: Change headers to uppercase: "ENGINE", "VENDOR", "SUMMARY", "COMPAT".


[UNRATED-2] Missing --no-headers flag on list-engines

CLI Standard citation: Table format"Show column headers by default but allow them to be hidden with --no-headers." (SHOULD rule)

Evidence:

// cmd/cli/commands/list-engines.go — no --no-headers flag defined
cobraCmd.Flags().StringVar(
    &cmd.format,
    "format",
    "table",
    fmt.Sprintf("output format (%s)", strings.Join(supportedFormats, ", ")),
)

The list-engines command renders a table but does not provide a --no-headers flag to allow hiding column headers. This is useful for scripting and automated processing of table output.

Remediation: Add a --no-headers bool flag to list-engines (and any other command rendering tables).


[UNRATED-3] list-models does not render a proper table for --format table

CLI Standard citation: Table format — the standard defines proper table rendering expectations. (SHOULD rule, implied by format expectations)

Evidence:

// cmd/cli/commands/list-models.go:56-58
for _, model := range engineManifest.Model.Options {
    fmt.Println(model)
}

When --format table is specified (the default), the command prints plain text lines instead of a structured table. The code includes a TODO comment acknowledging this gap. This means the table format option is misleading.

Remediation: Implement proper table rendering for list-models using tablewriter (as list-engines does), or remove the table format option until it's implemented.


CLI changes in this PR

No PR context available — this was a mock workflow run triggered manually against cmd/cli/.


Summary

Severity Count Guideline Categories
High 2 Command naming, Flag design
Medium 0
Low 0
Unrated 3 Table formatting
Total 5

Overall score: 85.7%

The scoring algorithm starts with 100%, number of commands N=14, weight W=100/14≈7.14. For each High violation, reduce by 1×W; Medium violation by 0.5×W; Low violation by 0.2×W. Clamp to 0-100.

Score = 100 − (2 × 7.14) = 85.7. Passed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions