@iola_adm/iola-cli 0.1.3 → 0.1.4

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 +1 -0
  2. package/package.json +1 -1
  3. package/src/cli.js +28 -0
package/README.md CHANGED
@@ -74,6 +74,7 @@ iola help
74
74
  ## Команды
75
75
 
76
76
  ```bash
77
+ iola banner
77
78
  iola ai doctor
78
79
  iola ai setup ollama
79
80
  iola health
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iola_adm/iola-cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "CLI и AI-агент для работы с открытыми данными городского округа Йошкар-Ола.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/adm-iola/iola-cli#readme",
package/src/cli.js CHANGED
@@ -9,10 +9,24 @@ const API_BASE_URL = process.env.IOLA_API_BASE_URL || "https://apiiola.yasg.ru/a
9
9
  const MCP_BASE_URL = process.env.IOLA_MCP_BASE_URL || "https://apiiola.yasg.ru";
10
10
  const CONFIG_DIR = path.join(os.homedir(), ".iola");
11
11
  const CONFIG_FILE = path.join(CONFIG_DIR, "config.json");
12
+ const BANNER = `\x1b[38;5;45m┌────────────────────────────────────────────────────────────────────────────┐
13
+ │\x1b[38;5;51m ____ _ ___ ____ ____ ___ _____ _ _______ \x1b[38;5;45m│
14
+ │\x1b[38;5;51m / ___| | |_ _| | _ \\| _ \\ / _ \\| ____| |/ /_ _| \x1b[38;5;45m│
15
+ │\x1b[38;5;51m | | | | | |_____| |_) | |_) | | | | _| | ' / | | \x1b[38;5;45m│
16
+ │\x1b[38;5;51m | |___| |___ | |_____| __/| _ <| |_| | |___| . \\ | | \x1b[38;5;45m│
17
+ │\x1b[38;5;51m \\____|_____|___| |_| |_| \\_\\\\___/|_____|_|\\_\\ |_| \x1b[38;5;45m│
18
+ │ │
19
+ │\x1b[38;5;213m Й О Ш К А Р - О Л Ы \x1b[38;5;45m│
20
+ │ │
21
+ │\x1b[38;5;250m открытые данные • MCP • локальный AI \x1b[38;5;45m│
22
+ │ │
23
+ │\x1b[38;5;82m > iola help \x1b[38;5;45m│
24
+ └────────────────────────────────────────────────────────────────────────────┘\x1b[0m`;
12
25
 
13
26
  const COMMANDS = new Map([
14
27
  ["help", showHelp],
15
28
  ["version", showVersion],
29
+ ["banner", showBanner],
16
30
  ["ai", handleAi],
17
31
  ["health", checkHealth],
18
32
  ["layers", listLayers],
@@ -35,9 +49,11 @@ export async function main(argv) {
35
49
  }
36
50
 
37
51
  async function showHelp() {
52
+ showBanner();
38
53
  console.log(`iola - CLI для открытых данных городского округа "Город Йошкар-Ола"
39
54
 
40
55
  Usage:
56
+ iola banner
41
57
  iola ai doctor [--json]
42
58
  iola ai setup
43
59
  iola ai setup ollama [--yes] [--model MODEL]
@@ -58,6 +74,16 @@ Environment:
58
74
  `);
59
75
  }
60
76
 
77
+ function showBanner() {
78
+ if (process.stdout.isTTY && process.env.NO_COLOR !== "1") {
79
+ console.log(BANNER);
80
+ return;
81
+ }
82
+
83
+ console.log("CLI-ПРОЕКТ ЙОШКАР-ОЛЫ");
84
+ console.log("открытые данные • MCP • локальный AI");
85
+ }
86
+
61
87
  async function showVersion() {
62
88
  const packageJson = await import("../package.json", { with: { type: "json" } });
63
89
  console.log(packageJson.default.version);
@@ -84,6 +110,7 @@ async function handleAi(args) {
84
110
  const [subcommand = "help", ...rest] = args;
85
111
 
86
112
  if (subcommand === "help") {
113
+ showBanner();
87
114
  console.log(`AI-команды:
88
115
  iola ai doctor [--json]
89
116
  iola ai setup
@@ -123,6 +150,7 @@ async function aiSetup(args) {
123
150
  const [provider] = args;
124
151
 
125
152
  if (!provider) {
153
+ showBanner();
126
154
  const selected = await chooseAiProvider();
127
155
  await aiSetup([selected]);
128
156
  return;