Simple directory server with file info
Serve local directories with file sizes, dates, and inline preview.
- 📁 Directory listing — File sizes and modification dates at a glance
- 🧭 Breadcrumb navigation — Click through the path hierarchy
- 👁️ Inline preview — PDFs, images, and text files display in browser
- 🎨 Themeable — 6 color schemes (Auto, Nord, Squirrel, Archlinux, Monokai, Zenburn)
- 🔒 Basic Auth — Optional authentication via
--author--auth-file(htpasswd/bcrypt) - 🐚 Shell completions — Fish, Bash, Zsh, and PowerShell supported
- ⚡ Zero dependencies — Single binary, no runtime required
go install github.com/axelrhd/gosrvdir/cmd@latestgit clone https://github.com/axelrhd/gosrvdir.git
cd gosrvdir
just deploy # Builds, installs to ~/.local/bin, and sets up shell completionsThe deploy command will:
- Build the binary
- Install to
~/.local/bin/ - Interactively ask which shell completions to install (auto-detects your shell)
For non-interactive installation:
just deploy-bin # Binary only, no completions
just deploy-completion-for fish # Install completions for specific shellgosrvdir # Serve current directory on port 8080
gosrvdir ./mydir # Serve mydir on port 8080
gosrvdir -p 9000 # Serve current directory on port 9000
gosrvdir -p 9000 ./mydir # Serve mydir on port 9000
gosrvdir --host 127.0.0.1 # Only listen on localhost
gosrvdir --theme nord # Use Nord theme
gosrvdir --auth admin:secret # Basic Auth (inline, single user)
gosrvdir --auth-file .htpasswd # Basic Auth (htpasswd file)| Flag | Default | Description |
|---|---|---|
-p, --port |
8080 |
Port to listen on |
--host |
0.0.0.0 |
Host/interface to bind |
--theme |
auto |
Color theme (auto, nord, squirrel, archlinux, monokai, zenburn) |
--auth |
— | Inline Basic Auth (user:password) |
--auth-file |
— | Path to htpasswd file (bcrypt) |
| Positional | . |
Directory to serve |
--auth and --auth-file are mutually exclusive. Without either flag, no authentication is required.
gosrvdir htpasswd .htpasswd admin # Add or update user (prompts for password)Completions are installed automatically with just deploy.
If you installed via go install or downloaded a binary, generate completions manually:
# Fish
gosrvdir completion fish > ~/.config/fish/completions/gosrvdir.fish
# Bash
gosrvdir completion bash > ~/.local/share/bash-completion/completions/gosrvdir
# Zsh
gosrvdir completion zsh > ~/.local/share/zsh/site-functions/_gosrvdir
# PowerShell
gosrvdir completion pwsh > ~/.config/powershell/gosrvdir.ps1
# Then add to your profile: . ~/.config/powershell/gosrvdir.ps1| Tool | File Info | Inline Preview |
|---|---|---|
python3 -m http.server |
❌ | ✅ |
miniserve |
✅ | ❌ (forces download) |
gosrvdir |
✅ | ✅ |