enton-cli 0.1.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/README.md +188 -0
- package/bin/enton.js +34 -0
- package/dist/api/client.d.ts +61 -0
- package/dist/api/client.js +160 -0
- package/dist/commands/auth.d.ts +5 -0
- package/dist/commands/auth.js +156 -0
- package/dist/commands/config.d.ts +5 -0
- package/dist/commands/config.js +96 -0
- package/dist/commands/interactive.d.ts +7 -0
- package/dist/commands/interactive.js +143 -0
- package/dist/commands/query.d.ts +8 -0
- package/dist/commands/query.js +73 -0
- package/dist/commands/watch.d.ts +5 -0
- package/dist/commands/watch.js +98 -0
- package/dist/config/manager.d.ts +54 -0
- package/dist/config/manager.js +168 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +104 -0
- package/package.json +65 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* ENTON CLI - AI-powered financial assistant
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* enton # Interactive mode
|
|
8
|
+
* enton "query" # Direct query mode
|
|
9
|
+
* enton auth login # Authenticate with ENTON
|
|
10
|
+
* enton watch AAPL,TSLA # Watch mode for real-time prices
|
|
11
|
+
*/
|
|
12
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
+
};
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
const commander_1 = require("commander");
|
|
17
|
+
const interactive_1 = require("./commands/interactive");
|
|
18
|
+
const query_1 = require("./commands/query");
|
|
19
|
+
const auth_1 = require("./commands/auth");
|
|
20
|
+
const watch_1 = require("./commands/watch");
|
|
21
|
+
const config_1 = require("./commands/config");
|
|
22
|
+
const manager_1 = require("./config/manager");
|
|
23
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
24
|
+
const program = new commander_1.Command();
|
|
25
|
+
// ASCII art banner
|
|
26
|
+
const banner = `
|
|
27
|
+
${chalk_1.default.cyan('╔═══════════════════════════════════════════════════════════╗')}
|
|
28
|
+
${chalk_1.default.cyan('║')} ${chalk_1.default.bold.white('🏦 ENTON')} ${chalk_1.default.dim('- AI Finance Agent')} ${chalk_1.default.cyan('║')}
|
|
29
|
+
${chalk_1.default.cyan('╚═══════════════════════════════════════════════════════════╝')}
|
|
30
|
+
`;
|
|
31
|
+
program
|
|
32
|
+
.name('enton')
|
|
33
|
+
.description('AI-powered financial assistant - like Claude Code, but for finance')
|
|
34
|
+
.version('0.1.0')
|
|
35
|
+
.option('-j, --json', 'Output response as JSON')
|
|
36
|
+
.option('-q, --quiet', 'Minimal output (no banner)')
|
|
37
|
+
.argument('[query...]', 'Direct query to ENTON')
|
|
38
|
+
.action(async (queryParts, options) => {
|
|
39
|
+
// Check for authentication
|
|
40
|
+
const config = (0, manager_1.getConfig)();
|
|
41
|
+
if (!options.quiet) {
|
|
42
|
+
console.log(banner);
|
|
43
|
+
}
|
|
44
|
+
if (queryParts && queryParts.length > 0) {
|
|
45
|
+
// Direct query mode
|
|
46
|
+
const query = queryParts.join(' ');
|
|
47
|
+
await (0, query_1.queryCommand)(query, options);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
// Interactive mode
|
|
51
|
+
await (0, interactive_1.interactiveMode)(options);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
// Auth commands
|
|
55
|
+
program
|
|
56
|
+
.command('auth')
|
|
57
|
+
.description('Manage authentication')
|
|
58
|
+
.addCommand(new commander_1.Command('login')
|
|
59
|
+
.description('Login to ENTON')
|
|
60
|
+
.action(async () => {
|
|
61
|
+
await (0, auth_1.authCommand)('login');
|
|
62
|
+
}))
|
|
63
|
+
.addCommand(new commander_1.Command('logout')
|
|
64
|
+
.description('Logout from ENTON')
|
|
65
|
+
.action(async () => {
|
|
66
|
+
await (0, auth_1.authCommand)('logout');
|
|
67
|
+
}))
|
|
68
|
+
.addCommand(new commander_1.Command('status')
|
|
69
|
+
.description('Check authentication status')
|
|
70
|
+
.action(async () => {
|
|
71
|
+
await (0, auth_1.authCommand)('status');
|
|
72
|
+
}));
|
|
73
|
+
// Watch command
|
|
74
|
+
program
|
|
75
|
+
.command('watch <symbols>')
|
|
76
|
+
.description('Watch real-time prices for symbols')
|
|
77
|
+
.option('-i, --interval <seconds>', 'Refresh interval in seconds', '5')
|
|
78
|
+
.action(async (symbols, options) => {
|
|
79
|
+
await (0, watch_1.watchCommand)(symbols, parseInt(options.interval));
|
|
80
|
+
});
|
|
81
|
+
// Config commands
|
|
82
|
+
program
|
|
83
|
+
.command('config')
|
|
84
|
+
.description('Manage configuration')
|
|
85
|
+
.addCommand(new commander_1.Command('set')
|
|
86
|
+
.description('Set a config value')
|
|
87
|
+
.argument('<key>', 'Config key')
|
|
88
|
+
.argument('<value>', 'Config value')
|
|
89
|
+
.action(async (key, value) => {
|
|
90
|
+
await (0, config_1.configCommand)('set', key, value);
|
|
91
|
+
}))
|
|
92
|
+
.addCommand(new commander_1.Command('get')
|
|
93
|
+
.description('Get a config value')
|
|
94
|
+
.argument('<key>', 'Config key')
|
|
95
|
+
.action(async (key) => {
|
|
96
|
+
await (0, config_1.configCommand)('get', key);
|
|
97
|
+
}))
|
|
98
|
+
.addCommand(new commander_1.Command('list')
|
|
99
|
+
.description('List all config values')
|
|
100
|
+
.action(async () => {
|
|
101
|
+
await (0, config_1.configCommand)('list');
|
|
102
|
+
}));
|
|
103
|
+
// Parse and execute
|
|
104
|
+
program.parse(process.argv);
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "enton-cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "ENTON - AI-powered financial assistant CLI. Like Claude Code, but for finance.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"enton": "./bin/enton.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"bin",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc",
|
|
17
|
+
"dev": "tsx src/index.ts",
|
|
18
|
+
"start": "node dist/index.js",
|
|
19
|
+
"test": "echo \"No tests yet\" && exit 0",
|
|
20
|
+
"prepublishOnly": "npm run build"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"enton",
|
|
24
|
+
"finance",
|
|
25
|
+
"ai",
|
|
26
|
+
"trading",
|
|
27
|
+
"stocks",
|
|
28
|
+
"crypto",
|
|
29
|
+
"cli",
|
|
30
|
+
"terminal",
|
|
31
|
+
"agent",
|
|
32
|
+
"llm"
|
|
33
|
+
],
|
|
34
|
+
"author": "ENTON AI <hello@enton.ai>",
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "git+https://github.com/iyadhassan/enton.git",
|
|
39
|
+
"directory": "packages/enton-cli"
|
|
40
|
+
},
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/iyadhassan/enton/issues"
|
|
43
|
+
},
|
|
44
|
+
"homepage": "https://enton.ai/code",
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=18.0.0"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"chalk": "^5.3.0",
|
|
50
|
+
"commander": "^12.0.0",
|
|
51
|
+
"eventsource": "^2.0.2",
|
|
52
|
+
"inquirer": "^9.2.0",
|
|
53
|
+
"ora": "^8.0.0",
|
|
54
|
+
"cli-table3": "^0.6.4",
|
|
55
|
+
"open": "^10.1.0",
|
|
56
|
+
"axios": "^1.6.0"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@types/eventsource": "^1.1.15",
|
|
60
|
+
"@types/inquirer": "^9.0.7",
|
|
61
|
+
"@types/node": "^20.0.0",
|
|
62
|
+
"tsx": "^4.7.0",
|
|
63
|
+
"typescript": "^5.3.0"
|
|
64
|
+
}
|
|
65
|
+
}
|