Merged
Conversation
Add a prefix and separator to all console log messages so Cog's output is visually distinguishable from Docker build output and model output: - Info/Debug: dim ⚙ › prefix - Warn: bold yellow ⚠ › prefix - Error/Fatal: bold red ⅹ › prefix Blank lines at info/debug level print without prefix for clean spacing. Warn/error blank lines keep their prefix to maintain visual continuity in multi-line error messages. Output() (stdout, for model predictions) remains unstyled.
Add a Bold() helper to the console package that applies bold formatting when color is enabled. Use it to highlight key dynamic values (image names, paths, URLs, hostnames) in user-facing messages so they stand out within the dim-prefixed lines. Also remove single quotes around values where bold makes them visually distinct without needing quoting.
Move 'Generating model schema...', 'Using local coglet wheel...', and 'Using local cog wheel...' from info to debug level. These are implementation details that clutter normal output but remain visible with --debug.
Add blank lines after 'Building Docker image...' (before Docker build output) and after 'Running prediction/training...' (before model output) to visually separate Cog's framework messages from external output.
Introduce a Style type that controls the icon/color of a log line independently from the log level. This allows Success to display at info level (same filtering) but with a green ✓ prefix. New styles can be added by extending the Style enum without touching the level hierarchy. Apply Success to: image built, cog init completion, login success, and image pushed messages. Drop the ✅ emoji from init since the green ✓ prefix replaces it.
…ines When stderr is a TTY, wrap console messages to the terminal width so they don't overflow. Each continuation line gets the same prefix as the first line for visual continuity. Wrapping is ANSI-aware: escape codes are treated as zero-width so colored/bold text doesn't cause premature breaks. Lines break on word boundaries where possible, with hard breaks as a fallback.
Add InfoUnformatted/InfoUnformattedf methods that write to stderr at info level without any icon prefix. These are used for conversational and interactive output (login prompts, instructions) where the gear prefix would be visual noise. Long lines are wrapped to terminal width when stderr is a TTY, same as prefixed output. Apply to login flows in both Replicate and generic providers: replace console.Info with console.InfoUnformatted for all user-facing prompts and instructions. Rename 'CLI auth token:' prompt to 'Token:' and improve spacing around the prompt.
- 'Failed to predict' → 'Failed to run prediction' in predict.go - 'The inputs you passed to cog predict' → 'The inputs you passed' in predictor.go (shorter, less redundant since the user knows they ran cog) - Add blank line after 'Running...' message in run.go for visual separation from Docker output
- Remove leading \n from 'Setting up...' message (prefix handles
spacing), use separate console.Info('') for the blank line after
- Show 'Creating {filename}' (info, before write) instead of
'Created {fullpath}' (success, after write) — less noisy, uses
just the filename since the user knows their working directory
The 'Building Docker image...' message and surrounding blank lines are user-facing concerns that belong in the CLI commands, not deep in pkg/image/build.go. This lets each command control what it shows: - cog build / cog push: show image name (user-chosen, meaningful) - cog predict / cog train / cog run / cog serve: hide image name (ephemeral internal detail the user can't use) Each CLI command now prints the message + blank line before calling resolver.Build(), and the pre-ImageBuild blank lines are removed from image/build.go.
2691bc5 to
34ce886
Compare
Contributor
|
This looks great! You'll need to massage the ITs but as soon as it passes CI we should be good to land it. |
- build_cog_init: match 'Image built as' without 'cog-' prefix since the success prefix (✔) is now part of the line - wheel_resolution: use --debug flag since wheel resolution messages were demoted to debug level
tempusfrangit
approved these changes
Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Overhaul Cog's CLI output styling so framework messages are visually distinct from Docker build output and model prediction output.
Before:
After:
What changed
⚙(info/debug),⚠(warn),✗(error/fatal),✔(success). Model output stays unstyled and flush-left.console.Bold()to stand out without needing quotes.console.Success()— New method with green✔prefix, displayed at info level via aStyleenum system.console.InfoUnformatted()— New method for prefix-free stderr output, used for interactive/conversational flows like login prompts.cog build/cog pushshow it;cog predict/cog train/cog run/cog servehide it since it's an internal detail).cog initshows "Creating {filename}" before write instead of "Created {fullpath}" after.InfoUnformatted, prompt renamed to "Token:", improved spacing.Files changed
pkg/util/console/— Core styling, wrapping, Bold, Success, InfoUnformatted, Style enumpkg/cli/— All commands updated with spacing, bold values, moved build messagepkg/image/build.go— Removed build message (moved to CLI), demoted debug messagespkg/predict/predictor.go— Shorter error wordingpkg/provider/— Login flows use InfoUnformattedpkg/dockerfile/standard_generator.go— Demoted wheel messages to debug