codedash-app 3.3.1 → 3.4.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.
Files changed (2) hide show
  1. package/bin/cli.js +79 -4
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const { loadSessions } = require('../src/data');
3
+ const { loadSessions, searchFullText, getSessionPreview, computeSessionCost } = require('../src/data');
4
4
  const { startServer } = require('../src/server');
5
5
  const { exportArchive, importArchive } = require('../src/migrate');
6
6
 
@@ -57,6 +57,79 @@ switch (command) {
57
57
  break;
58
58
  }
59
59
 
60
+ case 'search':
61
+ case 'find': {
62
+ const query = args.slice(1).join(' ');
63
+ if (!query) {
64
+ console.error(' Usage: codedash search <query>');
65
+ process.exit(1);
66
+ }
67
+ const sessions = loadSessions();
68
+ const results = searchFullText(query, sessions);
69
+ if (results.length === 0) {
70
+ console.log(`\n No results for "${query}"\n`);
71
+ } else {
72
+ console.log(`\n \x1b[36m\x1b[1m${results.length} sessions\x1b[0m matching "${query}"\n`);
73
+ for (const r of results.slice(0, 15)) {
74
+ const s = sessions.find(x => x.id === r.sessionId);
75
+ const proj = s ? (s.project_short || '') : '';
76
+ const tool = s ? s.tool : '?';
77
+ const date = s ? s.last_time : '';
78
+ console.log(` \x1b[1m${r.sessionId.slice(0, 12)}\x1b[0m ${tool} ${date} \x1b[2m${proj}\x1b[0m`);
79
+ for (const m of r.matches.slice(0, 2)) {
80
+ const role = m.role === 'user' ? '\x1b[34mYOU\x1b[0m' : '\x1b[32mAI \x1b[0m';
81
+ console.log(` ${role} ${m.snippet.replace(/\n/g, ' ').slice(0, 100)}`);
82
+ }
83
+ }
84
+ if (results.length > 15) console.log(`\n \x1b[2m... and ${results.length - 15} more\x1b[0m`);
85
+ console.log('');
86
+ }
87
+ break;
88
+ }
89
+
90
+ case 'show': {
91
+ const sid = args[1];
92
+ if (!sid) {
93
+ console.error(' Usage: codedash show <session-id>');
94
+ process.exit(1);
95
+ }
96
+ const allS = loadSessions();
97
+ const session = allS.find(s => s.id === sid || s.id.startsWith(sid));
98
+ if (!session) {
99
+ console.error(` Session not found: ${sid}`);
100
+ process.exit(1);
101
+ }
102
+ const preview = getSessionPreview(session.id, session.project, 20);
103
+ const cost = computeSessionCost(session.id, session.project);
104
+
105
+ console.log('');
106
+ console.log(` \x1b[36m\x1b[1mSession ${session.id}\x1b[0m`);
107
+ console.log(` Tool: ${session.tool}`);
108
+ console.log(` Project: ${session.project_short || session.project || 'unknown'}`);
109
+ console.log(` Started: ${session.first_time}`);
110
+ console.log(` Last: ${session.last_time}`);
111
+ console.log(` Msgs: ${session.messages} inputs, ${session.detail_messages || 0} total`);
112
+ if (cost.cost > 0) {
113
+ console.log(` Cost: $${cost.cost.toFixed(2)} (${cost.model || 'unknown'})`);
114
+ console.log(` Tokens: ${(cost.inputTokens/1000).toFixed(0)}K in / ${(cost.outputTokens/1000).toFixed(0)}K out`);
115
+ }
116
+ console.log('');
117
+
118
+ if (preview.length > 0) {
119
+ console.log(' \x1b[1mConversation:\x1b[0m');
120
+ for (const m of preview) {
121
+ const role = m.role === 'user' ? '\x1b[34mYOU\x1b[0m' : '\x1b[32mAI \x1b[0m';
122
+ const text = m.content.replace(/\n/g, ' ').slice(0, 120);
123
+ console.log(` ${role} ${text}`);
124
+ }
125
+ console.log('');
126
+ }
127
+
128
+ console.log(` Resume: \x1b[2m${session.tool === 'codex' ? 'codex resume' : 'claude --resume'} ${session.id}\x1b[0m`);
129
+ console.log('');
130
+ break;
131
+ }
132
+
60
133
  case 'update':
61
134
  case 'upgrade': {
62
135
  const { execSync: execU } = require('child_process');
@@ -137,13 +210,15 @@ switch (command) {
137
210
 
138
211
  \x1b[1mUsage:\x1b[0m
139
212
  codedash run [port] [--no-browser] Start the dashboard server
140
- codedash update Update to latest version
141
- codedash restart [--port=N] Restart the server
142
- codedash stop [--port=N] Stop the server
213
+ codedash search <query> Search across all session messages
214
+ codedash show <session-id> Show session details + messages
143
215
  codedash list [limit] List sessions in terminal
144
216
  codedash stats Show session statistics
145
217
  codedash export [file.tar.gz] Export all sessions to archive
146
218
  codedash import <file.tar.gz> Import sessions from archive
219
+ codedash update Update to latest version
220
+ codedash restart [--port=N] Restart the server
221
+ codedash stop [--port=N] Stop the server
147
222
  codedash help Show this help
148
223
  codedash version Show version
149
224
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codedash-app",
3
- "version": "3.3.1",
3
+ "version": "3.4.0",
4
4
  "description": "Termius-style browser dashboard for Claude Code sessions. View, search, resume, and delete sessions with a dark-themed UI.",
5
5
  "bin": {
6
6
  "codedash": "./bin/cli.js"