An open-source, AI-integrated, cross-platform terminal for seamless workflows
Find a file
Copilot fa19d7c287
Add read_dir AI tool for reading directory contents (#2414)
- [x] Explore repository structure and understand existing tools pattern
- [x] Create tools_readdir.go file with read_dir tool implementation
- [x] Add GetReadDirToolDefinition() function following the pattern of
read_text_file
- [x] Register the new tool in tools.go GenerateTabStateAndTools
function
- [x] Create comprehensive tests in tools_readdir_test.go
- [x] Test the implementation manually with various scenarios
- [x] Run Go tests to ensure no regressions
- [x] Run security check with CodeQL - No vulnerabilities found
- [x] Revert unintended changes to tsunami demo go.mod and go.sum files
- [x] Fix sorting to happen before truncation and preserve real total
count

## Summary

Successfully implemented a new `read_dir` AI tool that reads and lists
directory contents, following the same pattern as the existing
`read_text_file` tool.

**Key Features:**
- Supports path expansion (including ~)
- Sorts directories first, then files (sorting happens BEFORE
truncation)
- Truncates output to prevent overwhelming responses (default 1000
entries)
- Preserves the real total count even when truncated
- Requires user approval for security
- Provides detailed file/directory information (name, type, size,
permissions, modification time)
- Returns both structured data and formatted listing

**Files Changed:**
- `pkg/aiusechat/tools_readdir.go` - Main implementation (189 lines)
- `pkg/aiusechat/tools_readdir_test.go` - Comprehensive tests (211
lines)
- `pkg/aiusechat/tools.go` - Tool registration (1 line)

**Testing:**
-  All 6 unit tests passing (including new test for
sort-before-truncate)
-  Manual testing with real directories successful
-  CodeQL security scan passed with no vulnerabilities
-  Go build and vet successful

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> Right now we have AI tools in go at pkg/aichat ... see tools.go,
tools_readfile.go. i'd like to add a new tool to read directories in the
style of readfile.


</details>



<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Co-authored-by: sawka <mike@commandline.dev>
2025-10-09 21:41:50 -07:00
.github remove npm ci timing info (#2413) 2025-10-09 16:34:05 -07:00
.roo/rules New AIPanel (#2370) 2025-10-07 13:32:10 -07:00
.storybook add tailwind to wave, support shadcn + donut chart as a POC (#1775) 2025-02-04 17:58:36 -08:00
.vscode tsunami framework (waveapps v2) (#2315) 2025-09-11 14:25:07 -07:00
.zed Add basic Zed workspace configs (#1942) 2025-02-09 15:00:46 -08:00
aiprompts analysis of the monaco v0.53 issue, for next release (#2401) 2025-10-07 16:24:09 -07:00
assets Make the Wave logo icons slightly smaller (#1500) 2024-12-11 13:24:12 -08:00
build Squash some leftover bugs (#1495) 2024-12-11 12:52:15 -08:00
cmd onboarding and polish for v0.12 (#2411) 2025-10-09 16:29:09 -07:00
db Allow AI Presets To Automatically Update Widgets (#1954) 2025-02-13 13:38:12 -08:00
docs Bump the dev-dependencies-patch group across 1 directory with 8 updates (#2394) 2025-10-07 13:38:22 -07:00
emain onboarding and polish for v0.12 (#2411) 2025-10-09 16:29:09 -07:00
frontend onboarding and polish for v0.12 (#2411) 2025-10-09 16:29:09 -07:00
pkg Add read_dir AI tool for reading directory contents (#2414) 2025-10-09 21:41:50 -07:00
public tsunami framework (waveapps v2) (#2315) 2025-09-11 14:25:07 -07:00
schema add config setting to disable overlay blocknums from showing when holding ctrl:shift (#2288) 2025-08-25 21:47:35 -07:00
testdriver touch up final test condition (#1338) 2024-11-22 17:16:04 -08:00
tests/copytests Add S3 fileshare implementation, improve cp behavior (#1896) 2025-02-14 17:27:02 -08:00
tsunami upgrade tsunami react to 19.2.0 (#2403) 2025-10-07 17:19:41 -07:00
.editorconfig Oops i actually made the tabs wrong (#1384) 2024-12-04 13:49:14 -08:00
.gitattributes WSL Integration (#1031) 2024-10-23 22:43:17 -07:00
.gitignore layout simplification (#2387) 2025-10-03 10:10:07 -07:00
.golangci.yml New AIPanel (#2370) 2025-10-07 13:32:10 -07:00
.prettierignore Add filewatcher for config files (#63) 2024-06-19 23:59:41 -07:00
ACKNOWLEDGEMENTS.md Add back the acknowledgements readme, update about modal link (#818) 2024-09-24 16:58:18 -07:00
BUILD.md switch from yarn to npm (#2347) 2025-09-12 15:36:03 -07:00
CNAME Move docsite to main repo (#1204) 2024-11-06 10:45:21 -08:00
CODE_OF_CONDUCT.md move some metadata files over to new repo 2024-09-18 12:04:28 -07:00
CONTRIBUTING.md Add link to Good First Issues in Contributing Guide (#1991) 2025-02-18 17:06:56 -08:00
electron-builder.config.cjs move rpm section to top level instead of under linux (#2301) 2025-08-28 15:13:29 -07:00
electron.vite.config.ts New AIPanel (#2370) 2025-10-07 13:32:10 -07:00
eslint.config.js Switch to using electron-vite instead of WebPack (#45) 2024-06-13 16:49:25 -07:00
go.mod Bump github.com/sashabaranov/go-openai from 1.41.1 to 1.41.2 (#2361) 2025-10-07 17:20:16 -07:00
go.sum Bump github.com/sashabaranov/go-openai from 1.41.1 to 1.41.2 (#2361) 2025-10-07 17:20:16 -07:00
index.html add tailwind to wave, support shadcn + donut chart as a POC (#1775) 2025-02-04 17:58:36 -08:00
LICENSE Happy new year! (#1684) 2025-01-04 20:56:57 -08:00
NOTICE Happy new year! (#1684) 2025-01-04 20:56:57 -08:00
package-lock.json custom streamdown components for wave ai (#2404) 2025-10-08 13:22:00 -07:00
package.json custom streamdown components for wave ai (#2404) 2025-10-08 13:22:00 -07:00
prettier.config.cjs Windows Line Endings (#923) 2024-10-01 12:54:15 -07:00
README.md Update README.md (#2079) 2025-03-24 23:56:53 -07:00
RELEASES.md Update more links in releases.md (#1826) 2025-01-23 17:59:16 -08:00
ROADMAP.md new tevents analytics framework (#1894) 2025-02-03 15:32:44 -08:00
SECURITY.md Add markdown alert parsing, fix buffer issue when switching files (#988) 2024-10-08 09:25:41 -07:00
staticcheck.conf standalone fixes, linting errors, speedups, QOL changes ported from wave-12 branch (#2271) 2025-08-20 18:07:11 -07:00
Taskfile.yml New AIPanel (#2370) 2025-10-07 13:32:10 -07:00
tsconfig.json custom streamdown components for wave ai (#2404) 2025-10-08 13:22:00 -07:00
version.cjs If prerelease is false and action is none, remove the prerelease version string (#395) 2024-09-18 13:12:34 -07:00
vitest.config.ts Switch to using electron-vite instead of WebPack (#45) 2024-06-13 16:49:25 -07:00

Wave Terminal Logo

Wave Terminal

FOSSA Status

Wave is an open-source terminal that combines traditional terminal features with graphical capabilities like file previews, web browsing, and AI assistance. It runs on MacOS, Linux, and Windows.

Modern development involves constantly switching between terminals and browsers - checking documentation, previewing files, monitoring systems, and using AI tools. Wave brings these graphical tools directly into the terminal, letting you control them from the command line. This means you can stay in your terminal workflow while still having access to the visual interfaces you need.

WaveTerm Screenshot

Key Features

  • Flexible drag & drop interface to organize terminal blocks, editors, web browsers, and AI assistants
  • Built-in editor for seamlessly editing remote files with syntax highlighting and modern editor features
  • Rich file preview system for remote files (markdown, images, video, PDFs, CSVs, directories)
  • Integrated AI chat with support for multiple models (OpenAI, Claude, Azure, Perplexity, Ollama)
  • Command Blocks for isolating and monitoring individual commands with auto-close options
  • One-click remote connections with full terminal and file system access
  • Rich customization including tab themes, terminal styles, and background images
  • Powerful wsh command system for managing your workspace from the CLI and sharing data between terminal sessions

Installation

Wave Terminal works on macOS, Linux, and Windows.

Platform-specific installation instructions can be found here.

You can also install Wave Terminal directly from: www.waveterm.dev/download.

Minimum requirements

Wave Terminal runs on the following platforms:

  • macOS 11 or later (arm64, x64)
  • Windows 10 1809 or later (x64)
  • Linux based on glibc-2.28 or later (Debian 10, RHEL 8, Ubuntu 20.04, etc.) (arm64, x64)

The WSH helper runs on the following platforms:

  • macOS 11 or later (arm64, x64)
  • Windows 10 or later (arm64, x64)
  • Linux Kernel 2.6.32 or later (x64), Linux Kernel 3.1 or later (arm64)

Roadmap

Wave is constantly improving! Our roadmap will be continuously updated with our goals for each release. You can find it here.

Want to provide input to our future releases? Connect with us on Discord or open a Feature Request!

Building from Source

See Building Wave Terminal.

Contributing

Wave uses GitHub Issues for issue tracking.

Find more information in our Contributions Guide, which includes:

License

Wave Terminal is licensed under the Apache-2.0 License. For more information on our dependencies, see here.