deepagents icon indicating copy to clipboard operation
deepagents copied to clipboard

Windows-ready deepagents-cli: native paths, globbing, and improved shell UX

Open kshadow07 opened this issue 1 month ago • 3 comments

Windows-Ready deepagents-cli: Native path/glob support, shell UX, and docs

Summary

  1. Adds first-class Windows support to deepagents-cli without breaking macOS/Linux.
  2. Enables reading/writing using Windows absolute paths and absolute glob patterns.
  3. Avoids Unix-only imports at startup; uses safe fallbacks on Windows.
  4. Polishes shell-mode UX and defaults to notepad as editor on Windows.
  5. Documents all changes with before/after diffs and upgrade guidance.

Key Changes

  • Filesystem middleware accepts Windows drive-letter paths and normalizes separators.
  • Filesystem backend expands absolute Windows glob patterns (e.g., C:\...\**\*.py).
  • Approval prompt imports termios/tty lazily inside the function; Windows uses the fallback prompt.
  • EDITOR default set conditionally: notepad on Windows, nano elsewhere.
  • UI help updated to “SHELL MODE” and cross‑platform examples (!dir on Windows, !ls on macOS/Linux).
  • CLI prefers local libs/deepagents during development so patched middleware is loaded.

Modified Files

  • libs/deepagents/deepagents/middleware/filesystem.py
  • libs/deepagents/deepagents/backends/filesystem.py
  • libs/deepagents-cli/deepagents_cli/execution.py
  • libs/deepagents-cli/deepagents_cli/input.py
  • libs/deepagents-cli/deepagents_cli/ui.py
  • libs/deepagents-cli/deepagents_cli/token_utils.py
  • libs/deepagents-cli/deepagents_cli/main.py
  • libs/deepagents-cli/README.md
  • libs/deepagents-cli/windows_fixed.md (new, detailed change log)

Why It Matters

  • Windows users get a seamless local CLI experience with correct path handling and shell execution.
  • Maintainers have a clear record of code diffs and guidance for future upgrades.
  • Remote sandbox integrations remain Linux-based and unchanged.

Verification

  • Interactive CLI runs on Windows; file tools accept Windows paths and glob patterns.
  • Shell-mode executes commands (!dir, !type) and help text matches OS conventions.
  • Editor opens with Ctrl+E using notepad on Windows unless EDITOR is set.

Docs

  • windows_fixed.md provides before/after snippets for every change and upgrade notes:
    • If you update to an upstream deepagents, ensure:
      • _validate_path accepts drive-letter absolute paths and normalizes separators.
      • glob_info supports absolute Windows patterns via glob.glob(..., recursive=True).
  • README.md includes a Windows Compatibility section summarizing the improvements.

Security

  • .env is ignored; do not commit secrets. Ensure OPENAI_API_KEY remains private.
  • Tavily Search is optional; set TAVILY_API_KEY to enable web search.

kshadow07 avatar Nov 30 '25 12:11 kshadow07

Guys test it in windows and let me know

kshadow07 avatar Nov 30 '25 13:11 kshadow07

@kshadow07 this looks very AI generated and based on your comment you havent' tested this in windows.

Before we can merge this in or add the tests, we'd probably want to add test code with windows and be running that on CI

eyurtsev avatar Dec 02 '25 03:12 eyurtsev

I've tried it. If prompts related to the file system are not adjusted accordingly, issues may still arise. For example, if asked to list files in the current directory, it might directly use / to call the ls command.

ouhaochuan avatar Dec 02 '25 10:12 ouhaochuan

For folks that want to use this in windows, you can get it working immediately via wsl https://learn.microsoft.com/en-us/windows/wsl/install -- it's a great tool on windows for coding in general!

eyurtsev avatar Dec 02 '25 15:12 eyurtsev

For folks that want to use this in windows, you can get it working immediately via wsl https://learn.microsoft.com/en-us/windows/wsl/install -- it's a great tool on windows for coding in general!

I have WSL installed, but all my code is developed under Windows, and my files reside within the Windows file system. Consequently, accessing files on Windows from within WSL remains rather inconvenient. For me, native Windows support is still essential.

ouhaochuan avatar Dec 03 '25 00:12 ouhaochuan