This guide walks you through cloning the repo, installing dependencies, running the test suite, and manually testing all features in the browser.
- Git
- Python 3.9+
- pip
git clone https://github.com/cloudpad9/directory-structure-viewer-python.git
cd directory-structure-viewer-pythonpython3 -m venv .venv
source .venv/bin/activate # macOS / Linux
# .venv\Scripts\activate # Windowspip install -e ".[dev]"This installs the package in editable mode along with all runtime and dev dependencies (fastapi, uvicorn, bcrypt, python-multipart, pytest, httpx).
pytest tests/ -vExpected output — 128 passed:
tests/test_auth.py::test_hash_and_verify PASSED
tests/test_auth.py::test_login_success PASSED
...
128 passed in ~8s
To run a specific test file:
pytest tests/test_block_helpers.py -v
pytest tests/test_file_processor.py -vdsviewer --no-auth --openThe --open flag opens the browser automatically. If it doesn't open, navigate to:
http://localhost:9876
dsviewerOpen http://localhost:9876 — a login dialog will appear. Use the default credentials:
Username: admin
Password: admin123
# Use a different port if 9876 is already taken
dsviewer --no-auth --port 8080 --open
# Run without opening the browser
dsviewer --no-auth
# See all available options
dsviewer --helpIf the dsviewer command is not found, run it directly with:
python -m dsviewer --no-auth --openWork through the following flows in order to verify all features.
- Type a directory path into the Path input — e.g.
/home/youruser/directory-structure-viewer-python - Click Analyze
- The left pane should populate with a list of files and directories
- Check one or two
.pyor.jsfiles in the left pane - Click View
- The right pane should show the merged content of the selected files
- Check one
.js,.php, or.vuefile - Click Outline
- The right pane should show only function/class signatures — no implementation body
- In the middle pane, click the dropdown arrow next to a file name → select List
- A list of functions/methods detected in that file should expand
- Check individual blocks → click View to fetch only those blocks
- Check a few files in the middle pane
- Type a keyword into the Search field → click Search
- The right pane should show matched lines with a preview for each match
- Type the search term into Search and the replacement into Replace
- Click Replace
- The right pane should show a summary: number of files changed and total replacements made
- Click the dropdown next to a file → select Edit
- The Ace Editor opens with syntax highlighting
- Make a small change → press
Ctrl+S - A success toast notification should appear
- Click the dropdown → Rename → enter a new filename → confirm
- The file should appear under its new name in the list
- Click the dropdown → Delete → confirm in the dialog
- The file should be removed from the list
- Check multiple files → click Download
- Single file: downloads directly with the correct MIME type
- Multiple files: downloads a
.ziparchive containing all selected files
To change the admin password interactively:
dsviewer --change-passwordFollow the prompts in the terminal. After changing, restart the server and verify login works with the new password.
It is recommended to test this on a clean machine or VM to avoid affecting your current environment.
# Check bash syntax without executing
bash -n install.sh
# Run the installer — creates ~/.dsviewer/
bash install.shAfter installation, open a new terminal and run:
dsviewer --no-auth --openTo uninstall:
rm -rf ~/.dsviewer
# Remove the PATH line from ~/.bashrc and/or ~/.zshrcWhen a new version is released, update the installation with:
dsviewer --updateThis pulls the latest code from GitHub and replaces the application files under ~/.dsviewer/. Your data directory (~/.dsviewer/data/) and credentials are not affected.
Alternatively, run the update script directly:
curl -fsSL https://raw.githubusercontent.com/cloudpad9/directory-structure-viewer-python/main/update.sh | bashAfter updating, restart any running instance:
# If running in the foreground — stop it with Ctrl+C, then start again
dsviewer --no-auth --openTo confirm the installed version:
dsviewer --versionNote: If you are developing locally with an editable install (
pip install -e .), the--updatecommand will overwrite your working copy. Usegit pullinstead to update while keeping your local changes.
| Symptom | Likely cause | Fix |
|---|---|---|
ModuleNotFoundError: bcrypt |
Dependencies not installed | Run pip install -e ".[dev]" |
Address already in use on port 9876 |
Another process is using the port | Run lsof -i :9876 and kill the PID, or use --port 8080 |
| Login dialog persists after correct credentials | API call is failing | Open DevTools (F12) → Network tab → inspect the /api response |
| Analyze returns no files | Path doesn't exist or is not readable | Try a path like /tmp or your home directory |
dsviewer: command not found |
Entry point not on PATH | Use python -m dsviewer --no-auth instead |
| Outline returns empty content | File has no detectable functions or classes | Try with a .js or .vue file that contains at least one function |
| Changes not saved after Ctrl+S | File is not writable | Check file permissions with ls -l <file> |