@secapi/cli 0.3.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +173 -0
  2. package/dist/index.js +3533 -191
  3. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,173 @@
1
+ # SEC API CLI
2
+
3
+ Command-line interface for SEC API factor data, SEC filings, financial statements, ownership data, and agent workflows.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g @secapi/cli
9
+ ```
10
+
11
+ ## Connect an agent
12
+
13
+ Wire the hosted MCP server into your agent client in one command:
14
+
15
+ ```bash
16
+ secapi init --client claude-code # prints the `claude mcp add` command
17
+ secapi init --client cursor # writes .cursor/mcp.json
18
+ secapi init --client claude-desktop # writes the Claude Desktop config
19
+ secapi init --client windsurf # writes ~/.codeium/windsurf/mcp_config.json
20
+ secapi init --client project # writes ./.mcp.json
21
+ secapi init --client cursor --print # dry-run: print the config, write nothing
22
+ ```
23
+
24
+ `secapi init` reads your key from `SECAPI_API_KEY` (or `--api-key-stdin`) and never
25
+ accepts it as an argv flag. `secapi agent-context` prints a machine-readable JSON
26
+ description of the whole CLI surface so an agent can learn the tool in one call.
27
+
28
+ ## Configuration
29
+
30
+ ```bash
31
+ export SECAPI_API_KEY="ods_..."
32
+ export SECAPI_BASE_URL="https://api.secapi.ai"
33
+ ```
34
+
35
+ `SECAPI_BASE_URL` is optional. The CLI defaults to `https://api.secapi.ai`.
36
+
37
+ Two binaries are installed: the preferred `secapi` and the compatibility alias `omni-sec`.
38
+
39
+ ```bash
40
+ secapi --version # prints the bare package version, e.g. 0.4.0
41
+ secapi --help # lists every command group
42
+ ```
43
+
44
+ ## Five-minute Quickstart
45
+
46
+ Five copy-paste examples that exercise the core surfaces. Each reads
47
+ `SECAPI_API_KEY` from the environment — credentials are never accepted as
48
+ argv flags (they leak through shell history); pipe them via `--api-key-stdin`
49
+ if you cannot set an env var.
50
+
51
+ ```bash
52
+ # 1. Confirm auth and see your plan/limits
53
+ secapi me
54
+
55
+ # 2. Pull the latest 10-K for a ticker
56
+ secapi filings latest --ticker AAPL --form 10-K
57
+
58
+ # 3. Full-text search filing content (Typesense)
59
+ secapi search fulltext --q "supply chain disruption" --form 10-K --limit 10
60
+
61
+ # 4. Hybrid semantic search with citation fields (Voyage AI + Pinecone)
62
+ secapi search semantic --q "revenue concentration risk" --ticker AAPL --mode hybrid --view agent
63
+
64
+ # 5. A single XBRL fact across filings
65
+ secapi facts get --ticker AAPL --tag Assets --form 10-K
66
+ ```
67
+
68
+ ## Search
69
+
70
+ ```bash
71
+ # Keyword/full-text search across filing + section text
72
+ secapi search fulltext --q "going concern" --ticker BBBB --limit 25
73
+
74
+ # Vector / hybrid semantic search; --view agent drops score + retrievalMode
75
+ secapi search semantic --q "material weakness in internal controls" --mode hybrid --filing-year 2025
76
+
77
+ # Section-scoped keyword search
78
+ secapi sections search --ticker AAPL --q risk --form 10-K
79
+ ```
80
+
81
+ ## Factor Quickstart
82
+
83
+ Use `--response-mode compact` when you are feeding an agent, LLM, notebook, or UI card and want the smallest useful payload. Add `--include trust` when you need freshness, methodology, and materialization metadata for citations or launch checks.
84
+
85
+ ```bash
86
+ # Factor catalog for picker UIs and agent tool discovery
87
+ secapi factors catalog --category style --response-mode compact --include trust
88
+
89
+ # 1D through MAX style return history for charts and tables
90
+ secapi factors history --factor VALUE --range 1y --response-mode compact --include trust,series
91
+
92
+ # Factor opportunity screen for valuation-led workflows
93
+ secapi factors valuations \
94
+ --keys VALUE,QUALITY,MOMENTUM \
95
+ --side all \
96
+ --sort opportunity_score \
97
+ --limit 25 \
98
+ --response-mode compact \
99
+ --include trust
100
+
101
+ # Extreme moves and pairs for dashboard surfaces
102
+ secapi factors dashboard --country US --category style --ticker AAPL --response-mode compact --include trust
103
+ secapi factors extreme-moves --category style --window 1d --min-z-score 2 --response-mode compact --include trust
104
+ secapi factors extreme-pairs --category style --window 1m --min-z-score 1 --response-mode compact --include trust
105
+ ```
106
+
107
+ ## Portfolio Factor Workflows
108
+
109
+ Portfolio and model workflows accept JSON because they carry holdings and constraints.
110
+
111
+ ```bash
112
+ cat > holdings.json <<'JSON'
113
+ [
114
+ { "symbol": "AAPL", "weight": 0.4 },
115
+ { "symbol": "MSFT", "weight": 0.35 },
116
+ { "symbol": "NVDA", "weight": 0.25 }
117
+ ]
118
+ JSON
119
+
120
+ secapi portfolio analyze \
121
+ --holdings-file holdings.json \
122
+ --response-mode compact \
123
+ --include trust
124
+
125
+ secapi portfolio attribution \
126
+ --holdings-file holdings.json \
127
+ --window 1y \
128
+ --frequency monthly \
129
+ --response-mode compact \
130
+ --include trust
131
+
132
+ secapi portfolio hedge \
133
+ --holdings-file holdings.json \
134
+ --objective factor_neutral \
135
+ --constraints-json '{"maxHedges":5}' \
136
+ --response-mode compact \
137
+ --include trust
138
+
139
+ secapi portfolio optimize \
140
+ --holdings-file holdings.json \
141
+ --objective regime_aware \
142
+ --constraints-json '{"longOnly":true,"maxPositionWeight":0.35}' \
143
+ --response-mode compact \
144
+ --include trust
145
+ ```
146
+
147
+ ## Model Workflows
148
+
149
+ ```bash
150
+ secapi models factor-analysis \
151
+ --holdings-file holdings.json \
152
+ --model-json '{"id":"growth-core","label":"Growth Core"}' \
153
+ --include-attribution \
154
+ --include-hedge \
155
+ --include-optimizer \
156
+ --response-mode compact \
157
+ --include trust
158
+ ```
159
+
160
+ ## Discovery
161
+
162
+ ```bash
163
+ secapi --help
164
+ secapi factors catalog --category style
165
+ secapi factors bulk-download --keys VALUE,QUALITY,MOMENTUM --format csv
166
+ secapi factors similarity-pack --symbol AAPL --limit 10
167
+ secapi model-portfolios factor-view --portfolio-id growth-core --response-mode compact
168
+ ```
169
+
170
+ ## Links
171
+
172
+ - [API Documentation](https://docs.secapi.ai)
173
+ - [Developer Portal](https://secapi.ai/developers)