bin.ts 811 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env node
  2. /**
  3. * dsh — command-line entry. Coarse dispatch only; each surface module owns its
  4. * argument handling. Dynamic imports keep unrelated surfaces out of each
  5. * dispatch path; everything except `web` and headless prompts opens the TUI.
  6. * @module @deepseek-ai/dsh/bin
  7. */
  8. /* v8 ignore file -- built-bin and PTY tests exercise this self-executing dispatch. */
  9. import { loadEnv } from '@deepseek-ai/dsh-app-boot'
  10. loadEnv('dsh')
  11. const argv = process.argv.slice(2)
  12. if (argv[0] === 'web') {
  13. const { runWeb } = await import('./web.ts')
  14. await runWeb(argv.slice(1))
  15. } else if (argv.includes('-p') || argv.includes('--prompt')) {
  16. const { runHeadless } = await import('./headless.ts')
  17. await runHeadless(argv)
  18. } else {
  19. const { runTui } = await import('./tui.ts')
  20. await runTui(argv)
  21. }