nanocoder icon indicating copy to clipboard operation
nanocoder copied to clipboard

[Bug] config show --profile <name> ignores the spaced form

Open akramcodez opened this issue 2 weeks ago • 1 comments

Description

nanocoder config show --profile <name> (separate value) is ignored and the default profile is shown. The --profile=<name> form works. The same applies to config diff and config list. The docs for named profiles lead with the --profile <name> form.

An unknown name in the spaced form is still rejected with "Unknown profile", so the value is read for validation but is lost before the config is resolved. source/config/config-cli.ts parses both forms, so the cause is probably upstream of it (argument handling in source/cli.tsx) or in how the active profile is passed to resolveEffectiveConfig.

Environment

  • OS: macOS
  • Node version: v22.23.4
  • Nanocoder version: 1.32.0 (main at babedfa1)
  • Provider: Not applicable
  • Model: Not applicable

Steps to Reproduce

  1. In a project config, define profiles pp and gp and set defaultProfile to pp.
  2. Run nanocoder config show --profile gp.
  3. Run nanocoder config show --profile=gp.

Expected Behavior

Both commands show active profile gp.

Actual Behavior

The spaced form prints active profile pp and shows pp's values. The = form prints active profile gp.

Logs/Screenshots

Reproduced on a built dist/ of main with a fixture global and project config.

Additional Context

  • [x] I have searched existing issues to ensure this is not a duplicate
  • [x] I can reproduce this issue consistently
  • [x] This issue occurs with the latest version of nanocoder

akramcodez avatar Nov 20 '26 11:11 akramcodez

I'd like to pick this up. Plan: trace where the spaced --profile <name> value is dropped between source/cli.tsx argument handling and resolveEffectiveConfig, fix it so both forms resolve the same profile for config show/diff/list, and add a regression spec covering the spaced form. Patch changeset included.

Seyamalam avatar Nov 20 '26 12:11 Seyamalam