@aisa-one/cli 0.1.4 → 0.1.6
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/README.md +28 -30
- package/dist/commands/finance.js +57 -18
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/index.js +19 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -60,16 +60,15 @@ aisa models show gpt-4.1 # model details + pricing
|
|
|
60
60
|
### API Discovery & Execution
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
|
-
aisa api list #
|
|
64
|
-
aisa api
|
|
65
|
-
aisa api
|
|
66
|
-
aisa api
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
aisa run finance /stock/price -q "symbol=AAPL"
|
|
63
|
+
aisa api list # 🚧 WIP — not yet available
|
|
64
|
+
aisa api search "email finder" # 🚧 WIP
|
|
65
|
+
aisa api show finance /stock/price # 🚧 WIP
|
|
66
|
+
aisa api code finance /stock/price --lang python # 🚧 WIP
|
|
67
|
+
|
|
68
|
+
# Execute any API (works now)
|
|
69
|
+
aisa run financial /insider-trades -q "ticker=AAPL"
|
|
71
70
|
aisa run tavily /search -d '{"query": "AI news"}'
|
|
72
|
-
aisa run twitter /tweet/
|
|
71
|
+
aisa run twitter /tweet/advanced_search -q "query=AI agents" --raw
|
|
73
72
|
```
|
|
74
73
|
|
|
75
74
|
### Web Search
|
|
@@ -85,11 +84,13 @@ aisa scholar "transformer architecture" # academic papers
|
|
|
85
84
|
### Finance
|
|
86
85
|
|
|
87
86
|
```bash
|
|
88
|
-
aisa stock AAPL #
|
|
89
|
-
aisa stock
|
|
87
|
+
aisa stock AAPL # summary: company info + estimates + news
|
|
88
|
+
aisa stock AAPL --field insider # insider trades
|
|
89
|
+
aisa stock AAPL --field news # company news
|
|
90
90
|
aisa stock TSLA --field filings # SEC filings
|
|
91
|
-
aisa stock
|
|
92
|
-
aisa
|
|
91
|
+
aisa stock MSFT --field estimates # analyst EPS & revenue estimates
|
|
92
|
+
aisa stock AAPL --field financials # balance sheets, income statements
|
|
93
|
+
aisa crypto BTC # crypto price snapshot
|
|
93
94
|
aisa crypto ETH --period 30d # historical
|
|
94
95
|
aisa screener --sector Technology # stock screener
|
|
95
96
|
```
|
|
@@ -97,11 +98,10 @@ aisa screener --sector Technology # stock screener
|
|
|
97
98
|
### Twitter/X
|
|
98
99
|
|
|
99
100
|
```bash
|
|
100
|
-
aisa tweet "Hello world!" # post a tweet
|
|
101
|
-
aisa tweet "Reply" --reply-to 123456 # reply
|
|
102
|
-
aisa twitter search "AI agents" --limit 20 # search tweets
|
|
103
101
|
aisa twitter user elonmusk # user profile
|
|
102
|
+
aisa twitter search "AI agents" --limit 20 # search tweets
|
|
104
103
|
aisa twitter trends # trending topics
|
|
104
|
+
aisa tweet "Hello world!" # post (⚠️ requires login cookies, see docs)
|
|
105
105
|
```
|
|
106
106
|
|
|
107
107
|
### Video Generation
|
|
@@ -115,9 +115,8 @@ aisa video status <task-id> # check status
|
|
|
115
115
|
### Account
|
|
116
116
|
|
|
117
117
|
```bash
|
|
118
|
-
aisa balance #
|
|
119
|
-
aisa usage --limit 20 #
|
|
120
|
-
aisa usage --days 7 # last 7 days
|
|
118
|
+
aisa balance # 🚧 WIP — check https://aisa.one/dashboard
|
|
119
|
+
aisa usage --limit 20 # 🚧 WIP
|
|
121
120
|
```
|
|
122
121
|
|
|
123
122
|
## Skills
|
|
@@ -127,12 +126,11 @@ Skills are markdown files that teach AI coding agents (Claude Code, Cursor, Copi
|
|
|
127
126
|
### Browse & Install
|
|
128
127
|
|
|
129
128
|
```bash
|
|
130
|
-
aisa skills list #
|
|
131
|
-
aisa skills search "financial analysis" #
|
|
132
|
-
aisa skills show aisa-team/finance-analyst #
|
|
133
|
-
aisa skills add aisa-team/finance-analyst #
|
|
134
|
-
aisa skills
|
|
135
|
-
aisa skills remove aisa-team/finance-analyst # uninstall
|
|
129
|
+
aisa skills list # 🚧 WIP — requires backend
|
|
130
|
+
aisa skills search "financial analysis" # 🚧 WIP
|
|
131
|
+
aisa skills show aisa-team/finance-analyst # 🚧 WIP
|
|
132
|
+
aisa skills add aisa-team/finance-analyst # 🚧 WIP
|
|
133
|
+
aisa skills remove aisa-team/finance-analyst # 🚧 WIP
|
|
136
134
|
```
|
|
137
135
|
|
|
138
136
|
Skills install to agent directories automatically:
|
|
@@ -150,12 +148,12 @@ Skills install to agent directories automatically:
|
|
|
150
148
|
### Create & Publish
|
|
151
149
|
|
|
152
150
|
```bash
|
|
153
|
-
aisa skills init my-skill # create from default template
|
|
151
|
+
aisa skills init my-skill # create from default template (works locally)
|
|
154
152
|
aisa skills init my-skill --template finance # finance template
|
|
155
153
|
aisa skills init my-skill --template llm # LLM template
|
|
156
|
-
aisa skills submit ./my-skill #
|
|
157
|
-
aisa skills push owner/my-skill #
|
|
158
|
-
aisa skills request-verification owner/my-skill #
|
|
154
|
+
aisa skills submit ./my-skill # 🚧 WIP — requires backend
|
|
155
|
+
aisa skills push owner/my-skill # 🚧 WIP
|
|
156
|
+
aisa skills request-verification owner/my-skill # 🚧 WIP
|
|
159
157
|
```
|
|
160
158
|
|
|
161
159
|
Available templates: `default`, `llm`, `search`, `finance`, `twitter`, `video`
|
|
@@ -218,7 +216,7 @@ The `domain: true` option in `RequestOptions` (see `src/api.ts`) selects which b
|
|
|
218
216
|
|
|
219
217
|
**Models API follows OpenAI format.** The `/v1/models` endpoint returns `owned_by` (not `provider`) and has no `name`, `pricing`, or `contextWindow` fields.
|
|
220
218
|
|
|
221
|
-
**Some financial endpoints return empty data.** `financial/prices` and `financial/financial-metrics/snapshot`
|
|
219
|
+
**Some financial endpoints return empty data.** `financial/prices` and `financial/financial-metrics/snapshot` return `{}` for all tickers (backend issue). The default `aisa stock` now fetches `company/facts` + `analyst-estimates` + `news` instead. Working fields: `info`, `estimates`, `financials`, `filings`, `insider`, `institutional`, `news`.
|
|
222
220
|
|
|
223
221
|
## License
|
|
224
222
|
|
package/dist/commands/finance.js
CHANGED
|
@@ -1,40 +1,79 @@
|
|
|
1
1
|
import ora from "ora";
|
|
2
|
+
import chalk from "chalk";
|
|
2
3
|
import { requireApiKey } from "../config.js";
|
|
3
4
|
import { apiRequest } from "../api.js";
|
|
4
5
|
import { error, formatJson } from "../utils/display.js";
|
|
5
6
|
const FIELD_ENDPOINTS = {
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
info: "financial/company/facts",
|
|
8
|
+
estimates: "financial/analyst-estimates",
|
|
8
9
|
financials: "financial/financials",
|
|
9
10
|
filings: "financial/filings",
|
|
10
11
|
insider: "financial/insider-trades",
|
|
11
12
|
institutional: "financial/institutional-ownership",
|
|
12
|
-
metrics: "financial/financial-metrics/snapshot",
|
|
13
13
|
news: "financial/news",
|
|
14
14
|
};
|
|
15
15
|
export async function stockAction(symbol, options) {
|
|
16
16
|
const key = requireApiKey();
|
|
17
|
-
const field = options.field || "
|
|
17
|
+
const field = options.field || "info";
|
|
18
|
+
const ticker = symbol.toUpperCase();
|
|
19
|
+
// Default: show a summary of company info + estimates + news
|
|
20
|
+
if (!options.field) {
|
|
21
|
+
const spinner = ora(`Fetching ${ticker}...`).start();
|
|
22
|
+
const [infoRes, estRes, newsRes] = await Promise.all([
|
|
23
|
+
apiRequest(key, "financial/company/facts", { query: { ticker }, domain: true }),
|
|
24
|
+
apiRequest(key, "financial/analyst-estimates", { query: { ticker }, domain: true }),
|
|
25
|
+
apiRequest(key, "financial/news", { query: { ticker, limit: "3" }, domain: true }),
|
|
26
|
+
]);
|
|
27
|
+
spinner.stop();
|
|
28
|
+
if (options.raw) {
|
|
29
|
+
console.log(JSON.stringify({ info: infoRes.data, estimates: estRes.data, news: newsRes.data }));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
// Company info
|
|
33
|
+
const facts = infoRes.data?.company_facts;
|
|
34
|
+
if (facts) {
|
|
35
|
+
console.log(`\n ${chalk.cyan.bold(facts.name || ticker)} ${chalk.gray(`(${facts.ticker || ticker})`)}`);
|
|
36
|
+
const details = [facts.exchange, facts.sector, facts.industry].filter(Boolean).join(" · ");
|
|
37
|
+
if (details)
|
|
38
|
+
console.log(` ${chalk.gray(details)}`);
|
|
39
|
+
if (facts.location)
|
|
40
|
+
console.log(` ${chalk.gray(facts.location)}`);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
console.log(`\n ${chalk.cyan.bold(ticker)}`);
|
|
44
|
+
}
|
|
45
|
+
// Analyst estimates
|
|
46
|
+
const estimates = estRes.data?.analyst_estimates;
|
|
47
|
+
if (estimates && estimates.length > 0) {
|
|
48
|
+
console.log(`\n ${chalk.white.bold("Analyst Estimates")}`);
|
|
49
|
+
for (const e of estimates.slice(0, 3)) {
|
|
50
|
+
const period = e.fiscal_period?.split("T")[0] || e.period || "";
|
|
51
|
+
const eps = e.earnings_per_share != null ? `EPS $${e.earnings_per_share.toFixed(2)}` : "";
|
|
52
|
+
const rev = e.revenue != null ? `Rev $${(e.revenue / 1e9).toFixed(1)}B` : "";
|
|
53
|
+
console.log(` ${chalk.gray(period)} ${eps} ${rev}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// Latest news
|
|
57
|
+
const news = newsRes.data?.news;
|
|
58
|
+
if (news && news.length > 0) {
|
|
59
|
+
console.log(`\n ${chalk.white.bold("Latest News")}`);
|
|
60
|
+
for (const n of news) {
|
|
61
|
+
const date = n.date ? new Date(n.date).toLocaleDateString() : "";
|
|
62
|
+
console.log(` ${chalk.gray(date)} ${n.title}`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
console.log();
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
// Specific field
|
|
18
69
|
const endpoint = FIELD_ENDPOINTS[field];
|
|
19
70
|
if (!endpoint) {
|
|
20
71
|
error(`Unknown field: ${field}. Valid: ${Object.keys(FIELD_ENDPOINTS).join(", ")}`);
|
|
21
72
|
return;
|
|
22
73
|
}
|
|
23
|
-
const spinner = ora(`Fetching ${field} for ${
|
|
24
|
-
const query = { ticker: symbol.toUpperCase() };
|
|
25
|
-
// Price endpoint needs additional params for sensible defaults
|
|
26
|
-
if (field === "price") {
|
|
27
|
-
const end = new Date();
|
|
28
|
-
const start = new Date();
|
|
29
|
-
start.setDate(start.getDate() - 30);
|
|
30
|
-
query.interval = "day";
|
|
31
|
-
query.interval_multiplier = "1";
|
|
32
|
-
query.start_date = start.toISOString().split("T")[0];
|
|
33
|
-
query.end_date = end.toISOString().split("T")[0];
|
|
34
|
-
query.limit = "30";
|
|
35
|
-
}
|
|
74
|
+
const spinner = ora(`Fetching ${field} for ${ticker}...`).start();
|
|
36
75
|
const res = await apiRequest(key, endpoint, {
|
|
37
|
-
query,
|
|
76
|
+
query: { ticker },
|
|
38
77
|
domain: true,
|
|
39
78
|
});
|
|
40
79
|
if (!res.success) {
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.6";
|
|
2
2
|
export declare const BASE_URL = "https://api.aisa.one";
|
|
3
3
|
export declare const CLI_BASE_URL = "https://api.aisa.one/v1";
|
|
4
4
|
export declare const APIS_BASE_URL = "https://api.aisa.one/apis/v1";
|
package/dist/constants.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -58,33 +58,33 @@ program
|
|
|
58
58
|
// ── Account ──
|
|
59
59
|
program
|
|
60
60
|
.command("balance")
|
|
61
|
-
.description("Show credit balance")
|
|
61
|
+
.description("Show credit balance (WIP)")
|
|
62
62
|
.action(wrap(balanceAction));
|
|
63
63
|
program
|
|
64
64
|
.command("usage")
|
|
65
|
-
.description("Show usage history")
|
|
65
|
+
.description("Show usage history (WIP)")
|
|
66
66
|
.option("--limit <n>", "Max records")
|
|
67
67
|
.option("--days <n>", "Lookback days")
|
|
68
68
|
.action(wrap(usageAction));
|
|
69
69
|
// ── API ──
|
|
70
|
-
const api = program.command("api").description("Discover and inspect APIs");
|
|
70
|
+
const api = program.command("api").description("Discover and inspect APIs (WIP)");
|
|
71
71
|
api
|
|
72
72
|
.command("list")
|
|
73
|
-
.description("List available API endpoints")
|
|
73
|
+
.description("List available API endpoints (WIP)")
|
|
74
74
|
.option("--category <cat>", "Filter by category (llm, search, finance, twitter, video, scholar)")
|
|
75
75
|
.action(wrap(apiListAction));
|
|
76
76
|
api
|
|
77
77
|
.command("search <query>")
|
|
78
|
-
.description("Search APIs by keyword")
|
|
78
|
+
.description("Search APIs by keyword (WIP)")
|
|
79
79
|
.option("--limit <n>", "Max results")
|
|
80
80
|
.action(wrap(apiSearchAction));
|
|
81
81
|
api
|
|
82
82
|
.command("show <slug> [path]")
|
|
83
|
-
.description("Show API endpoint details")
|
|
83
|
+
.description("Show API endpoint details (WIP)")
|
|
84
84
|
.action(wrap(apiShowAction));
|
|
85
85
|
api
|
|
86
86
|
.command("code <slug> <path>")
|
|
87
|
-
.description("Generate code snippet")
|
|
87
|
+
.description("Generate code snippet (WIP)")
|
|
88
88
|
.option("--lang <language>", "Language: typescript, python, curl", "typescript")
|
|
89
89
|
.action(wrap(apiCodeAction));
|
|
90
90
|
// ── Run ──
|
|
@@ -143,7 +143,7 @@ program
|
|
|
143
143
|
program
|
|
144
144
|
.command("stock <symbol>")
|
|
145
145
|
.description("Look up stock data")
|
|
146
|
-
.option("--field <field>", "Data field:
|
|
146
|
+
.option("--field <field>", "Data field: info, estimates, financials, filings, insider, institutional, news")
|
|
147
147
|
.option("--raw", "Raw JSON output")
|
|
148
148
|
.action(wrap(stockAction));
|
|
149
149
|
program
|
|
@@ -202,32 +202,32 @@ video
|
|
|
202
202
|
const skills = program.command("skills").description("Browse and manage agent skills");
|
|
203
203
|
skills
|
|
204
204
|
.command("list")
|
|
205
|
-
.description("List available skills")
|
|
205
|
+
.description("List available skills (WIP)")
|
|
206
206
|
.option("--category <cat>", "Filter by category")
|
|
207
207
|
.option("--limit <n>", "Max results")
|
|
208
208
|
.action(wrap(skillsListAction));
|
|
209
209
|
skills
|
|
210
210
|
.command("search <query>")
|
|
211
|
-
.description("Search skills")
|
|
211
|
+
.description("Search skills (WIP)")
|
|
212
212
|
.option("--limit <n>", "Max results")
|
|
213
213
|
.action(wrap(skillsSearchAction));
|
|
214
214
|
skills
|
|
215
215
|
.command("show <slug>")
|
|
216
|
-
.description("Show skill details")
|
|
216
|
+
.description("Show skill details (WIP)")
|
|
217
217
|
.action(wrap(skillsShowAction));
|
|
218
218
|
skills
|
|
219
219
|
.command("add <slug>")
|
|
220
|
-
.description("Install a skill to agent directories")
|
|
220
|
+
.description("Install a skill to agent directories (WIP)")
|
|
221
221
|
.option("--agent <agent>", "Target agent: claude, cursor, copilot, windsurf, codex, gemini, openclaw, all")
|
|
222
222
|
.action(wrap(skillsAddAction));
|
|
223
223
|
skills
|
|
224
224
|
.command("remove <slug>")
|
|
225
|
-
.description("Remove an installed skill")
|
|
225
|
+
.description("Remove an installed skill (WIP)")
|
|
226
226
|
.option("--agent <agent>", "Target agent")
|
|
227
227
|
.action(skillsRemoveAction);
|
|
228
228
|
skills
|
|
229
229
|
.command("update [slug]")
|
|
230
|
-
.description("Update installed skill(s)")
|
|
230
|
+
.description("Update installed skill(s) (WIP)")
|
|
231
231
|
.action(wrap(skillsUpdateAction));
|
|
232
232
|
skills
|
|
233
233
|
.command("init <name>")
|
|
@@ -237,15 +237,15 @@ skills
|
|
|
237
237
|
.action(skillsInitAction);
|
|
238
238
|
skills
|
|
239
239
|
.command("submit <path>")
|
|
240
|
-
.description("Submit a skill to AISA")
|
|
240
|
+
.description("Submit a skill to AISA (WIP)")
|
|
241
241
|
.action(wrap(skillsSubmitAction));
|
|
242
242
|
skills
|
|
243
243
|
.command("push <slug>")
|
|
244
|
-
.description("Push local changes to a submitted skill")
|
|
244
|
+
.description("Push local changes to a submitted skill (WIP)")
|
|
245
245
|
.action(wrap(skillsPushAction));
|
|
246
246
|
skills
|
|
247
247
|
.command("request-verification <slug>")
|
|
248
|
-
.description("Request skill verification")
|
|
248
|
+
.description("Request skill verification (WIP)")
|
|
249
249
|
.action(wrap(skillsVerifyAction));
|
|
250
250
|
// ── MCP ──
|
|
251
251
|
const mcp = program.command("mcp").description("MCP server integration");
|
|
@@ -279,12 +279,12 @@ configCmd
|
|
|
279
279
|
// ── Top-level aliases ──
|
|
280
280
|
program
|
|
281
281
|
.command("search <query>")
|
|
282
|
-
.description("Search APIs (alias for 'api search')")
|
|
282
|
+
.description("Search APIs (alias for 'api search') (WIP)")
|
|
283
283
|
.option("--limit <n>", "Max results")
|
|
284
284
|
.action(wrap(apiSearchAction));
|
|
285
285
|
program
|
|
286
286
|
.command("code <slug> <path>")
|
|
287
|
-
.description("Generate code (alias for 'api code')")
|
|
287
|
+
.description("Generate code (alias for 'api code') (WIP)")
|
|
288
288
|
.option("--lang <language>", "Language", "typescript")
|
|
289
289
|
.action(wrap(apiCodeAction));
|
|
290
290
|
// ── Parse ──
|
package/package.json
CHANGED