Explore repositories, select files, and copy code context for AI agents in seconds.
A lightweight web-based tool for exploring directory structures across multiple repositories and quickly extracting file contents for development workflows.
This tool is especially useful when working with AI coding assistants or AI agents, allowing developers to quickly browse a project, select relevant files, and copy their contents into prompts.
Built with PHP (backend) and Vue.js (frontend). Designed to be self-hosted, simple, and fast.
When working with AI coding tools, developers often need to:
- inspect a repository structure
- select a few relevant files
- copy file contents
- provide them as context to an AI assistant
Doing this manually is slow and repetitive.
Directory Structure Viewer solves this by providing:
- a quick way to browse repositories
- a workspace to collect relevant files
- instant access to file contents
- easy copy/download functionality
This makes it much easier to prepare context for AI agents.
- Browse multiple repositories or base directories
- View directory structures in a tree layout
- Select files and add them to a working space
- Preview file contents directly in the browser
- Download individual files or selected files
- Quickly copy code snippets for use with AI prompts
- Lightweight architecture (no database required)
- Token-based authentication
- Simple JSON-based configuration
- PHP 7.4 or newer
- Web server (Apache, Nginx, Caddy, etc.)
No database required.
Clone the repository:
git clone https://github.com/cloudpad9/directory-structure-viewer.git
cd directory-structure-viewerCreate runtime configuration files:
cp users.example.json users.json
cp tokens.example.json tokens.json
cp auth_tokens.example.json auth_tokens.jsonEnsure the web server has write permission for these files.
Example:
chmod 664 *.jsonPlace the project in your web server directory.
Example:
/var/www/html/directory-structure-viewer
Then open the application in your browser:
http://localhost/directory-structure-viewer
The application uses token-based authentication.
Workflow:
- User logs in using username and password
- The server generates a secure authentication token
- The token is used for subsequent API requests
- Tokens automatically expire after a configurable time
Authentication data is stored in:
users.json
auth_tokens.json
- Passwords are stored using bcrypt hashing
- Login attempts are rate limited
- Authentication tokens are cryptographically secure
- Tokens automatically expire
For production deployments, it is recommended to:
- enable HTTPS
- optionally protect the app using web server authentication
- restrict access using IP whitelisting
.
├── api.php
├── change_password.php
├── index.html
├── users.example.json
├── tokens.example.json
├── auth_tokens.example.json
├── .gitignore
└── README.md
Runtime data is stored in JSON files.
| File | Purpose |
|---|---|
| users.json | User accounts |
| tokens.json | Login attempt tracking |
| auth_tokens.json | Active authentication tokens |
These files are ignored by Git via .gitignore.
A common workflow when working with AI coding assistants:
- Open the repository in Directory Structure Viewer
- Browse the project structure
- Select the files relevant to the task
- Add them to the working space
- Copy or download the file contents
- Provide them as context to an AI agent
This makes it much easier to prepare structured input for AI tools.
- Preparing project context for AI coding assistants
- Exploring unfamiliar codebases
- Quickly copying relevant source files
- Lightweight internal developer tooling
- Remote repository browsing
Contributions are welcome.
If you'd like to improve the project:
- Fork the repository
- Create a feature branch
- Submit a pull request
MIT License
