mirror of
https://github.com/MarkusZoppelt/portfolio_rs.git
synced 2026-11-22 12:22:56 +01:00
The README had grown to ~600 lines, mostly MCP and HTTP API reference. It now keeps the pitch, installation, quick start, a short TUI section, the command table and an index of docs/. The reference material moved to docs/ (tui, agents, mcp, http-api, library, quotes, configuration), and the MCP docs test now checks docs/mcp.md. The TUI screenshots and the CLI demo gif were outdated and are removed; img/ is excluded from the published crate. Em-dashes are gone from the README, the new docs and the crate description.
607 B
607 B
Library usage
The crate is also a library: state::AppState is an embedding-friendly
facade used by the HTTP API and external GUIs (e.g. a Tauri desktop app).
It loads portfolios/workspaces/policies, does position CRUD, and runs every
analysis (context, review, simulate, doctor, validate, reports) with
camelCase-serializable DTOs.
use portfolio_rs::AppState;
async fn total_value() -> eyre::Result<f64> {
let state = AppState::new("EUR".to_string());
state.load_file("positions.json").await?;
let summary = state.get_portfolio_summary().await;
Ok(summary.total_value)
}