Skip to content

Conversation

@hflyzju
Copy link

@hflyzju hflyzju commented Sep 12, 2025

…tools

Description

This pull request introduces a comprehensive set of example scripts for the tools available in the trae_agent/tools directory. These examples are designed to demonstrate the functionality of each tool and provide a clear guide for developers on how to use them effectively.

More Information

The following example scripts have been added to the examples/tools/ directory:

  • bash_example.py: Demonstrates how to use the BashTool to execute shell commands, capture output, and handle errors.
  • ckg_tool_example.py: Provides an example of how to use the CKGTool to query the codebase for functions, classes, and methods.
  • edit_tool_example.py: Shows how to use the TextEditorTool to perform file manipulations such as creating, viewing, and editing text files.
  • json_edit_tool_example.py: Illustrates how to use the JSONEditTool for structured data manipulation in JSON files, including adding, setting, and removing elements.
  • run_example.py: An example of how to use the run utility function to execute shell commands and handle their output and errors.

These examples will serve as a valuable resource for developers, accelerating the learning process and promoting the correct use of the available tools.

Validation

To validate the changes in this pull request, you can run each example script individually to see the tool in action.

For example, to run the bash_example.py script, execute the following command from the project's root directory:

python examples/tools/bash_example.py

Each script is self-contained and will print the results of its operations to the console.

Linked Issues

No linked issues.

@CLAassistant
Copy link

CLAassistant commented Sep 12, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants