@indiccoder/mentis-cli 1.1.1 → 1.1.2
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 +12 -2
- package/dist/repl/ReplManager.js +11 -1
- package/dist/ui/UIManager.js +2 -2
- package/package.json +1 -1
- package/src/index.ts +14 -2
- package/src/repl/ReplManager.ts +14 -1
- package/src/ui/UIManager.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -6,10 +6,12 @@ function parseArgs() {
|
|
|
6
6
|
const args = process.argv.slice(2);
|
|
7
7
|
const options = {
|
|
8
8
|
resume: false,
|
|
9
|
-
yolo: false
|
|
9
|
+
yolo: false,
|
|
10
|
+
headless: false
|
|
10
11
|
};
|
|
11
12
|
let command = null;
|
|
12
|
-
for (
|
|
13
|
+
for (let i = 0; i < args.length; i++) {
|
|
14
|
+
const arg = args[i];
|
|
13
15
|
switch (arg) {
|
|
14
16
|
case 'update':
|
|
15
17
|
command = 'update';
|
|
@@ -20,6 +22,11 @@ function parseArgs() {
|
|
|
20
22
|
case '--yolo':
|
|
21
23
|
options.yolo = true;
|
|
22
24
|
break;
|
|
25
|
+
case '-p':
|
|
26
|
+
case '--prompt':
|
|
27
|
+
options.headless = true;
|
|
28
|
+
options.headlessPrompt = args[++i] || '';
|
|
29
|
+
break;
|
|
23
30
|
case '-h':
|
|
24
31
|
case '--help':
|
|
25
32
|
console.log(`
|
|
@@ -30,14 +37,17 @@ Usage:
|
|
|
30
37
|
mentis update Update to latest version
|
|
31
38
|
mentis --resume Resume last session
|
|
32
39
|
mentis --yolo Auto-confirm mode (skip confirmations)
|
|
40
|
+
mentis -p "<prompt>" Headless mode (non-interactive)
|
|
33
41
|
|
|
34
42
|
Options:
|
|
35
43
|
--resume Load latest checkpoint on start
|
|
36
44
|
--yolo Skip all confirmation prompts
|
|
45
|
+
-p, --prompt <text> Headless mode with prompt
|
|
37
46
|
-h, --help Show this help message
|
|
38
47
|
|
|
39
48
|
Commands (in REPL):
|
|
40
49
|
/help Show all available commands
|
|
50
|
+
/clear Clear conversation context
|
|
41
51
|
/resume Resume last session
|
|
42
52
|
/init Initialize project with .mentis.md
|
|
43
53
|
/skills <list|show|create|validate> Manage Agent Skills
|
package/dist/repl/ReplManager.js
CHANGED
|
@@ -67,7 +67,7 @@ const marked_1 = require("marked");
|
|
|
67
67
|
const marked_terminal_1 = __importDefault(require("marked-terminal"));
|
|
68
68
|
const HISTORY_FILE = path.join(os.homedir(), '.mentis_history');
|
|
69
69
|
class ReplManager {
|
|
70
|
-
constructor(options = { resume: false, yolo: false }) {
|
|
70
|
+
constructor(options = { resume: false, yolo: false, headless: false }) {
|
|
71
71
|
this.history = [];
|
|
72
72
|
this.mode = 'BUILD';
|
|
73
73
|
this.tools = [];
|
|
@@ -193,6 +193,12 @@ class ReplManager {
|
|
|
193
193
|
// console.log(chalk.dim(`Initialized ${provider} client with model ${model}`));
|
|
194
194
|
}
|
|
195
195
|
async start() {
|
|
196
|
+
// Headless mode: non-interactive, process prompt and exit
|
|
197
|
+
if (this.options.headless && this.options.headlessPrompt) {
|
|
198
|
+
await this.handleChat(this.options.headlessPrompt);
|
|
199
|
+
process.exit(0);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
196
202
|
UIManager_1.UIManager.renderDashboard({
|
|
197
203
|
model: this.currentModelName,
|
|
198
204
|
mode: this.mode,
|
|
@@ -361,6 +367,10 @@ class ReplManager {
|
|
|
361
367
|
const updater = new UpdateManager();
|
|
362
368
|
await updater.checkAndPerformUpdate(true);
|
|
363
369
|
break;
|
|
370
|
+
case '/clear':
|
|
371
|
+
this.history = [];
|
|
372
|
+
console.log(chalk_1.default.green('\n✓ Context cleared\n'));
|
|
373
|
+
break;
|
|
364
374
|
case '/init':
|
|
365
375
|
await this.handleInitCommand();
|
|
366
376
|
break;
|
package/dist/ui/UIManager.js
CHANGED
|
@@ -19,12 +19,12 @@ class UIManager {
|
|
|
19
19
|
whitespaceBreak: true,
|
|
20
20
|
});
|
|
21
21
|
console.log(gradient_string_1.default.pastel.multiline(logoText));
|
|
22
|
-
console.log(chalk_1.default.gray(' v1.1.
|
|
22
|
+
console.log(chalk_1.default.gray(' v1.1.2 - AI Coding Agent'));
|
|
23
23
|
console.log('');
|
|
24
24
|
}
|
|
25
25
|
static renderDashboard(config) {
|
|
26
26
|
const { model, cwd } = config;
|
|
27
|
-
const version = 'v1.1.
|
|
27
|
+
const version = 'v1.1.2';
|
|
28
28
|
// Layout: Left (Status/Welcome) | Right (Tips/Activity)
|
|
29
29
|
// Total width ~80 chars.
|
|
30
30
|
// Left ~45, Right ~30.
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -4,18 +4,22 @@ import { ReplManager } from './repl/ReplManager';
|
|
|
4
4
|
interface CliOptions {
|
|
5
5
|
resume: boolean;
|
|
6
6
|
yolo: boolean;
|
|
7
|
+
headless: boolean;
|
|
8
|
+
headlessPrompt?: string;
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
function parseArgs(): { command: string | null, options: CliOptions } {
|
|
10
12
|
const args = process.argv.slice(2);
|
|
11
13
|
const options: CliOptions = {
|
|
12
14
|
resume: false,
|
|
13
|
-
yolo: false
|
|
15
|
+
yolo: false,
|
|
16
|
+
headless: false
|
|
14
17
|
};
|
|
15
18
|
|
|
16
19
|
let command: string | null = null;
|
|
17
20
|
|
|
18
|
-
for (
|
|
21
|
+
for (let i = 0; i < args.length; i++) {
|
|
22
|
+
const arg = args[i];
|
|
19
23
|
switch (arg) {
|
|
20
24
|
case 'update':
|
|
21
25
|
command = 'update';
|
|
@@ -26,6 +30,11 @@ function parseArgs(): { command: string | null, options: CliOptions } {
|
|
|
26
30
|
case '--yolo':
|
|
27
31
|
options.yolo = true;
|
|
28
32
|
break;
|
|
33
|
+
case '-p':
|
|
34
|
+
case '--prompt':
|
|
35
|
+
options.headless = true;
|
|
36
|
+
options.headlessPrompt = args[++i] || '';
|
|
37
|
+
break;
|
|
29
38
|
case '-h':
|
|
30
39
|
case '--help':
|
|
31
40
|
console.log(`
|
|
@@ -36,14 +45,17 @@ Usage:
|
|
|
36
45
|
mentis update Update to latest version
|
|
37
46
|
mentis --resume Resume last session
|
|
38
47
|
mentis --yolo Auto-confirm mode (skip confirmations)
|
|
48
|
+
mentis -p "<prompt>" Headless mode (non-interactive)
|
|
39
49
|
|
|
40
50
|
Options:
|
|
41
51
|
--resume Load latest checkpoint on start
|
|
42
52
|
--yolo Skip all confirmation prompts
|
|
53
|
+
-p, --prompt <text> Headless mode with prompt
|
|
43
54
|
-h, --help Show this help message
|
|
44
55
|
|
|
45
56
|
Commands (in REPL):
|
|
46
57
|
/help Show all available commands
|
|
58
|
+
/clear Clear conversation context
|
|
47
59
|
/resume Resume last session
|
|
48
60
|
/init Initialize project with .mentis.md
|
|
49
61
|
/skills <list|show|create|validate> Manage Agent Skills
|
package/src/repl/ReplManager.ts
CHANGED
|
@@ -36,6 +36,8 @@ const HISTORY_FILE = path.join(os.homedir(), '.mentis_history');
|
|
|
36
36
|
export interface CliOptions {
|
|
37
37
|
resume: boolean;
|
|
38
38
|
yolo: boolean;
|
|
39
|
+
headless: boolean;
|
|
40
|
+
headlessPrompt?: string;
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
export class ReplManager {
|
|
@@ -56,7 +58,7 @@ export class ReplManager {
|
|
|
56
58
|
private activeSkill: string | null = null; // Track currently active skill for allowed-tools
|
|
57
59
|
private options: CliOptions;
|
|
58
60
|
|
|
59
|
-
constructor(options: CliOptions = { resume: false, yolo: false }) {
|
|
61
|
+
constructor(options: CliOptions = { resume: false, yolo: false, headless: false }) {
|
|
60
62
|
this.options = options;
|
|
61
63
|
this.configManager = new ConfigManager();
|
|
62
64
|
this.contextManager = new ContextManager();
|
|
@@ -194,6 +196,13 @@ export class ReplManager {
|
|
|
194
196
|
}
|
|
195
197
|
|
|
196
198
|
public async start() {
|
|
199
|
+
// Headless mode: non-interactive, process prompt and exit
|
|
200
|
+
if (this.options.headless && this.options.headlessPrompt) {
|
|
201
|
+
await this.handleChat(this.options.headlessPrompt);
|
|
202
|
+
process.exit(0);
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
|
|
197
206
|
UIManager.renderDashboard({
|
|
198
207
|
model: this.currentModelName,
|
|
199
208
|
mode: this.mode,
|
|
@@ -371,6 +380,10 @@ export class ReplManager {
|
|
|
371
380
|
const updater = new UpdateManager();
|
|
372
381
|
await updater.checkAndPerformUpdate(true);
|
|
373
382
|
break;
|
|
383
|
+
case '/clear':
|
|
384
|
+
this.history = [];
|
|
385
|
+
console.log(chalk.green('\n✓ Context cleared\n'));
|
|
386
|
+
break;
|
|
374
387
|
case '/init':
|
|
375
388
|
await this.handleInitCommand();
|
|
376
389
|
break;
|
package/src/ui/UIManager.ts
CHANGED
|
@@ -14,13 +14,13 @@ export class UIManager {
|
|
|
14
14
|
whitespaceBreak: true,
|
|
15
15
|
});
|
|
16
16
|
console.log(gradient.pastel.multiline(logoText));
|
|
17
|
-
console.log(chalk.gray(' v1.1.
|
|
17
|
+
console.log(chalk.gray(' v1.1.2 - AI Coding Agent'));
|
|
18
18
|
console.log('');
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
public static renderDashboard(config: { model: string, mode: string, cwd: string }) {
|
|
22
22
|
const { model, cwd } = config;
|
|
23
|
-
const version = 'v1.1.
|
|
23
|
+
const version = 'v1.1.2';
|
|
24
24
|
|
|
25
25
|
// Layout: Left (Status/Welcome) | Right (Tips/Activity)
|
|
26
26
|
// Total width ~80 chars.
|