Skip to content

feat(cli): add interactive init env bootstrap#19

Merged
warren618 merged 2 commits into
HKUDS:mainfrom
trinhchien:feat/init-env-bootstrap
Apr 11, 2026
Merged

feat(cli): add interactive init env bootstrap#19
warren618 merged 2 commits into
HKUDS:mainfrom
trinhchien:feat/init-env-bootstrap

Conversation

@trinhchien

Copy link
Copy Markdown
Contributor

Summary

  • update vibe-trading init to guide users through interactive .env setup
  • write config to agent/.env instead of ~/.vibe-trading/.env
  • support provider selection for OpenRouter, OpenAI, Anthropic, DeepSeek, and Ollama
  • add basic API-key validation and overwrite confirmation
  • add regression tests for env rendering and init flow

Testing

  • python3 -m py_compile agent/cli.py agent/tests/test_cli_init.py agent/tests/test_llm.py agent/tests/conftest.py
  • import smoke test for cli.cmd_init

Closes #14

@warren618 warren618 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for picking this up @trinhchien — the interactive flow, key validation, and tests all look solid!

A couple of things to address before merging:

1. Provider list should match .env.example

The current PR has 5 providers (OpenRouter, OpenAI, Anthropic, DeepSeek, Ollama), but the project actually supports 11 providers — see agent/.env.example for the full list.

Specifically:

  • Remove Anthropic — our backend uses OpenAI-compatible endpoints via LangChain; Anthropic's API is not compatible, so it would not work even if configured
  • Add the missing providers: Gemini, Groq, DashScope/Qwen, Zhipu, Moonshot/Kimi, MiniMax, MIMO

Please use agent/.env.example as the source of truth for provider names, env var names, base URLs, and default models.

2. Unused _INIT_ENV_DIR variable

_INIT_ENV_DIR = Path.home() / ".vibe-trading" on line 1407 is no longer used since the path was changed to agent/.env. Please remove it.


Everything else (Rich prompts, _render_env_content, tests) looks great. Just need the provider list aligned and the dead variable cleaned up. Thanks!

@trinhchien

trinhchien commented Apr 11, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the review feedback in the latest push:

  • aligned provider choices with
  • removed Anthropic
  • added the missing providers (Gemini, Groq, DashScope/Qwen, Zhipu, Moonshot/Kimi, MiniMax, MIMO)
  • removed the unused legacy init-dir variable
  • updated tests accordingly\n\nAlso re-ran quick smoke checks with and import validation.

@warren618 warren618 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — provider list now matches .env.example, unused variable removed, tests updated. Nice work!

@warren618 warren618 merged commit 5756755 into HKUDS:main Apr 11, 2026
SoufianoDev pushed a commit to SoufianoDev/Vibe-Trading that referenced this pull request Apr 12, 2026
* feat(cli): add interactive init env bootstrap

* fix(cli): align init providers with env example

---------

Co-authored-by: chientrinh <trinhdachien1598@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants