# sukirman1901/pulse-cli architecture

> Architecture diagram of the GitHub repository sukirman1901/pulse-cli, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sukirman1901/pulse-cli
- Repository: https://github.com/sukirman1901/pulse-cli

## Overview

Pulse is an AI-assisted Indonesian stock-analysis terminal app. Users submit natural-language requests or slash commands; the TUI dispatches commands or the SmartAgent interprets intent, gathers market data, runs analysis, and returns a response. Major branches include technical and fundamental analysis, screening, forecasting and charting, trading plans, broker-flow analysis, and SAPTA pre-markup detection. The map follows documented capabilities; some command wiring and module interactions are omitted where the sampled source does not establish them.

Main entry points: [`pulse/cli/commands/registry.py`](https://github.com/sukirman1901/pulse-cli/blob/main/pulse/cli/commands/registry.py) (Command Registry), [`pulse/core/smart_agent.py`](https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/smart_agent.py) (Smart Agent), [`pulse/cli/app.py`](https://github.com/sukirman1901/pulse-cli/blob/main/pulse/cli/app.py) (Pulse TUI), [`pulse/core/sapta/engine.py`](https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/sapta/engine.py) (SAPTA Engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Terminal Interface"]
  node_tui["Pulse TUI<br/>[app.py]"]
  node_commands["Command Registry<br/>[registry.py]"]
end

subgraph group_orchestration["Request Orchestration"]
  node_agent["Smart Agent<br/>[smart_agent.py]"]
end

subgraph group_market_analysis["Market Analysis"]
  node_technical["Technical Analysis<br/>[technical.py]"]
  node_fundamental["Fundamental Analysis<br/>[fundamental.py]"]
  node_screen["Stock Screener<br/>[screener.py]"]
  node_forecast["Price Forecast<br/>[forecasting.py]"]
  node_charts["Chart Generation<br/>[chart_generator.py]"]
  node_trading_plan["Trading Plan<br/>[trading_plan.py]"]
  node_broker_flow["Broker Flow Analysis<br/>[broker_flow.py]"]
  node_bandarmology["Bandarmology Engine<br/>[engine.py]"]
end

subgraph group_sapta["SAPTA Detection"]
  node_sapta_engine["SAPTA Engine<br/>[engine.py]"]
  node_sapta_modules["SAPTA Modules"]
  node_sapta_ml["SAPTA ML"]
end

subgraph group_integrations["Data And AI"]
  node_ai_client["AI Client<br/>[client.py]"]
  node_stock_data["Yahoo Finance Fetcher<br/>[yfinance.py]"]
  node_stockbit["Stockbit Client<br/>[stockbit.py]"]
end

node_user(("Analyst"))
node_llm{{"LLM Service"}}
node_yahoo{{"Yahoo Finance"}}
node_stockbit_service{{"Stockbit Service"}}

node_user -->|"submits request"| node_tui
node_tui -->|"dispatches commands"| node_commands
node_tui -->|"routes messages"| node_agent
node_tui -->|"selects model"| node_ai_client
node_agent -->|"fetches quotes"| node_stock_data
node_stock_data -->|"requests market data"| node_yahoo
node_agent -->|"runs analysis"| node_technical
node_agent -->|"runs detection"| node_sapta_engine
node_agent -->|"requests insight"| node_ai_client
node_ai_client -->|"sends prompts"| node_llm
node_commands -->|"runs analysis"| node_fundamental
node_commands -->|"screens stocks"| node_screen
node_commands -->|"generates forecast"| node_forecast
node_commands -->|"generates plan"| node_trading_plan
node_commands -->|"runs analysis"| node_broker_flow
node_commands -->|"runs analysis"| node_bandarmology
node_broker_flow -->|"fetches broker data"| node_stockbit
node_bandarmology -->|"uses broker data"| node_stockbit
node_stockbit -->|"requests broker data"| node_stockbit_service
node_commands -->|"generates charts"| node_charts
node_sapta_engine -->|"runs modules"| node_sapta_modules
node_sapta_engine -.->|"applies predictions"| node_sapta_ml

click node_tui "https://github.com/sukirman1901/pulse-cli/blob/main/pulse/cli/app.py"
click node_commands "https://github.com/sukirman1901/pulse-cli/blob/main/pulse/cli/commands/registry.py"
click node_agent "https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/smart_agent.py"
click node_ai_client "https://github.com/sukirman1901/pulse-cli/blob/main/pulse/ai/client.py"
click node_stock_data "https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/data/yfinance.py"
click node_stockbit "https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/data/stockbit.py"
click node_technical "https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/analysis/technical.py"
click node_fundamental "https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/analysis/fundamental.py"
click node_screen "https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/screener.py"
click node_forecast "https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/forecasting.py"
click node_charts "https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/chart_generator.py"
click node_trading_plan "https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/trading_plan.py"
click node_broker_flow "https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/analysis/broker_flow.py"
click node_bandarmology "https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/analysis/bandarmology/engine.py"
click node_sapta_engine "https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/sapta/engine.py"
click node_sapta_modules "https://github.com/sukirman1901/pulse-cli/tree/main/pulse/core/sapta/modules"
click node_sapta_ml "https://github.com/sukirman1901/pulse-cli/tree/main/pulse/core/sapta/ml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_tui,node_commands toneBlue
class node_agent toneAmber
class node_technical,node_fundamental,node_screen,node_forecast,node_charts,node_trading_plan,node_broker_flow,node_bandarmology toneMint
class node_sapta_engine,node_sapta_modules,node_sapta_ml toneRose
class node_ai_client,node_stock_data,node_stockbit,node_user,node_llm,node_yahoo,node_stockbit_service toneIndigo
```

## Components

### Terminal Interface

- [Pulse TUI](https://github.com/sukirman1901/pulse-cli/blob/main/pulse/cli/app.py): `pulse/cli/app.py`
- [Command Registry](https://github.com/sukirman1901/pulse-cli/blob/main/pulse/cli/commands/registry.py): `pulse/cli/commands/registry.py`

### Request Orchestration

- [Smart Agent](https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/smart_agent.py): `pulse/core/smart_agent.py`

### Market Analysis

- [Technical Analysis](https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/analysis/technical.py): `pulse/core/analysis/technical.py`
- [Fundamental Analysis](https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/analysis/fundamental.py): `pulse/core/analysis/fundamental.py`
- [Stock Screener](https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/screener.py): `pulse/core/screener.py`
- [Price Forecast](https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/forecasting.py): `pulse/core/forecasting.py`
- [Chart Generation](https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/chart_generator.py): `pulse/core/chart_generator.py`
- [Trading Plan](https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/trading_plan.py): `pulse/core/trading_plan.py`
- [Broker Flow Analysis](https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/analysis/broker_flow.py): `pulse/core/analysis/broker_flow.py`
- [Bandarmology Engine](https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/analysis/bandarmology/engine.py): `pulse/core/analysis/bandarmology/engine.py`

### SAPTA Detection

- [SAPTA Engine](https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/sapta/engine.py): `pulse/core/sapta/engine.py`
- [SAPTA Modules](https://github.com/sukirman1901/pulse-cli/tree/main/pulse/core/sapta/modules): `pulse/core/sapta/modules`
- [SAPTA ML](https://github.com/sukirman1901/pulse-cli/tree/main/pulse/core/sapta/ml): `pulse/core/sapta/ml`

### Data And AI

- [AI Client](https://github.com/sukirman1901/pulse-cli/blob/main/pulse/ai/client.py): `pulse/ai/client.py`
- [Yahoo Finance Fetcher](https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/data/yfinance.py): `pulse/core/data/yfinance.py`
- [Stockbit Client](https://github.com/sukirman1901/pulse-cli/blob/main/pulse/core/data/stockbit.py): `pulse/core/data/stockbit.py`

### Other components

- **Analyst**
- **LLM Service**
- **Yahoo Finance**
- **Stockbit Service**

## Connections

- Analyst → Pulse TUI: submits request
- Pulse TUI → Command Registry: dispatches commands
- Pulse TUI → Smart Agent: routes messages
- Pulse TUI → AI Client: selects model
- Smart Agent → Yahoo Finance Fetcher: fetches quotes
- Yahoo Finance Fetcher → Yahoo Finance: requests market data
- Smart Agent → Technical Analysis: runs analysis
- Smart Agent → SAPTA Engine: runs detection
- Smart Agent → AI Client: requests insight
- AI Client → LLM Service: sends prompts
- Command Registry → Fundamental Analysis: runs analysis
- Command Registry → Stock Screener: screens stocks
- Command Registry → Price Forecast: generates forecast
- Command Registry → Trading Plan: generates plan
- Command Registry → Broker Flow Analysis: runs analysis
- Command Registry → Bandarmology Engine: runs analysis
- Broker Flow Analysis → Stockbit Client: fetches broker data
- Bandarmology Engine → Stockbit Client: uses broker data
- Stockbit Client → Stockbit Service: requests broker data
- Command Registry → Chart Generation: generates charts
- SAPTA Engine → SAPTA Modules: runs modules
- SAPTA Engine → SAPTA ML: applies predictions
