MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / main

Function main

scripts/tmux/tmux-viewer/index.tsx:69–114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67}
68
69async function main(): Promise<void> {
70 const { session, json, list, replay, exportGif, frameDelay, fontSize } = parseArgs()
71 const projectRoot = process.cwd()
72
73 // List sessions mode
74 if (list) {
75 const sessions = await listSessions(projectRoot)
76
77 if (sessions.length === 0) {
78 console.log(yellow('No sessions found in debug/tmux-sessions/'))
79 console.log(dim('Start a session with: ./scripts/tmux/tmux-cli.sh start'))
80 process.exit(0)
81 }
82
83 console.log(cyan('Available sessions:'))
84 for (const s of sessions) {
85 console.log(` ${s}`)
86 }
87 process.exit(0)
88 }
89
90 // If no session specified, show help or list
91 if (!session) {
92 const sessions = await listSessions(projectRoot)
93
94 if (sessions.length === 0) {
95 console.log(red('No session specified and no sessions found.'))
96 console.log('')
97 console.log('Usage:')
98 console.log(' bun scripts/tmux/tmux-viewer/index.tsx <session-name>')
99 console.log(' bun scripts/tmux/tmux-viewer/index.tsx <session-name> --json')
100 console.log(' bun scripts/tmux/tmux-viewer/index.tsx <session-name> --export-gif output.gif')
101 console.log(' bun scripts/tmux/tmux-viewer/index.tsx --list')
102 console.log('')
103 console.log(dim('Start a session with: ./scripts/tmux/tmux-cli.sh start'))
104 process.exit(1)
105 }
106
107 // Use the most recent session
108 const mostRecent = sessions[0]
109 console.log(dim(`Using most recent session: ${mostRecent}`))
110 return runViewer(mostRecent, json, replay, exportGif, frameDelay, fontSize, projectRoot)
111 }
112
113 return runViewer(session, json, replay, exportGif, frameDelay, fontSize, projectRoot)
114}
115
116async function runViewer(
117 sessionName: string,

Callers 1

index.tsxFile · 0.70

Calls 3

listSessionsFunction · 0.90
runViewerFunction · 0.85
parseArgsFunction · 0.70

Tested by

no test coverage detected