ispbills-icli 6.1.0 → 6.1.1

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 CHANGED
@@ -93,6 +93,7 @@ icli --reasoning "audit the config on olt#1" # stream reasoning inline
93
93
  | `icli logout` | Log out and clear saved credentials |
94
94
  | `icli update` | Update iCli to the latest version |
95
95
  | `icli whoami` | Show current login info |
96
+ | `icli --version` | Show the installed iCli version |
96
97
  | `icli --help` | Show help |
97
98
 
98
99
  ### Flags
@@ -101,6 +102,10 @@ icli --reasoning "audit the config on olt#1" # stream reasoning inline
101
102
  |---|---|
102
103
  | `--reasoning` | Stream the model's reasoning inline |
103
104
  | `--loader-style STYLE` | Thinking indicator: `spinner` (default), `gradient`, or `minimal` |
105
+ | `--ascii` | Force ASCII-safe glyphs (use if symbols show as boxes) |
106
+ | `--unicode` | Force full Unicode glyphs |
107
+
108
+ > On classic Windows `cmd.exe` iCli auto-switches to ASCII-safe symbols. If it guesses wrong, force it with `icli --ascii` (or set the `ICLI_ASCII=1` environment variable). For the full Unicode look, use **Windows Terminal** or pass `--unicode`.
104
109
 
105
110
  ### Slash commands & keys (REPL)
106
111
 
package/bin/icli.js CHANGED
@@ -48,6 +48,11 @@ for (let i = 0; i < rawArgs.length; i++) {
48
48
 
49
49
  const cmd = positional[0] ?? '';
50
50
 
51
+ // Glyph overrides — set the env vars the (lazy) glyph resolver in ui.js reads,
52
+ // before anything is rendered. Useful when auto-detection guesses wrong.
53
+ if (has('--ascii')) process.env.ICLI_ASCII = '1';
54
+ if (has('--unicode')) process.env.ICLI_UNICODE = '1';
55
+
51
56
  const display = {
52
57
  reasoning: has('--reasoning'),
53
58
  loader: {
@@ -98,6 +103,7 @@ function printHelp() {
98
103
  ['icli logout', 'Log out and clear saved credentials'],
99
104
  ['icli update', 'Update iCli to the latest version'],
100
105
  ['icli whoami', 'Show current session info'],
106
+ ['icli --version', 'Show the installed iCli version'],
101
107
  ['icli --help', 'Show this help'],
102
108
  ].forEach(([c, d]) => console.log(` ${ACCENT}${c.padEnd(20)}${RESET}${DIM}${d}${RESET}`));
103
109
 
@@ -105,6 +111,8 @@ function printHelp() {
105
111
  [
106
112
  ['--reasoning', 'Stream the model\'s reasoning inline'],
107
113
  ['--loader-style STYLE', 'spinner | gradient | minimal'],
114
+ ['--ascii', 'Force ASCII-safe glyphs (classic Windows cmd.exe)'],
115
+ ['--unicode', 'Force full Unicode glyphs'],
108
116
  ].forEach(([c, d]) => console.log(` ${ACCENT}${c.padEnd(24)}${RESET}${DIM}${d}${RESET}`));
109
117
 
110
118
  console.log(`\n ${BOLD}Slash commands${RESET}`);
@@ -260,7 +268,8 @@ async function interactiveRepl(cfg) {
260
268
 
261
269
  // ── Main ─────────────────────────────────────────────────────────────────────────
262
270
  async function main() {
263
- if (cmd === '--help' || cmd === '-h' || cmd === 'help') { printHelp(); return; }
271
+ if (has('--help') || has('-h') || cmd === 'help') { printHelp(); return; }
272
+ if (has('--version') || has('-v') || cmd === 'version') { console.log(pkgVersion()); return; }
264
273
 
265
274
  if (cmd === 'login') {
266
275
  const cfg = await loginFlow();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ispbills-icli",
3
- "version": "6.1.0",
3
+ "version": "6.1.1",
4
4
  "description": "iCli — IspBills AI network engineer in your terminal",
5
5
  "keywords": [
6
6
  "ispbills",
package/src/loader.js CHANGED
@@ -1,6 +1,4 @@
1
- import { DIM, RESET, SPINNER } from './ui.js';
2
-
3
- const SPINNER_FRAMES = SPINNER;
1
+ import { DIM, RESET, getSpinner } from './ui.js';
4
2
 
5
3
  const GRADIENT_COLORS = [
6
4
  '\x1b[38;5;240m',
@@ -68,7 +66,8 @@ export class Loader {
68
66
  }
69
67
  case 'spinner':
70
68
  default: {
71
- const char = SPINNER_FRAMES[this.frame % SPINNER_FRAMES.length];
69
+ const frames = getSpinner();
70
+ const char = frames[this.frame % frames.length];
72
71
  process.stdout.write(`\r ${DIM}${char} ${text}…${RESET}`);
73
72
  break;
74
73
  }
package/src/ui.js CHANGED
@@ -57,27 +57,45 @@ export function rule(color = GRAY) {
57
57
  // Classic Windows consoles (cmd.exe / legacy PowerShell using the Consolas or
58
58
  // raster font) lack many Unicode dingbats, geometric shapes, arrows, braille
59
59
  // and emoji — they render as "tofu" boxes. Windows Terminal sets WT_SESSION,
60
- // so we only fall back to ASCII on a classic Windows console.
61
- const ASCII_SAFE = process.platform === 'win32' && !process.env.WT_SESSION;
62
-
63
- export const glyphs = ASCII_SAFE
64
- ? {
65
- prompt: '>', bullet: '-', diamond: '*', ring: '*', target: 'o',
66
- arrow: '->', down: 'v', check: 'OK', cross: 'XX', warn: '!!',
67
- bolt: '!', block: 'X', plug: '>>', reasoning: '~',
68
- branchMid: '|-', branchEnd: '`-', vbar: '|',
69
- }
70
- : {
71
- prompt: '❯', bullet: '·', diamond: '◆', ring: '◈', target: '◎',
72
- arrow: '⇢', down: '↓', check: '✓', cross: '✗', warn: '⚠',
73
- bolt: '⚡', block: '⛔', plug: '🔌', reasoning: '◆',
74
- branchMid: '├─', branchEnd: '└─', vbar: '│',
75
- };
60
+ // so we fall back to ASCII on a classic Windows console. This can be forced
61
+ // either way with the ICLI_ASCII / ICLI_UNICODE env vars (or --ascii/--unicode).
62
+ //
63
+ // Selection is evaluated lazily (per access) so the CLI can set the env vars
64
+ // from command-line flags before the first glyph is rendered.
65
+ function truthy(v) {
66
+ return v === '1' || v === 'true' || v === 'yes' || v === 'on';
67
+ }
68
+ export function asciiSafe() {
69
+ if (truthy(process.env.ICLI_UNICODE)) return false;
70
+ if (truthy(process.env.ICLI_ASCII)) return true;
71
+ return process.platform === 'win32' && !process.env.WT_SESSION;
72
+ }
73
+
74
+ const ASCII_GLYPHS = {
75
+ prompt: '>', bullet: '-', diamond: '*', ring: '*', target: 'o',
76
+ arrow: '->', down: 'v', check: 'OK', cross: 'XX', warn: '!!',
77
+ bolt: '!', block: 'X', plug: '>>', reasoning: '~',
78
+ branchMid: '|-', branchEnd: '`-', vbar: '|',
79
+ };
80
+ const UNICODE_GLYPHS = {
81
+ prompt: '❯', bullet: '·', diamond: '◆', ring: '◈', target: '◎',
82
+ arrow: '⇢', down: '↓', check: '✓', cross: '✗', warn: '⚠',
83
+ bolt: '⚡', block: '⛔', plug: '🔌', reasoning: '◆',
84
+ branchMid: '├─', branchEnd: '└─', vbar: '│',
85
+ };
86
+
87
+ // Proxy resolves each glyph at access time, honouring runtime env overrides.
88
+ export const glyphs = new Proxy({}, {
89
+ get: (_t, key) => (asciiSafe() ? ASCII_GLYPHS : UNICODE_GLYPHS)[key],
90
+ });
91
+
92
+ const ASCII_SPINNER = ['|', '/', '-', '\\'];
93
+ const UNICODE_SPINNER = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
76
94
 
77
95
  /** Spinner frames — braille on modern terminals, ASCII on classic Windows. */
78
- export const SPINNER = ASCII_SAFE
79
- ? ['|', '/', '-', '\\']
80
- : ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
96
+ export function getSpinner() {
97
+ return asciiSafe() ? ASCII_SPINNER : UNICODE_SPINNER;
98
+ }
81
99
 
82
100
  /** Print a full-width horizontal rule (dim by default). */
83
101
  export function hr(color = GRAY) {