Skip to content

Fresh install has no settings.json: first run fails with "API key not found" and forces manual file creation #202

Description

@kuishou68

Summary

On a fresh install, deepcode never creates ~/.deepcode/settings.json. The directory is created (it holds machine-id, projects/, etc.), but there is no settings file. The first task therefore fails with:

✦ API key not found. Please configure ~/.deepcode/settings.json or ./.deepcode/settings.json.

The error tells the user to "configure" the file, but the file does not exist and the user has to create it from scratch while guessing the schema (env.API_KEY, env.BASE_URL, env.MODEL).

Steps to reproduce

  1. npm i -g @vegamo/deepcode-cli on a machine with no prior config.
  2. Run deepcode and send any prompt.
  3. Observe the API key not found error.
  4. ls ~/.deepcode/ — there is no settings.json to edit.

Expected

First run should produce a ready-to-edit ~/.deepcode/settings.json template (empty API_KEY, default BASE_URL/MODEL) so the user only has to paste their key, rather than authoring the file and its schema by hand.

Environment

  • Package: @vegamo/deepcode-cli
  • Version: 0.1.31 (also reproduces on current main / 0.1.33)
  • OS: macOS (darwin)

Notes

Root cause is in packages/core/src/settings.ts: settings are only ever read on startup (readSettings() returns null when the file is missing) and only written lazily when something like a model selection changes. Nothing scaffolds the file on first run.

I have a fix ready (auto-scaffold a template on first run, never overwriting an existing file) and will open a PR referencing this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions