Skip to content

Commit c9ce654

Browse files
committed
feat(cli): persist interactive preferences safely
1 parent a33fd4c commit c9ce654

11 files changed

Lines changed: 1474 additions & 60 deletions

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,10 @@ cython_debug/
186186
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
187187
# and can be added to the global gitignore or merged into this file. For a more nuclear
188188
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
189-
# .idea/
189+
.idea/
190+
191+
# Local agent state and scratch artifacts
192+
.agents/
190193

191194
# Abstra
192195
# Abstra is an AI-powered process automation framework.

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,27 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77
Breaking changes within the 0.x line are called out explicitly.
88

9+
## [Unreleased]
10+
11+
### Added
12+
13+
- **Saved CLI preferences.** Interactive users can persist provider, model,
14+
research-depth, language, and reasoning settings in
15+
`~/.tradingagents/preferences.json`, reuse them on later runs, inspect them
16+
with `config show`, update them with `config set`, or clear them with
17+
`config reset`.
18+
19+
### Fixed
20+
21+
- Preserved the legacy root analysis options alongside the explicit `analyze`
22+
command and applied the Windows no-console guard consistently to analysis and
23+
preference commands.
24+
- Prevented incomplete or newer-version preference files from being silently
25+
reused or overwritten, and kept provider changes from combining incompatible
26+
saved models, endpoints, or reasoning settings.
27+
- Avoided the first-run save prompt in non-interactive sessions and stopped
28+
cleanly when the saved-preferences prompt is cancelled.
29+
930
## [0.3.1] — 2026-07-05
1031

1132
Correctness and stability patch: data look-ahead, graph-router crash-safety,

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,34 @@ python -m cli.main # alternative: run directly from source
169169
```
170170
You will see a screen where you can select your desired tickers, analysis date, LLM provider, research depth, and more.
171171

172+
### Saved CLI preferences
173+
174+
If you use the CLI interactively, you can save the settings that normally stay
175+
the same between runs:
176+
177+
```bash
178+
tradingagents config set # configure and save provider/model settings
179+
tradingagents config show # display saved settings
180+
tradingagents analyze # reuse saved settings for a new analysis
181+
tradingagents analyze --configure # run setup again and replace saved settings
182+
tradingagents config reset # remove saved settings
183+
```
184+
185+
Saved preferences are stored at `~/.tradingagents/preferences.json`. They cover
186+
the provider, models, research depth, output language, and provider-specific
187+
reasoning options. The ticker, analysis date, and analyst team remain per-run
188+
choices. Explicit `TRADINGAGENTS_*` environment variables take precedence over
189+
saved preferences, and API keys remain in the environment or `.env` file rather
190+
than in the preferences file.
191+
192+
The legacy root form remains supported, so `tradingagents --checkpoint` and
193+
`tradingagents --no-checkpoint` are equivalent to the corresponding options on
194+
`tradingagents analyze`. If `TRADINGAGENTS_LLM_PROVIDER` changes the provider
195+
from the one saved in preferences, the CLI does not mix provider-specific
196+
models, endpoints, or reasoning settings: matching environment overrides are
197+
used, otherwise the new provider's defaults are selected. Custom-only providers
198+
require matching model environment variables or `--configure`.
199+
172200
### Markets and tickers
173201

174202
TradingAgents works with any market Yahoo Finance covers, using the exchange-suffixed ticker. Company identity and the alpha benchmark resolve automatically per market.

0 commit comments

Comments
 (0)