Skip to content

Commit 89b4717

Browse files
committed
fix: offer project credentials when global creds already exist
When ~/.cems/credentials already exists, cems setup now asks "Also set up project-specific credentials?" instead of silently skipping the credential step entirely.
1 parent 49ff296 commit 89b4717

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/cems/commands/setup.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,16 @@ def _setup_credentials(api_url: str | None = None, api_key: str | None = None) -
280280
cems_dir = Path.home() / ".cems"
281281
creds_file = cems_dir / "credentials"
282282

283-
# Already configured
283+
# Already configured — but offer project setup if interactive
284284
if creds_file.exists() and not api_key:
285285
console.print(f"[green]Credentials:[/green] {creds_file}")
286+
if _is_interactive():
287+
also_project = click.confirm(
288+
"Also set up project-specific credentials in this directory?",
289+
default=False,
290+
)
291+
if also_project:
292+
_setup_project_credentials(None, None)
286293
return True
287294

288295
# Non-interactive with explicit values — preserve existing custom keys

0 commit comments

Comments
 (0)