Open-source tool can safely process prompt up to around15,000 characters per request.
Get-ChildItem -Recurse -Exclude 'package-lock.json', 'output.txt', 'package.json', '.env', '.gitignore', 'README.md' |
Where-Object {
$_.FullName -notlike '*\coverage\*' -and
$_.FullName -notlike '*\ui\*' -and
$_.FullName -notlike '*\node_modules\*' -and
$_.FullName -notlike '*\seed\*' -and
$_.Extension -notin '.png', '.svg', '.jpg', '.jpeg' -and
$_.FullName -notlike '*\tests\*' -and
$_.FullName -notlike '*\__tests__\*' -and
$_.FullName -notlike '*\.test.*' -and
$_.FullName -notlike '*\.spec.*' -and
-not $_.PSIsContainer
} |
ForEach-Object {
"======================================================================="
"{0}`n`n{1}`n" -f $_.FullName, (Get-Content $_.FullName -Raw)
} |
Out-File -FilePath 'output.txt' -Encoding utf8
function Get-Tree {
param (
[string]$Path = $null,
[int]$IndentLevel = 0
)
if (-not $Path) {
$Path = Read-Host "Enter the path (press Enter for the current directory):"
if (-not $Path) {
$Path = (Get-Location).Path
}
}
$indentation = "│ " * $IndentLevel
$currentDirectory = Get-Item $Path
# Exclude node_modules and build directories
$excludedDirectories = @("node_modules", "build","images","fonts","logo","favicon","illustrations","icons","background")
if ($currentDirectory.Name -notin $excludedDirectories) {
Write-Output "$indentation├── $($currentDirectory.Name)/ [Folder]"
$subDirectories = Get-ChildItem -Path $Path -Directory
$subFiles = Get-ChildItem -Path $Path -File
foreach ($subDirectory in $subDirectories) {
Get-Tree -Path $subDirectory.FullName -IndentLevel ($IndentLevel + 1)
}
foreach ($subFile in $subFiles) {
Write-Output "$indentation│ └── $($subFile.Name)"
}
}
}
# Run the script
Get-Tree