You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thanks for the plugin, amazing design and implementation!
I would like to ask if there is a way to have the repo files uploaded to the AI agent, so we can ask questions about the repo and even more, have the code generation follow the actual repo code style. In the same way we already have a context that is uploaded every request, we could follow the pattern and have an agent context, will all the repository data (see the script below), so questions about the repo could be answered.
I found this idea on the phind plugin on vscode.
#!/bin/bash# Set the path to your Solidity project
PROJECT_DIR="."# Set the output file name for the repository context
OUTPUT_FILE="repo_context.txt"# Function to append content to the output fileappend_to_file() {
echo"$1">>"$OUTPUT_FILE"
}
# Create an empty output fileecho"">"$OUTPUT_FILE"# Append project directory structure
append_to_file "Project Directory Structure:"
tree -d "$PROJECT_DIR"| grep -v "node_modules"| grep -v "artifacts"| sed 's/^/ /'>>"$OUTPUT_FILE"# Append list of Solidity contracts
append_to_file "\nSolidity Contracts:"
find "$PROJECT_DIR" -name "*.sol"| sed 's|^./||'|whileread -r contract;do
append_to_file " - $contract"done# Append list of test files
append_to_file "\nTest Files:"
find "$PROJECT_DIR/test" -name "*.t.sol"| sed 's|^./||'|whileread -r test_file;do
append_to_file " - $test_file"done# Append list of script files
append_to_file "\nScript Files:"
find "$PROJECT_DIR/script" -name "*.s.sol"| sed 's|^./||'|whileread -r script_file;do
append_to_file " - $script_file"done# Append contents of key project files
append_to_file "\nKey Project Files:"# Foundry configuration fileif [ -f"$PROJECT_DIR/foundry.toml" ];then
append_to_file "\n foundry.toml:"
cat "$PROJECT_DIR/foundry.toml"| sed 's/^/ /'>>"$OUTPUT_FILE"fi# Readme fileif [ -f"$PROJECT_DIR/README.md" ];then
append_to_file "\n README.md:"
cat "$PROJECT_DIR/README.md"| sed 's/^/ /'>>"$OUTPUT_FILE"fi# Deployment scripts
deployment_scripts=$(find "$PROJECT_DIR/script" -name "deploy*.s.sol")if [ -n"$deployment_scripts" ];then
append_to_file "\nDeployment Scripts:"echo"$deployment_scripts"|whileread -r script;do
append_to_file "\n $script:"
cat "$script"| sed 's/^/ /'>>"$OUTPUT_FILE"donefi
append_to_file "\nConcatenated Files:"
append_to_file "\n src files:"
find "$PROJECT_DIR/src" -type f -print0 |while IFS= read -r -d '' file;do
append_to_file "\n $file:"
cat "$file"| sed 's/^/ /'>>"$OUTPUT_FILE"done
append_to_file "\n test files:"
find "$PROJECT_DIR/test" -type f -print0 |while IFS= read -r -d '' file;do
append_to_file "\n $file:"
cat "$file"| sed 's/^/ /'>>"$OUTPUT_FILE"doneecho"Repository context created in $OUTPUT_FILE"
The text was updated successfully, but these errors were encountered:
First of all, thanks for the plugin, amazing design and implementation!
I would like to ask if there is a way to have the repo files uploaded to the AI agent, so we can ask questions about the repo and even more, have the code generation follow the actual repo code style. In the same way we already have a context that is uploaded every request, we could follow the pattern and have an agent context, will all the repository data (see the script below), so questions about the repo could be answered.
I found this idea on the phind plugin on vscode.
The text was updated successfully, but these errors were encountered: