Repository navigation
Open
Labels
Description
Parent Epic: #1841
Overview
Consolidate CLI and Desktop flags onto a single, non-overlapping flag per concern across STDOUT (data results + live progress) and STDERR (diagnostic logs), removing redundant/conflicting flags (-v/-vv/-vvv, --debug, -q/--quiet, --log-output, and per-command --json).
Target Flag & Stream Contract
| Concern | Stream | Canonical Flag | Environment Variable (BindEnv) |
Allowed Values | Default |
|---|---|---|---|---|---|
| Log Verbosity | STDERR |
--log-level |
DEVSY_LOG_LEVEL (fallback: context LOG_LEVEL) |
error, warn, info, debug, trace |
warn (CLI) / info (remote agent) |
| Log Encoding | STDERR |
--log-format |
DEVSY_LOG_FORMAT |
auto, text, json, logfmt (alias: plain -> text) |
auto (text on TTY, json when piped / DEVSY_UI=true / internal) |
| Result Format | STDOUT |
--result-format |
DEVSY_RESULT_FORMAT |
auto, text, plain, json |
auto (plain/text on TTY, json when piped / DEVSY_UI=true) |
| Live Progress | STDOUT |
--no-status |
DEVSY_NO_STATUS |
true, false |
false |
Subtasks & Engineering Specifications
-
Task 0.1: Consolidate Global Logging Flags (
--log-level,--log-format) & Remove-v,--debug,-q,--log-output(size/m)- Target Files:
cmd/flags/flags.gocmd/root.go,cmd/root_test.go,cmd/flag_aliases_test.gopkg/flags/names/names.go,pkg/flags/names/names_test.go,pkg/flags/env_test.gopkg/config/env.gopkg/log/logger.go,pkg/log/levels.go,pkg/log/logger_test.go
- Implementation Details:
- In
cmd/flags/flags.go:- Remove
Verbosity,Quiet,Debug, andLogOutputfromGlobalFlags. - Keep
LogLevel string,LogFormat string(default"auto"),ResultFormat string(default"auto"), andNoStatus bool. - Update
bindGlobalEnvVars(pkgflags.BindEnv) to bindDEVSY_HOME,DEVSY_CONTEXT,DEVSY_PROVIDER,DEVSY_LOG_LEVEL,DEVSY_LOG_FORMAT,DEVSY_RESULT_FORMAT, andDEVSY_NO_STATUS.
- Remove
- In
cmd/root.go:- Validate
--log-formatagainstauto | text | plain | json | logfmt. - Resolve
"auto"to"json"whenisMachineConsumer(isInternal,DEVSY_UI=true, or non-TTYos.Stderr), otherwise"text". This fixes the bug whererootPreRunoverwrote"json"with"text"when--log-outputdefaulted to"text".
- Validate
- In
pkg/log/logger.goandpkg/log/levels.go:- Add
log.InitProvider(providerName string)that readsDEVSY_LOG_LEVEL(default"info") andDEVSY_LOG_FORMAT(default"json"). - Keep
VerbosityandDebugas// Deprecated:compatibility fields onlog.Config(and havelog.Init(cfg)automatically fall back toos.Getenv("DEVSY_LOG_LEVEL")andos.Getenv("DEVSY_LOG_FORMAT")whencfg.Level == ""/cfg.Format == "") so that bumpinggithub.com/devsy-org/devsyin the 12 external Go provider repositories (aws,gcloud,azure,digitalocean,civo,terraform,lima,orbstack,kubernetes,ecs,dockerless,ssh) never breaks compilation before theircmd/root.gois updated. - Add
log.InfoEnabled() boolalongsidelog.DebugEnabled() boolandlog.TraceEnabled() bool. - Replace
cmd.Verbosity > 0 || cmd.Debugincmd/workspace/up/up.goandcmd/workspace/stop.gowithlog.InfoEnabled().
- Add
- In
- Target Files:
-
Task 0.2: Update All Internal Child Subprocess & Desktop CLI Invocations to
--log-leveland--log-format(size/m)- Target Files:
cmd/workspace/up/agent.go,cmd/workspace/logs.go,cmd/workspace/ssh.go,cmd/workspace/gpg_tunnel.go,cmd/machine/ssh.gopkg/agent/agent.go,pkg/client/clientimplementation/workspace_client.go,pkg/devcontainer/setup.gopkg/dotfiles/dotfiles.go,pkg/gpg/forward.go,pkg/tunnel/browser.go,pkg/tunnel/container.go,pkg/ide/opener/browser_tunnel.godesktop/src/main/cli.ts,desktop/src/main/__tests__/cli.test.ts,desktop/e2e/no-status-protocol.e2e.ts
- Implementation Details:
- Add
log.ForwardFlagArgs() []stringreturning[]string{"--log-level", log.LevelString()}when non-default, and replace all--debugchild-process flag forwarding acrosscmd/andpkg/. - Remove invalid
--log-output=rawarguments frompkg/dotfiles/dotfiles.go,pkg/gpg/forward.go, andpkg/tunnel/browser.go. - Update
desktop/src/main/cli.ts(argsWithProtocolandcommandNeedsSecret) and Desktop tests to pass--log-formatinstead of--log-output.
- Add
- Target Files:
-
Task 0.3: Standardize All Subcommand
STDOUTOutput on--result-format& Unifytext/plainValue Names (size/s)- Target Files:
pkg/output/mode.go,pkg/output/mode_test.gopkg/status/render.go,pkg/status/render_test.gocmd/provider/versions.go,cmd/provider/versions_test.gocmd/feature/outdated.go,cmd/feature/outdated_test.gocmd/machine/describe.go,cmd/machine/inspect.gocmd/ci/status.go
- Implementation Details:
- In
pkg/output/mode.goandpkg/status/render.go, accept"text"alongside"plain"(mapping both to human-readable output), and inpkg/log/logger.goaccept"plain"as an alias for"text", soauto|text|jsonworks identically across both--log-formatand--result-format. - Remove
--json(names.JSON) fromdevsy provider versionsand useoutput.ResolveMode(cmd.ResultFormat)(ModeJSONvsModePlain). - Add
output.ResolveMode(cmd.ResultFormat)support tofeature outdated,machine describe,machine inspect, andci.
- In
- Target Files:
Verification & Acceptance Criteria
mise run cli:testandmise run desktop:testpass with zero CLI flag references to--log-output,--verbose,-v/-vv/-vvv,-q/--quiet, or--debug.--log-format=autoemits JSON logs onSTDERRwhenos.Stderris non-TTY orDEVSY_UI=true, and human-readable text when interactive.- Both
--log-format=textand--result-format=text(as well asplain) are accepted across CLI commands.
Delivery checklist
- Implement the canonical global logging, result-format and live-status flags on the Core candidate.
- Update CLI child invocations and Desktop IPC to use the candidate stream contract.
- Verify the hosted Linux candidate with the real CLI and unpackaged Electron. The visible context value and full error-toast assertion passed at
1f33a68d. Hosted run - Verify current-head hosted Desktop CI and scoped Lint. Core PR
- Integrate the reviewed Windows tooling correction. The current Core Windows unit job failed the older temporary-directory fixture. Lint PR
- Qualify the final pinned CLI and Desktop contract on its exact head, including native Windows, required reviews, and owner-approved squash.
Reacted by coderabbitai
Activity
coderabbitai commentedon Nov 15, 2026
🔗 Related PRs
#1736 - feat(cli): add progress visibility control [merged]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
skevetter commentedon Nov 21, 2026
The 13-file Desktop renderer diagnostics draft is open at signed
7d1c90d7. All 1,468 local Vitest checks, Svelte check, Electron bundling, scoped Biome, and Prek passed. The CLI/Desktop flag and result contract stays together in the later coordinated slice. Hosted CI and review are pending.skevetter commentedon Nov 21, 2026
Desktop renderer diagnostics #1858 passed all hosted workflows at signed
7d1c90d7, including Desktop CI. Required main-repository reviews remain open.skevetter commentedon Nov 21, 2026
Additive CLI controls are open at signed commit
8c732e72e86d21ed244ed580d26db1369169fa79. Canonical flags and environment variables are available alongside existing arguments. Focused Go race tests, CI-parity lint, Prek, and an isolated macOS CLI check passed. The native Windows, Desktop, and E2E results remain open.skevetter commentedon Nov 21, 2026
The additive CLI draft now renders progress for
--result-format=textwhile preserving the Desktop status envelope. The regression reproduced before the fix. Reporter race tests, CI-parity lint, and Prek passed at signed headfb0ef20ecaa25f4f476c03bc8128e88cc7fcb8c7. Hosted qualification has restarted.skevetter commentedon Nov 21, 2026
Canonical CLI callers is open as a draft at signed head
9cf3f608ceda1c8ac26aa602cecdb0f6dfdf68d9. Desktop, workspace, agent, and tunnel calls now forward the canonical flags. Focused Go race tests, 87 Desktop tests, Svelte check, and Prek passed locally. The hosted Linux real-CLI Electron scenario and native Windows checks are pending. This draft depends on the additive controls.skevetter commentedon Nov 21, 2026
The canonical caller draft now carries a signed test-fixture correction at
301c75636e39a3728c55c753f4941543aaa9e097. It addresses hosted Lint's three repeated-literal findings. The same affected race tests, CI-parity lint, and Prek passed locally. Hosted qualification restarted at the new head.skevetter commentedon Nov 21, 2026
CLI flag retirement is open as a signed, 64-file draft at
bd5f3105d043a0fc9f3f850ff6e1b87358a856a5, based on the canonical caller migration. It removes the old flags and the temporary bridge. Focused race tests, CI-parity lint, Prek, 87 Desktop unit tests, E2E compilation, and isolated CLI result and error checks passed. Core CI and Desktop CI are pending.skevetter commentedon Nov 21, 2026
Additive CLI controls at
fb0ef20ecaa25f4f476c03bc8128e88cc7fcb8c7passed Windows units. Linux and macOS reproduced the older-pin redaction failures. MicroSandbox E2E started the workspace and emitted timing events as text, but the capture accepts JSON. The capture now requests JSON in a private follow-up. Its race test failed before the change and passed after. Hosted requalification awaits the merged compatibility pin and updated stack.skevetter commentedon Nov 21, 2026
Additive output controls at
745e74d4, canonical callers ata6f14e16, and flag retirement ate5a8c628now include the merged logging pin and bootstrap fixture correction. The updated retirement head passed focused CLI, output, and timing parser race tests locally. Fresh hosted qualification is running.skevetter commentedon Nov 21, 2026
Output controls at
73647b36, canonical callers atccb83269, and flag retirement at5cff91dduse the updated logging pin. Their original bases and feature changes are preserved. The folded capture race regression passed locally on each head. Fresh hosted checks are pending.skevetter commentedon Nov 21, 2026
Output controls at
ac8c537c, canonical callers atae85b8ce, and flag retirement at38028243carry the folded masking fix with their existing bases. Focused race fixtures passed; fresh hosted checks are required.skevetter commentedon Nov 21, 2026
Output controls at
6fb62bc8, canonical callers atbdafae6a, and flag retirement at9249e4b5carry the final masking fix. Focused race tests passed. The existing PR bases are preserved and fresh hosted CI is pending.