project-compass 2.5.1 โ 2.6.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 +4 -2
- package/package.json +1 -1
- package/src/cli.js +52 -11
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Project Compass (v2.
|
|
1
|
+
# Project Compass (v2.6.0)
|
|
2
2
|
|
|
3
3
|
Project Compass is a futuristic CLI navigator built with [Ink](https://github.com/vadimdemedes/ink) that scans your current folder tree for familiar code projects and gives you one-keystroke access to build, test, or run them.
|
|
4
4
|
|
|
@@ -11,6 +11,7 @@ Project Compass is a futuristic CLI navigator built with [Ink](https://github.co
|
|
|
11
11
|
- ๐ง **Smart Detection**: Support for 20+ frameworks including **Spring Boot** (Maven/Gradle), **ASP.NET Core**, **Rocket/Actix** (Rust), **Laravel** (PHP), **Vite**, **Prisma**, and more.
|
|
12
12
|
- โ ๏ธ **Runtime Health**: Automatically checks if the required language/runtime (e.g., `node`, `python`, `cargo`) is installed and warns you if it's missing.
|
|
13
13
|
- ๐ **Omni-Studio**: A new interactive environment intelligence mode to see all installed runtimes and versions.
|
|
14
|
+
- ๐ **Log Management**: Clear output with **Shift+X** or export logs to a text file with **Shift+E**.
|
|
14
15
|
- ๐ **Extensible**: Add custom commands with **Shift+C** and frameworks via `plugins.json`.
|
|
15
16
|
|
|
16
17
|
## Installation
|
|
@@ -35,7 +36,8 @@ project-compass [--dir /path/to/workspace] [--studio]
|
|
|
35
36
|
| **Shift+A** | Open **Omni-Studio** (Environment View) |
|
|
36
37
|
| **Shift+C** | Add a custom command (`label|cmd`) |
|
|
37
38
|
| **Shift+X** | **Clear output logs** |
|
|
38
|
-
| **Shift
|
|
39
|
+
| **Shift+E** | **Export logs to .txt** |
|
|
40
|
+
| **Shift โ / โ** | Scroll output buffer (Intuitive Direction) |
|
|
39
41
|
| **Shift+L** | Rerun last command |
|
|
40
42
|
| **Shift+H** | Toggle help cards |
|
|
41
43
|
| **Shift+S** | Toggle structure guide |
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -177,9 +177,9 @@ function Compass({rootPath, initialView = 'navigator'}) {
|
|
|
177
177
|
const addLog = useCallback((line) => {
|
|
178
178
|
setLogLines((prev) => {
|
|
179
179
|
const normalized = typeof line === 'string' ? line : JSON.stringify(line);
|
|
180
|
-
const
|
|
181
|
-
const
|
|
182
|
-
return
|
|
180
|
+
const lines = normalized.split(/\r?\n/).filter(l => l.trim().length > 0);
|
|
181
|
+
const appended = [...prev, ...lines];
|
|
182
|
+
return appended.length > 500 ? appended.slice(appended.length - 500) : appended;
|
|
183
183
|
});
|
|
184
184
|
}, []);
|
|
185
185
|
|
|
@@ -228,10 +228,10 @@ function Compass({rootPath, initialView = 'navigator'}) {
|
|
|
228
228
|
runningProcessRef.current = subprocess;
|
|
229
229
|
|
|
230
230
|
subprocess.stdout?.on('data', (chunk) => {
|
|
231
|
-
addLog(chunk.toString()
|
|
231
|
+
addLog(chunk.toString());
|
|
232
232
|
});
|
|
233
233
|
subprocess.stderr?.on('data', (chunk) => {
|
|
234
|
-
addLog(kleur.red(chunk.toString()
|
|
234
|
+
addLog(kleur.red(chunk.toString()));
|
|
235
235
|
});
|
|
236
236
|
|
|
237
237
|
await subprocess;
|
|
@@ -292,6 +292,19 @@ function Compass({rootPath, initialView = 'navigator'}) {
|
|
|
292
292
|
setCustomInput('');
|
|
293
293
|
}, [customInput, selectedProject, handleAddCustomCommand, addLog]);
|
|
294
294
|
|
|
295
|
+
const exportLogs = useCallback(() => {
|
|
296
|
+
if (!logLines.length) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
try {
|
|
300
|
+
const exportPath = path.resolve(process.cwd(), `compass-logs-${Date.now()}.txt`);
|
|
301
|
+
fs.writeFileSync(exportPath, logLines.join('\n'));
|
|
302
|
+
addLog(kleur.green(`โ Logs exported to ${exportPath}`));
|
|
303
|
+
} catch (err) {
|
|
304
|
+
addLog(kleur.red(`โ Export failed: ${err.message}`));
|
|
305
|
+
}
|
|
306
|
+
}, [logLines, addLog]);
|
|
307
|
+
|
|
295
308
|
useInput((input, key) => {
|
|
296
309
|
if (customMode) {
|
|
297
310
|
if (key.return) {
|
|
@@ -334,6 +347,10 @@ function Compass({rootPath, initialView = 'navigator'}) {
|
|
|
334
347
|
setLogOffset(0);
|
|
335
348
|
return;
|
|
336
349
|
}
|
|
350
|
+
if (shiftCombo('e')) {
|
|
351
|
+
exportLogs();
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
337
354
|
|
|
338
355
|
const scrollLogs = (delta) => {
|
|
339
356
|
setLogOffset((prev) => {
|
|
@@ -618,7 +635,7 @@ function Compass({rootPath, initialView = 'navigator'}) {
|
|
|
618
635
|
'B / T / R build/test/run',
|
|
619
636
|
'1-9 run detail commands',
|
|
620
637
|
'Shift+L rerun last command',
|
|
621
|
-
'Shift+X clear
|
|
638
|
+
'Shift+X clear / Shift+E export'
|
|
622
639
|
]
|
|
623
640
|
},
|
|
624
641
|
{
|
|
@@ -689,9 +706,9 @@ function Compass({rootPath, initialView = 'navigator'}) {
|
|
|
689
706
|
padding: 1
|
|
690
707
|
},
|
|
691
708
|
create(Text, {color: 'cyan', bold: true}, 'Help overlay ยท press ? to hide'),
|
|
692
|
-
create(Text, null, 'Shift+โ/โ scrolls
|
|
693
|
-
create(Text, null, 'B/T/R run build/test/run; 1-9
|
|
694
|
-
create(Text, null, 'Shift+H
|
|
709
|
+
create(Text, null, 'Shift+โ/โ scrolls logs; Shift+X clears; Shift+E exports to file; Shift+A Omni-Studio.'),
|
|
710
|
+
create(Text, null, 'B/T/R run build/test/run; 1-9 detail commands; Shift+L reruns previous command.'),
|
|
711
|
+
create(Text, null, 'Shift+H help cards, Shift+S structure guide, ? overlay, Shift+Q quits.'),
|
|
695
712
|
create(Text, null, 'Projects + Details stay paired while Output keeps its own full-width band.'),
|
|
696
713
|
create(Text, null, 'Structure guide lists the manifests that trigger each language detection.')
|
|
697
714
|
)
|
|
@@ -834,8 +851,32 @@ function parseArgs() {
|
|
|
834
851
|
async function main() {
|
|
835
852
|
const args = parseArgs();
|
|
836
853
|
if (args.help) {
|
|
837
|
-
console.log('Project Compass ยท Ink project runner');
|
|
838
|
-
console.log('
|
|
854
|
+
console.log(kleur.cyan('Project Compass ยท Ink project navigator/runner'));
|
|
855
|
+
console.log('');
|
|
856
|
+
console.log(kleur.bold('Usage:'));
|
|
857
|
+
console.log(' project-compass [--dir <path>] [--studio]');
|
|
858
|
+
console.log('');
|
|
859
|
+
console.log(kleur.bold('Arguments:'));
|
|
860
|
+
console.log(' --dir, --path <path> Specify root workspace directory to scan');
|
|
861
|
+
console.log(' --studio Launch directly into Omni-Studio mode');
|
|
862
|
+
console.log(' --help, -h Show this help menu');
|
|
863
|
+
console.log('');
|
|
864
|
+
console.log(kleur.bold('Core Keybinds:'));
|
|
865
|
+
console.log(' โ / โ Move project focus');
|
|
866
|
+
console.log(' Enter Toggle detail view for selected project');
|
|
867
|
+
console.log(' Shift+A Switch to Omni-Studio (Environment Health)');
|
|
868
|
+
console.log(' Shift+X Clear the output log buffer');
|
|
869
|
+
console.log(' Shift+E Export current logs to a .txt file');
|
|
870
|
+
console.log(' Shift+โ / โ Scroll the output logs back/forward');
|
|
871
|
+
console.log(' Shift+Q Quit application');
|
|
872
|
+
console.log('');
|
|
873
|
+
console.log(kleur.bold('Execution shortcuts:'));
|
|
874
|
+
console.log(' B / T / R Quick run: Build / Test / Run');
|
|
875
|
+
console.log(' 1-9 Run numbered commands in detail view');
|
|
876
|
+
console.log(' Shift+L Rerun the last executed command');
|
|
877
|
+
console.log(' Shift+C Add a custom command (in detail view)');
|
|
878
|
+
console.log('');
|
|
879
|
+
console.log(kleur.dim('Documentation: https://github.com/CrimsonDevil333333/project-compass'));
|
|
839
880
|
return;
|
|
840
881
|
}
|
|
841
882
|
const rootPath = args.root ? path.resolve(args.root) : process.cwd();
|