@secapi/cli 0.2.0 → 0.3.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.
- package/dist/index.js +148 -153
- package/package.json +7 -5
package/dist/index.js
CHANGED
|
@@ -14424,8 +14424,7 @@ var APP_ONLY_DATABASE_URL_PARAMS2 = new Set([
|
|
|
14424
14424
|
// ../sdk-js/src/index.ts
|
|
14425
14425
|
var DEFAULT_BASE_URL = "https://api.secapi.ai";
|
|
14426
14426
|
var DEFAULT_API_VERSION = "2026-03-19";
|
|
14427
|
-
var SDK_VERSION = "0.
|
|
14428
|
-
var POSTHOG_CAPTURE_TOKEN = "phc_erM3KBxu4WfepnjJ6TLT11QA0yykiCeRQdi5S4xwCR6";
|
|
14427
|
+
var SDK_VERSION = "0.4.0";
|
|
14429
14428
|
var POSTHOG_CAPTURE_HOST = "https://us.i.posthog.com";
|
|
14430
14429
|
var SAFE_RETRY_METHODS = new Set(["GET", "HEAD", "OPTIONS"]);
|
|
14431
14430
|
var RETRYABLE_STATUSES = new Set([408, 429, 502, 503, 504]);
|
|
@@ -14456,8 +14455,8 @@ class ClientCircuitBreaker {
|
|
|
14456
14455
|
this.state = "half_open";
|
|
14457
14456
|
return;
|
|
14458
14457
|
}
|
|
14459
|
-
throw new
|
|
14460
|
-
message: "
|
|
14458
|
+
throw new SecApiError({
|
|
14459
|
+
message: "SEC API client circuit breaker is open",
|
|
14461
14460
|
status: 0,
|
|
14462
14461
|
code: "client_circuit_open"
|
|
14463
14462
|
});
|
|
@@ -14483,7 +14482,7 @@ class ClientCircuitBreaker {
|
|
|
14483
14482
|
}
|
|
14484
14483
|
}
|
|
14485
14484
|
|
|
14486
|
-
class
|
|
14485
|
+
class SecApiError extends Error {
|
|
14487
14486
|
status;
|
|
14488
14487
|
code;
|
|
14489
14488
|
requestId;
|
|
@@ -14491,7 +14490,7 @@ class OmniDatastreamError extends Error {
|
|
|
14491
14490
|
retryAfterMs;
|
|
14492
14491
|
constructor(args) {
|
|
14493
14492
|
super(args.message);
|
|
14494
|
-
this.name = "
|
|
14493
|
+
this.name = "SecApiError";
|
|
14495
14494
|
this.status = args.status;
|
|
14496
14495
|
this.code = args.code;
|
|
14497
14496
|
this.requestId = args.requestId;
|
|
@@ -14500,12 +14499,12 @@ class OmniDatastreamError extends Error {
|
|
|
14500
14499
|
}
|
|
14501
14500
|
}
|
|
14502
14501
|
|
|
14503
|
-
class
|
|
14502
|
+
class SecApiValidationError extends Error {
|
|
14504
14503
|
raw;
|
|
14505
14504
|
issues;
|
|
14506
14505
|
constructor(raw, issues) {
|
|
14507
14506
|
super(`Response validation failed: ${issues.length} issue(s)`);
|
|
14508
|
-
this.name = "
|
|
14507
|
+
this.name = "SecApiValidationError";
|
|
14509
14508
|
this.raw = raw;
|
|
14510
14509
|
this.issues = issues;
|
|
14511
14510
|
}
|
|
@@ -14514,7 +14513,7 @@ function parseWithSchema(schema, data) {
|
|
|
14514
14513
|
const result = schema.safeParse(data);
|
|
14515
14514
|
if (result.success)
|
|
14516
14515
|
return result.data;
|
|
14517
|
-
throw new
|
|
14516
|
+
throw new SecApiValidationError(data, result.error.issues);
|
|
14518
14517
|
}
|
|
14519
14518
|
function isRequestOptionKey(key) {
|
|
14520
14519
|
return key === "retry" || key === "telemetry";
|
|
@@ -14626,8 +14625,8 @@ function isAbortError(error) {
|
|
|
14626
14625
|
return Boolean(error && typeof error === "object" && "name" in error && error.name === "AbortError");
|
|
14627
14626
|
}
|
|
14628
14627
|
function retryBudgetExceededError() {
|
|
14629
|
-
return new
|
|
14630
|
-
message: "
|
|
14628
|
+
return new SecApiError({
|
|
14629
|
+
message: "SEC API request exceeded retry budget",
|
|
14631
14630
|
status: 0,
|
|
14632
14631
|
code: "client_retry_budget_exceeded"
|
|
14633
14632
|
});
|
|
@@ -14700,11 +14699,11 @@ function extractErrorCode(payload) {
|
|
|
14700
14699
|
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
14701
14700
|
}
|
|
14702
14701
|
function buildErrorMessage(status, requestId, payload) {
|
|
14703
|
-
const message = payload && typeof payload === "object" && !Array.isArray(payload) && typeof payload.message === "string" ? String(payload.message) : payload && typeof payload === "object" && !Array.isArray(payload) && typeof payload.error === "string" ? String(payload.error) : typeof payload === "string" && payload.trim() ? payload.trim() : `
|
|
14702
|
+
const message = payload && typeof payload === "object" && !Array.isArray(payload) && typeof payload.message === "string" ? String(payload.message) : payload && typeof payload === "object" && !Array.isArray(payload) && typeof payload.error === "string" ? String(payload.error) : typeof payload === "string" && payload.trim() ? payload.trim() : `SEC API request failed with status ${status}`;
|
|
14704
14703
|
return requestId ? `${message} (request_id: ${requestId})` : message;
|
|
14705
14704
|
}
|
|
14706
14705
|
|
|
14707
|
-
class
|
|
14706
|
+
class SecApiClient {
|
|
14708
14707
|
options;
|
|
14709
14708
|
circuitBreaker = new ClientCircuitBreaker(DEFAULT_RETRY_CONFIG.circuitBreakerFailureThreshold, DEFAULT_RETRY_CONFIG.circuitBreakerCooldownMs);
|
|
14710
14709
|
telemetryDistinctId = randomId();
|
|
@@ -14720,7 +14719,6 @@ class OmniDatastreamClient {
|
|
|
14720
14719
|
headers(initHeaders) {
|
|
14721
14720
|
const headers = new Headers(this.options.headers);
|
|
14722
14721
|
headers.set("secapi-version", this.options.apiVersion ?? DEFAULT_API_VERSION);
|
|
14723
|
-
headers.set("omni-version", this.options.apiVersion ?? DEFAULT_API_VERSION);
|
|
14724
14722
|
if (this.options.bearerToken) {
|
|
14725
14723
|
headers.set("Authorization", `Bearer ${this.options.bearerToken}`);
|
|
14726
14724
|
}
|
|
@@ -14762,9 +14760,9 @@ class OmniDatastreamClient {
|
|
|
14762
14760
|
return { retryable: false, reason: "disabled" };
|
|
14763
14761
|
if (isAbortError(args.error))
|
|
14764
14762
|
return { retryable: false, reason: "aborted" };
|
|
14765
|
-
if (args.error instanceof
|
|
14763
|
+
if (args.error instanceof SecApiValidationError)
|
|
14766
14764
|
return { retryable: false, reason: "validation" };
|
|
14767
|
-
if (args.error instanceof
|
|
14765
|
+
if (args.error instanceof SecApiError) {
|
|
14768
14766
|
const status = args.error.status;
|
|
14769
14767
|
if (NEVER_RETRY_STATUSES.has(status))
|
|
14770
14768
|
return { retryable: false, status, reason: "non_retryable_status" };
|
|
@@ -14784,7 +14782,7 @@ class OmniDatastreamClient {
|
|
|
14784
14782
|
const { disabled, options } = mergeTelemetryOptions(this.options.telemetry, args.requestOptions?.telemetry);
|
|
14785
14783
|
if (disabled)
|
|
14786
14784
|
return;
|
|
14787
|
-
const captureToken = options.captureToken
|
|
14785
|
+
const captureToken = options.captureToken;
|
|
14788
14786
|
const host = (options.host ?? POSTHOG_CAPTURE_HOST).replace(/\/$/, "");
|
|
14789
14787
|
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
14790
14788
|
if (!captureToken || typeof fetchImpl !== "function")
|
|
@@ -14858,7 +14856,7 @@ class OmniDatastreamClient {
|
|
|
14858
14856
|
const response = await this.fetchOnce(path, { ...init, headers }, joinedSignal.signal);
|
|
14859
14857
|
const { payload, requestId } = await this.parseResponse(response);
|
|
14860
14858
|
if (!response.ok) {
|
|
14861
|
-
throw new
|
|
14859
|
+
throw new SecApiError({
|
|
14862
14860
|
message: buildErrorMessage(response.status, requestId, payload),
|
|
14863
14861
|
status: response.status,
|
|
14864
14862
|
code: extractErrorCode(payload),
|
|
@@ -14882,7 +14880,7 @@ class OmniDatastreamClient {
|
|
|
14882
14880
|
}
|
|
14883
14881
|
lastError = error;
|
|
14884
14882
|
const decision = this.shouldRetry({ error, method, retryDisabled, unsafeOptIn });
|
|
14885
|
-
const retryAfterMs = error instanceof
|
|
14883
|
+
const retryAfterMs = error instanceof SecApiError && decision.status === 429 ? error.retryAfterMs : undefined;
|
|
14886
14884
|
if (!decision.retryable || attempt >= maxRetries) {
|
|
14887
14885
|
if (decision.retryable && circuitEligible)
|
|
14888
14886
|
this.circuitBreaker.recordFailure(now());
|
|
@@ -14920,8 +14918,8 @@ class OmniDatastreamClient {
|
|
|
14920
14918
|
joinedSignal.cleanup();
|
|
14921
14919
|
}
|
|
14922
14920
|
}
|
|
14923
|
-
throw lastError instanceof Error ? lastError : new
|
|
14924
|
-
message: "
|
|
14921
|
+
throw lastError instanceof Error ? lastError : new SecApiError({
|
|
14922
|
+
message: "SEC API request failed",
|
|
14925
14923
|
status: 0,
|
|
14926
14924
|
code: "client_request_failed"
|
|
14927
14925
|
});
|
|
@@ -15611,7 +15609,7 @@ class OmniFilingStream {
|
|
|
15611
15609
|
|
|
15612
15610
|
// src/index.ts
|
|
15613
15611
|
var args = process.argv.slice(2);
|
|
15614
|
-
var baseUrl = envCredential("SECAPI_BASE_URL", "SECAPI_API_BASE_URL"
|
|
15612
|
+
var baseUrl = envCredential("SECAPI_BASE_URL", "SECAPI_API_BASE_URL") ?? "https://api.secapi.ai";
|
|
15615
15613
|
var STDIN_FLAG_NAME = "--api-key-stdin";
|
|
15616
15614
|
var STDIN_BEARER_FLAG_NAME = "--bearer-token-stdin";
|
|
15617
15615
|
var REJECTED_CREDENTIAL_FLAGS = new Set(["--api-key", "--bearer-token"]);
|
|
@@ -15631,7 +15629,7 @@ function formatPersonasHuman() {
|
|
|
15631
15629
|
console.log(` ${DIM}${meta.summary}${RESET}`);
|
|
15632
15630
|
}
|
|
15633
15631
|
console.log("");
|
|
15634
|
-
console.log(`${DIM}Run 'secapi agents prompts list --persona <slug>' to see prompts for a persona.
|
|
15632
|
+
console.log(`${DIM}Run 'secapi agents prompts list --persona <slug>' to see prompts for a persona. ${RESET}`);
|
|
15635
15633
|
}
|
|
15636
15634
|
function formatPromptsListHuman(persona, prompts, totalCount) {
|
|
15637
15635
|
if (persona) {
|
|
@@ -15749,7 +15747,7 @@ function rejectCredentialArgvFlags() {
|
|
|
15749
15747
|
const flag = rejectedCredentialFlag(arg);
|
|
15750
15748
|
if (!flag)
|
|
15751
15749
|
continue;
|
|
15752
|
-
const envName = flag === "--api-key" ? "SECAPI_API_KEY
|
|
15750
|
+
const envName = flag === "--api-key" ? "SECAPI_API_KEY or SECAPI_OPERATOR_API_KEY" : "SECAPI_BEARER_TOKEN";
|
|
15753
15751
|
const stdinFlag = flag === "--api-key" ? STDIN_FLAG_NAME : STDIN_BEARER_FLAG_NAME;
|
|
15754
15752
|
throw new Error(`${flag} is no longer supported because argv credentials leak through shell history and process listings. ` + `Set ${envName}, or pipe the credential through ${stdinFlag}.`);
|
|
15755
15753
|
}
|
|
@@ -15790,12 +15788,12 @@ async function resolveCredentials() {
|
|
|
15790
15788
|
}
|
|
15791
15789
|
const stdinCredential = apiKeyFromStdin || bearerTokenFromStdin ? await readCredentialFromStdin(apiKeyFromStdin ? STDIN_FLAG_NAME : STDIN_BEARER_FLAG_NAME) : undefined;
|
|
15792
15790
|
return {
|
|
15793
|
-
apiKey: apiKeyFromStdin ? stdinCredential : envCredential("SECAPI_OPERATOR_API_KEY", "SECAPI_API_KEY"
|
|
15794
|
-
bearerToken: bearerTokenFromStdin ? stdinCredential : envCredential("SECAPI_BEARER_TOKEN"
|
|
15791
|
+
apiKey: apiKeyFromStdin ? stdinCredential : envCredential("SECAPI_OPERATOR_API_KEY", "SECAPI_API_KEY"),
|
|
15792
|
+
bearerToken: bearerTokenFromStdin ? stdinCredential : envCredential("SECAPI_BEARER_TOKEN")
|
|
15795
15793
|
};
|
|
15796
15794
|
}
|
|
15797
15795
|
function defaultClient(credentials) {
|
|
15798
|
-
return new
|
|
15796
|
+
return new SecApiClient({
|
|
15799
15797
|
apiKey: credentials.apiKey,
|
|
15800
15798
|
bearerToken: credentials.bearerToken,
|
|
15801
15799
|
baseUrl
|
|
@@ -15804,9 +15802,9 @@ function defaultClient(credentials) {
|
|
|
15804
15802
|
function humanClient(credentials) {
|
|
15805
15803
|
const bearerToken = credentials.bearerToken;
|
|
15806
15804
|
if (!bearerToken) {
|
|
15807
|
-
throw new Error(`Bearer-authenticated commands require SECAPI_BEARER_TOKEN
|
|
15805
|
+
throw new Error(`Bearer-authenticated commands require SECAPI_BEARER_TOKEN or ${STDIN_BEARER_FLAG_NAME}`);
|
|
15808
15806
|
}
|
|
15809
|
-
return new
|
|
15807
|
+
return new SecApiClient({
|
|
15810
15808
|
bearerToken,
|
|
15811
15809
|
baseUrl
|
|
15812
15810
|
});
|
|
@@ -15816,7 +15814,7 @@ async function main() {
|
|
|
15816
15814
|
const credentials = await resolveCredentials();
|
|
15817
15815
|
const [group = "help", command = ""] = args;
|
|
15818
15816
|
const apiClient = defaultClient(credentials);
|
|
15819
|
-
const anonymousClient = new
|
|
15817
|
+
const anonymousClient = new SecApiClient({ baseUrl });
|
|
15820
15818
|
if (group === "health") {
|
|
15821
15819
|
print(await apiClient.health());
|
|
15822
15820
|
return;
|
|
@@ -15971,7 +15969,7 @@ async function main() {
|
|
|
15971
15969
|
if (group === "agents" && command === "prompts") {
|
|
15972
15970
|
const subverb = args[2];
|
|
15973
15971
|
if (!subverb || subverb.startsWith("-")) {
|
|
15974
|
-
throw new Error("Usage: secapi agents prompts <list|read|copy> [...]
|
|
15972
|
+
throw new Error("Usage: secapi agents prompts <list|read|copy> [...]");
|
|
15975
15973
|
}
|
|
15976
15974
|
if (subverb === "list") {
|
|
15977
15975
|
const personaFlag = getFlag("--persona");
|
|
@@ -16002,7 +16000,7 @@ async function main() {
|
|
|
16002
16000
|
if (subverb === "read") {
|
|
16003
16001
|
const id = args[3];
|
|
16004
16002
|
if (!id || id.startsWith("-")) {
|
|
16005
|
-
throw new Error("Usage: secapi agents prompts read <id>. Run 'secapi agents prompts list' to see IDs.
|
|
16003
|
+
throw new Error("Usage: secapi agents prompts read <id>. Run 'secapi agents prompts list' to see IDs. ");
|
|
16006
16004
|
}
|
|
16007
16005
|
const prompt = getPrompt(id);
|
|
16008
16006
|
if (!prompt) {
|
|
@@ -16018,7 +16016,7 @@ async function main() {
|
|
|
16018
16016
|
if (subverb === "copy") {
|
|
16019
16017
|
const id = args[3];
|
|
16020
16018
|
if (!id || id.startsWith("-")) {
|
|
16021
|
-
throw new Error("Usage: secapi agents prompts copy <id>. Pipe to clipboard via | pbcopy (macOS), | xclip -selection clipboard (Linux), or | clip (Windows).
|
|
16019
|
+
throw new Error("Usage: secapi agents prompts copy <id>. Pipe to clipboard via | pbcopy (macOS), | xclip -selection clipboard (Linux), or | clip (Windows). ");
|
|
16022
16020
|
}
|
|
16023
16021
|
const prompt = getPrompt(id);
|
|
16024
16022
|
if (!prompt) {
|
|
@@ -16326,7 +16324,7 @@ async function main() {
|
|
|
16326
16324
|
if (group === "dilution" && command === "event") {
|
|
16327
16325
|
const eventId = getFlag("--event-id");
|
|
16328
16326
|
if (!eventId)
|
|
16329
|
-
throw new Error("Usage: secapi dilution event --event-id <id> [--view agent]
|
|
16327
|
+
throw new Error("Usage: secapi dilution event --event-id <id> [--view agent]");
|
|
16330
16328
|
print(await apiClient.dilutionEventDetail(eventId, { view: getFlag("--view") }));
|
|
16331
16329
|
return;
|
|
16332
16330
|
}
|
|
@@ -16445,7 +16443,7 @@ async function main() {
|
|
|
16445
16443
|
if (group === "dilution" && command === "score") {
|
|
16446
16444
|
const ticker = getFlag("--ticker");
|
|
16447
16445
|
if (!ticker)
|
|
16448
|
-
throw new Error("Usage: secapi dilution score --ticker <symbol> [--view agent]
|
|
16446
|
+
throw new Error("Usage: secapi dilution score --ticker <symbol> [--view agent]");
|
|
16449
16447
|
print(await apiClient.dilutionScore({ ticker, view: getFlag("--view") }));
|
|
16450
16448
|
return;
|
|
16451
16449
|
}
|
|
@@ -16803,147 +16801,144 @@ async function main() {
|
|
|
16803
16801
|
const commandHelpLines = [
|
|
16804
16802
|
"SEC API CLI",
|
|
16805
16803
|
"Preferred binary: secapi",
|
|
16806
|
-
"Compatibility alias: omni-sec",
|
|
16807
16804
|
"",
|
|
16808
16805
|
"Commands:",
|
|
16809
|
-
"
|
|
16810
|
-
"
|
|
16811
|
-
"
|
|
16812
|
-
"
|
|
16813
|
-
"
|
|
16814
|
-
"
|
|
16815
|
-
"
|
|
16816
|
-
"
|
|
16817
|
-
"
|
|
16818
|
-
"
|
|
16819
|
-
"
|
|
16806
|
+
" secapi health",
|
|
16807
|
+
" secapi me",
|
|
16808
|
+
" secapi org show",
|
|
16809
|
+
" secapi billing show",
|
|
16810
|
+
" secapi dashboard overview",
|
|
16811
|
+
" secapi billing quote --meter-class section_extract --units 10",
|
|
16812
|
+
" secapi billing budget --spend-cap-cents 900 --soft-cap-cents 500 --approval-threshold-cents 750",
|
|
16813
|
+
" secapi billing checkout --plan personal",
|
|
16814
|
+
" secapi billing portal",
|
|
16815
|
+
" secapi agent bootstrap-token --label ci --scopes read:sec --ttl-seconds 900",
|
|
16816
|
+
" secapi agent bootstrap --token agbt_... --label first-agent-key",
|
|
16820
16817
|
"",
|
|
16821
16818
|
" # Agent prompt library",
|
|
16822
|
-
"
|
|
16823
|
-
"
|
|
16824
|
-
"
|
|
16825
|
-
"
|
|
16826
|
-
"
|
|
16827
|
-
"
|
|
16828
|
-
"
|
|
16829
|
-
"
|
|
16830
|
-
" SECAPI_API_KEY=...
|
|
16831
|
-
" SECAPI_OPERATOR_API_KEY=...
|
|
16832
|
-
|
|
16833
|
-
|
|
16834
|
-
"
|
|
16835
|
-
"
|
|
16836
|
-
"
|
|
16837
|
-
"
|
|
16838
|
-
"
|
|
16839
|
-
"
|
|
16840
|
-
"
|
|
16841
|
-
"
|
|
16842
|
-
"
|
|
16843
|
-
"
|
|
16844
|
-
"
|
|
16845
|
-
"
|
|
16846
|
-
"
|
|
16847
|
-
"
|
|
16848
|
-
"
|
|
16849
|
-
"
|
|
16850
|
-
"
|
|
16851
|
-
"
|
|
16852
|
-
"
|
|
16853
|
-
"
|
|
16854
|
-
"
|
|
16855
|
-
"
|
|
16856
|
-
"
|
|
16857
|
-
"
|
|
16858
|
-
"
|
|
16859
|
-
"
|
|
16860
|
-
"
|
|
16861
|
-
"
|
|
16862
|
-
"
|
|
16863
|
-
"
|
|
16864
|
-
"
|
|
16865
|
-
"
|
|
16866
|
-
"
|
|
16867
|
-
"
|
|
16868
|
-
" omni-sec compensation compare --ticker AAPL --limit 10",
|
|
16819
|
+
" secapi agents personas",
|
|
16820
|
+
" secapi agents prompts list",
|
|
16821
|
+
" secapi agents prompts list --persona law-firm",
|
|
16822
|
+
" secapi agents prompts list --persona investment-manager --json",
|
|
16823
|
+
" secapi agents prompts list --include-v2",
|
|
16824
|
+
" secapi agents prompts read law-firm-enforcement-history",
|
|
16825
|
+
" secapi agents prompts copy investment-manager-factor-decomposition | pbcopy",
|
|
16826
|
+
" secapi api-keys list",
|
|
16827
|
+
" SECAPI_API_KEY=... secapi api-keys list",
|
|
16828
|
+
" SECAPI_OPERATOR_API_KEY=... secapi admin orgs --limit 20",
|
|
16829
|
+
` printf '%s' "$SECAPI_API_KEY" | secapi api-keys list ${STDIN_FLAG_NAME}`,
|
|
16830
|
+
" secapi usage show",
|
|
16831
|
+
" secapi limits show",
|
|
16832
|
+
" secapi events list --kind event --limit 10",
|
|
16833
|
+
" secapi events export --kind webhook_delivery --format json",
|
|
16834
|
+
" secapi diagnostics request --request-id req_...",
|
|
16835
|
+
" secapi diagnostics deliveries-summary --limit 50",
|
|
16836
|
+
" secapi admin orgs --limit 20",
|
|
16837
|
+
" secapi admin org --org-id org_...",
|
|
16838
|
+
" secapi admin request --org-id org_... --request-id req_...",
|
|
16839
|
+
" secapi admin deliveries-summary --org-id org_... --limit 20",
|
|
16840
|
+
" secapi observability show",
|
|
16841
|
+
" secapi observability export --limit 20",
|
|
16842
|
+
" secapi api-keys create --label local-dev --scopes read:sec,write:artifacts",
|
|
16843
|
+
" secapi webhooks list",
|
|
16844
|
+
" secapi webhooks create --destination-url https://example.com/hooks/sec --event-types artifact.created,artifact.reconciled",
|
|
16845
|
+
" secapi webhooks rotate-secret --webhook-id wh_...",
|
|
16846
|
+
" secapi webhooks deliveries --webhook-id wh_... --limit 10",
|
|
16847
|
+
" secapi webhooks replay-delivery --webhook-id wh_... --delivery-id wdel_...",
|
|
16848
|
+
" secapi streams list",
|
|
16849
|
+
" secapi streams create --event-types artifact.created,artifact.reconciled --transport poll",
|
|
16850
|
+
" secapi streams events --stream-id strm_... --limit 10",
|
|
16851
|
+
" secapi entities resolve --ticker AAPL",
|
|
16852
|
+
" secapi filings search --ticker AAPL --form 10-K",
|
|
16853
|
+
" secapi filings search --q risk factors --form 10-K",
|
|
16854
|
+
" secapi filings latest --ticker AAPL --form 10-K",
|
|
16855
|
+
" secapi filings render --ticker AAPL --form 10-K",
|
|
16856
|
+
" secapi sections search --ticker AAPL --q risk --form 10-K",
|
|
16857
|
+
" secapi sections get --ticker AAPL --form 10-K --section item_1a",
|
|
16858
|
+
" secapi facts get --ticker AAPL --tag Assets --form 10-K",
|
|
16859
|
+
" secapi statements get --ticker AAPL --statement balance_sheet --period annual",
|
|
16860
|
+
" secapi owners 13f --cik 0001067983 --limit 25 [--view agent]",
|
|
16861
|
+
" secapi owners compare-13f --cik 0001067983 --limit 25",
|
|
16862
|
+
" secapi insiders list --ticker AAPL --limit 10 [--view agent]",
|
|
16863
|
+
" secapi compensation list --ticker AAPL --limit 10 [--view agent]",
|
|
16864
|
+
" secapi compensation compare --ticker AAPL --limit 10",
|
|
16869
16865
|
"",
|
|
16870
16866
|
" # Agent-mode endpoints (add --view agent for compact shape)",
|
|
16871
|
-
"
|
|
16872
|
-
"
|
|
16873
|
-
"
|
|
16874
|
-
"
|
|
16875
|
-
"
|
|
16876
|
-
"
|
|
16877
|
-
"
|
|
16867
|
+
" secapi forms 144 --ticker AAPL --limit 10 [--view agent]",
|
|
16868
|
+
" secapi offerings list --ticker NVDA --limit 10 [--view agent]",
|
|
16869
|
+
" secapi events ma --ticker MSFT --limit 10 [--view agent]",
|
|
16870
|
+
" secapi events enforcement --query fraud --limit 10 [--view agent]",
|
|
16871
|
+
" secapi events voting-results --ticker MSFT --limit 10 [--view agent]",
|
|
16872
|
+
" secapi funds nport-holdings --ticker VTI --limit 25 [--view agent]",
|
|
16873
|
+
" secapi companies subsidiaries --ticker AAPL [--view agent]",
|
|
16878
16874
|
"",
|
|
16879
16875
|
" # Dilution endpoints — all support --view agent except `coverage`",
|
|
16880
|
-
"
|
|
16881
|
-
"
|
|
16882
|
-
"
|
|
16883
|
-
"
|
|
16884
|
-
"
|
|
16885
|
-
"
|
|
16886
|
-
"
|
|
16887
|
-
"
|
|
16888
|
-
"
|
|
16889
|
-
"
|
|
16890
|
-
"
|
|
16891
|
-
"
|
|
16892
|
-
"
|
|
16893
|
-
"
|
|
16894
|
-
"
|
|
16895
|
-
"
|
|
16896
|
-
"
|
|
16897
|
-
"
|
|
16898
|
-
"
|
|
16899
|
-
"
|
|
16876
|
+
" secapi dilution events --ticker BBBB --is-atm true --limit 10 [--view agent]",
|
|
16877
|
+
" secapi dilution event --event-id evt_... [--view agent]",
|
|
16878
|
+
" secapi dilution warrants --ticker BBBB --limit 10 [--view agent]",
|
|
16879
|
+
" secapi dilution convertibles --ticker BBBB --limit 10 [--view agent]",
|
|
16880
|
+
" secapi dilution rofr --ticker BBBB --limit 10 [--view agent]",
|
|
16881
|
+
" secapi dilution lockups --ticker BBBB --limit 10 [--view agent]",
|
|
16882
|
+
" secapi dilution cash-position --ticker BBBB --limit 5 [--view agent]",
|
|
16883
|
+
" secapi dilution corporate-actions --ticker BBBB --action-type reverse_split [--view agent]",
|
|
16884
|
+
" secapi dilution nasdaq-compliance --status active --limit 10 [--view agent]",
|
|
16885
|
+
" secapi dilution ratings --overall-risk high --limit 10 [--view agent]",
|
|
16886
|
+
" secapi dilution reverse-splits --ticker BBBB --limit 5 [--view agent]",
|
|
16887
|
+
" secapi dilution score --ticker BBBB [--view agent]",
|
|
16888
|
+
" secapi dilution share-float-history --ticker BBBB --limit 12 [--view agent]",
|
|
16889
|
+
" secapi dilution coverage [--ticker BBBB]",
|
|
16890
|
+
" secapi artifacts bundle --ticker AAPL --form 10-K --section item_1a",
|
|
16891
|
+
" secapi artifacts list --kind markdown_bundle --limit 10",
|
|
16892
|
+
" secapi artifacts summary",
|
|
16893
|
+
" secapi artifacts manifest --artifact-id art_...",
|
|
16894
|
+
" secapi artifacts export --artifact-id art_... --format json",
|
|
16895
|
+
" secapi artifacts reconcile --artifact-id art_...",
|
|
16900
16896
|
"",
|
|
16901
16897
|
" # Macro",
|
|
16902
|
-
"
|
|
16903
|
-
"
|
|
16904
|
-
"
|
|
16905
|
-
"
|
|
16906
|
-
"
|
|
16907
|
-
"
|
|
16898
|
+
" secapi macro high-signal-pack --country JP",
|
|
16899
|
+
" secapi macro regimes --country US --lookback 18m",
|
|
16900
|
+
" secapi macro indicators --country US --indicator GDP",
|
|
16901
|
+
" secapi macro releases --country US",
|
|
16902
|
+
" secapi macro calendar --country US --days 30",
|
|
16903
|
+
" secapi macro forecasts --country US",
|
|
16908
16904
|
"",
|
|
16909
16905
|
" # Factors",
|
|
16910
|
-
"
|
|
16911
|
-
"
|
|
16912
|
-
"
|
|
16913
|
-
"
|
|
16914
|
-
"
|
|
16915
|
-
"
|
|
16916
|
-
"
|
|
16917
|
-
"
|
|
16918
|
-
"
|
|
16906
|
+
" secapi factors catalog --category style",
|
|
16907
|
+
" secapi factors returns --keys MOMENTUM,VALUE --window 1m",
|
|
16908
|
+
" secapi factors returns-intraday --window 1m",
|
|
16909
|
+
" secapi factors dashboard --country US --category style --ticker AAPL",
|
|
16910
|
+
" secapi factors screen --category style --limit 10",
|
|
16911
|
+
" secapi factors decomposition --ticker AAPL",
|
|
16912
|
+
" secapi factors related-stocks --ticker AAPL --limit 10",
|
|
16913
|
+
" secapi factors correlations --keys MOMENTUM,VALUE",
|
|
16914
|
+
" secapi factors regime-performance --country US",
|
|
16919
16915
|
"",
|
|
16920
16916
|
" # Stocks",
|
|
16921
|
-
"
|
|
16917
|
+
" secapi stocks loadings --ticker AAPL",
|
|
16922
16918
|
"",
|
|
16923
16919
|
" # Model Portfolios",
|
|
16924
|
-
"
|
|
16920
|
+
" secapi model-portfolios factor-view --portfolio-id us_megacap_platforms",
|
|
16925
16921
|
"",
|
|
16926
16922
|
" # Intelligence",
|
|
16927
|
-
"
|
|
16928
|
-
"
|
|
16929
|
-
"
|
|
16930
|
-
"
|
|
16923
|
+
" secapi intelligence security --ticker AAPL",
|
|
16924
|
+
" secapi intelligence company --ticker AAPL",
|
|
16925
|
+
" secapi intelligence earnings-preview --ticker AAPL",
|
|
16926
|
+
" secapi intelligence footnotes-query --ticker AAPL --topics lease,debt_covenant",
|
|
16931
16927
|
"",
|
|
16932
16928
|
" # Companies (canonical financials)",
|
|
16933
|
-
"
|
|
16934
|
-
"
|
|
16935
|
-
"
|
|
16936
|
-
"
|
|
16937
|
-
"
|
|
16938
|
-
"
|
|
16939
|
-
"
|
|
16940
|
-
"
|
|
16929
|
+
" secapi companies financials --ticker AAPL --period annual",
|
|
16930
|
+
" secapi companies ratios --ticker AAPL --period annual",
|
|
16931
|
+
" secapi companies income-statements --ticker AAPL",
|
|
16932
|
+
" secapi companies balance-sheets --ticker AAPL",
|
|
16933
|
+
" secapi companies cash-flow-statements --ticker AAPL",
|
|
16934
|
+
" secapi companies resolve --ticker AAPL",
|
|
16935
|
+
" secapi companies resolve --figi BBG000B9XRY4",
|
|
16936
|
+
" secapi companies search --q Apple --limit 5",
|
|
16941
16937
|
"",
|
|
16942
16938
|
"Environment:",
|
|
16943
|
-
" Preferred: SECAPI_API_KEY, SECAPI_BEARER_TOKEN, SECAPI_BASE_URL, SECAPI_API_BASE_URL, SECAPI_OPERATOR_API_KEY"
|
|
16944
|
-
" Compatibility fallbacks: OMNI_DATASTREAM_API_KEY, OMNI_DATASTREAM_BEARER_TOKEN, OMNI_DATASTREAM_BASE_URL, OMNI_OPERATOR_API_KEY, OMNI_DATASTREAM_OPERATOR_API_KEY"
|
|
16939
|
+
" Preferred: SECAPI_API_KEY, SECAPI_BEARER_TOKEN, SECAPI_BASE_URL, SECAPI_API_BASE_URL, SECAPI_OPERATOR_API_KEY"
|
|
16945
16940
|
];
|
|
16946
|
-
console.log(commandHelpLines.map((line) => line
|
|
16941
|
+
console.log(commandHelpLines.map((line) => line).join(`
|
|
16947
16942
|
`));
|
|
16948
16943
|
}
|
|
16949
16944
|
main().catch((error) => {
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@secapi/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "SEC API CLI for SEC data shaped for investors and agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"secapi": "dist/index.js"
|
|
8
|
-
"omni-sec": "dist/index.js"
|
|
7
|
+
"secapi": "dist/index.js"
|
|
9
8
|
},
|
|
10
9
|
"files": [
|
|
11
10
|
"dist"
|
|
@@ -27,10 +26,13 @@
|
|
|
27
26
|
"mcp"
|
|
28
27
|
],
|
|
29
28
|
"license": "MIT",
|
|
29
|
+
"homepage": "https://secapi.ai/developers",
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://docs.secapi.ai/support"
|
|
32
|
+
},
|
|
30
33
|
"repository": {
|
|
31
34
|
"type": "git",
|
|
32
|
-
"url": "https://github.com/
|
|
33
|
-
"directory": "packages/cli"
|
|
35
|
+
"url": "git+https://github.com/secapi-ai/secapi-cli.git"
|
|
34
36
|
},
|
|
35
37
|
"publishConfig": {
|
|
36
38
|
"access": "public"
|