phewsh 0.11.10 → 0.11.12
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/bin/phewsh.js +51 -36
- package/commands/session.js +222 -184
- package/lib/ui.js +342 -0
- package/package.json +1 -1
package/bin/phewsh.js
CHANGED
|
@@ -8,6 +8,8 @@ const b = (s) => `\x1b[1m${s}\x1b[0m`; // bold
|
|
|
8
8
|
const d = (s) => `\x1b[2m${s}\x1b[0m`; // dim
|
|
9
9
|
const w = (s) => `\x1b[97m${s}\x1b[0m`; // bright white
|
|
10
10
|
const g = (s) => `\x1b[90m${s}\x1b[0m`; // dark gray
|
|
11
|
+
const cyan = (s) => `\x1b[36m${s}\x1b[0m`;
|
|
12
|
+
const green = (s) => `\x1b[32m${s}\x1b[0m`;
|
|
11
13
|
|
|
12
14
|
function showBrand() {
|
|
13
15
|
const fs = require('fs');
|
|
@@ -15,24 +17,32 @@ function showBrand() {
|
|
|
15
17
|
const os = require('os');
|
|
16
18
|
const hasIntent = fs.existsSync(path.join(process.cwd(), '.intent', 'vision.md'));
|
|
17
19
|
const configPath = path.join(os.homedir(), '.phewsh', 'config.json');
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} catch { /* no config */ }
|
|
26
|
-
}
|
|
20
|
+
let hasKey = false;
|
|
21
|
+
let email = null;
|
|
22
|
+
try {
|
|
23
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
24
|
+
hasKey = !!config?.apiKey;
|
|
25
|
+
email = config?.email;
|
|
26
|
+
} catch { /* no config */ }
|
|
27
27
|
|
|
28
28
|
console.log('');
|
|
29
29
|
console.log(` ${d('😮\u200d💨')} ${d('🤫')}`);
|
|
30
30
|
console.log('');
|
|
31
31
|
console.log(` ${b(w('█▀█ █░█ █▀▀ █░█ █▀ █░█'))}`);
|
|
32
32
|
console.log(` ${b(w('█▀▀ █▀█ ██▄ ▀▄▀ ▄█ █▀█'))}`);
|
|
33
|
-
console.log(` ${g('
|
|
33
|
+
console.log(` ${g('Your project identity for every AI tool.')}`);
|
|
34
34
|
console.log('');
|
|
35
|
-
|
|
35
|
+
|
|
36
|
+
// Context-aware hint
|
|
37
|
+
if (!hasKey) {
|
|
38
|
+
console.log(` ${g('Get started:')} ${w('phewsh')} ${g('(guided setup, takes 60 seconds)')}`);
|
|
39
|
+
} else if (hasIntent) {
|
|
40
|
+
console.log(` ${green('●')} .intent/ loaded ${g('·')} ${w('phewsh')} ${g('to chat ·')} ${w('phewsh watch')} ${g('to sync')}`);
|
|
41
|
+
} else if (email) {
|
|
42
|
+
console.log(` ${g('logged in as')} ${email} ${g('·')} ${w('phewsh')} ${g('to start')}`);
|
|
43
|
+
} else {
|
|
44
|
+
console.log(` ${g('Ready.')} ${w('phewsh')} ${g('to start a session.')}`);
|
|
45
|
+
}
|
|
36
46
|
console.log('');
|
|
37
47
|
}
|
|
38
48
|
|
|
@@ -64,33 +74,38 @@ function showVersion() {
|
|
|
64
74
|
function showHelp() {
|
|
65
75
|
const pkg = require('../package.json');
|
|
66
76
|
showBrand();
|
|
67
|
-
console.log(` ${g('v' + pkg.version)} · ${g('phewsh.com')}\n`);
|
|
68
|
-
console.log(` ${
|
|
69
|
-
console.log(` ${
|
|
77
|
+
console.log(` ${g('v' + pkg.version)} · ${g('phewsh.com/cli')}\n`);
|
|
78
|
+
console.log(` ${g('─'.repeat(48))}`);
|
|
79
|
+
console.log(` ${b('Just type')} ${w('phewsh')} ${b('to start.')} ${g('Everything else is optional.')}`);
|
|
80
|
+
console.log(` ${g('─'.repeat(48))}`);
|
|
81
|
+
console.log('');
|
|
82
|
+
console.log(` ${b(w('start here'))}`);
|
|
83
|
+
console.log(` ${cyan('phewsh')} Open AI session — type naturally, get guided`);
|
|
84
|
+
console.log(` ${cyan('phewsh clarify')} Turn a messy idea into a structured spec`);
|
|
85
|
+
console.log(` ${cyan('phewsh login')} Set up identity + API key`);
|
|
86
|
+
console.log('');
|
|
87
|
+
console.log(` ${b(w('project'))}`);
|
|
88
|
+
console.log(` ${cyan('intent')} ${g('Manage .intent/ artifacts — status, open, evolve')}`);
|
|
89
|
+
console.log(` ${cyan('gate')} ${g('Declare constraints (budget, time, skill, urgency)')}`);
|
|
90
|
+
console.log(` ${cyan('context')} ${g('Export portable context for any AI tool')}`);
|
|
91
|
+
console.log(` ${cyan('ai')} ${g('One-shot AI prompt with .intent/ context')}`);
|
|
92
|
+
console.log('');
|
|
93
|
+
console.log(` ${b(w('sync'))}`);
|
|
94
|
+
console.log(` ${cyan('push')} ${g('Push .intent/ to cloud')}`);
|
|
95
|
+
console.log(` ${cyan('pull')} ${g('Pull from cloud to .intent/')}`);
|
|
96
|
+
console.log(` ${cyan('watch')} ${g('Live sync — CLAUDE.md + web dashboard auto-update')}`);
|
|
97
|
+
console.log(` ${cyan('serve')} ${g('Execution bridge for the web app')}`);
|
|
98
|
+
console.log('');
|
|
99
|
+
console.log(` ${b(w('connect'))}`);
|
|
100
|
+
console.log(` ${cyan('mcp')} ${g('Connect AI agents via MCP protocol')}`);
|
|
101
|
+
console.log(` ${cyan('link')} ${g('Link local .intent/ to cloud project')}`);
|
|
70
102
|
console.log('');
|
|
71
|
-
console.log(` ${b('
|
|
72
|
-
console.log(` ${
|
|
73
|
-
console.log(` ${
|
|
74
|
-
console.log(` ${
|
|
75
|
-
console.log(` ${w('pull')} Pull project from cloud to .intent/`);
|
|
76
|
-
console.log(` ${w('link')} Link local .intent/ to a cloud project`);
|
|
77
|
-
console.log(` ${w('intent')} Manage .intent/ artifacts — status, open, evolve`);
|
|
78
|
-
console.log(` ${w('ai')} One-shot AI prompt (reads .intent/)`);
|
|
79
|
-
console.log(` ${w('gate')} Declare operational constraints (budget, time, skill)`);
|
|
80
|
-
console.log(` ${w('context')} Export portable context for any AI tool`);
|
|
81
|
-
console.log(` ${w('login')} Set up identity, API key, and cloud sync`);
|
|
82
|
-
console.log(` ${w('watch')} Live sync — .intent/ changes push to cloud + CLAUDE.md`);
|
|
83
|
-
console.log(` ${w('serve')} Start live execution bridge for the web app`);
|
|
84
|
-
console.log(` ${w('mcp')} Connect AI agents — setup, sync, status`);
|
|
85
|
-
console.log(` ${w('sap')} Sustainable AI Protocol — usage and accountability`);
|
|
86
|
-
console.log(` ${w('style')} Build your style identity — ingest, profile, sync`);
|
|
87
|
-
console.log(` ${w('mbhd')} MBHD music engine`);
|
|
103
|
+
console.log(` ${b(w('more'))}`);
|
|
104
|
+
console.log(` ${cyan('sap')} ${g('Sustainable AI Protocol — usage tracking')}`);
|
|
105
|
+
console.log(` ${cyan('style')} ${g('Style identity — ingest, profile, sync')}`);
|
|
106
|
+
console.log(` ${cyan('mbhd')} ${g('MBHD music engine')}`);
|
|
88
107
|
console.log('');
|
|
89
|
-
console.log(` ${
|
|
90
|
-
console.log(` ${g('phewsh login')} Set up identity + API key`);
|
|
91
|
-
console.log(` ${g('phewsh')} Open AI session (with .intent/ context)`);
|
|
92
|
-
console.log(` ${g('phewsh clarify')} Compile messy intent → structured spec`);
|
|
93
|
-
console.log(` ${g('phewsh ai run "what\'s next?"')} One-shot prompt`);
|
|
108
|
+
console.log(` ${g('Works standalone · Inside Claude Code · Inside Cursor · With any MCP agent')}`);
|
|
94
109
|
console.log('');
|
|
95
110
|
}
|
|
96
111
|
|