A minimal CLI HTTP file explorer
Project description
fexp
A minimal CLI to serve a simple HTTP backend for browsing and uploading files.
Install
You can install fexp via pip:
pip install fexp
CLI
fexp [--host HOST] [--port PORT] [--root ROOT] [--quiet] [--upload] [--cors]
--host(default: 127.0.0.1)--port(default: 8765)--rootroot directory to expose (default: $PWD)--quietdisable logging output (default: false)--uploadenable upload support (default: false)--corsenable CORS (default: false)
Web UI
A minimal web UI is available at:
GET /path/to/dir— opens a simple file manager page
Features:
- Navigate directories with breadcrumbs
- Click files to preview (text) or open in a new tab
- Upload files into the current directory (requires
--upload)
HTTP API
List Directory
List the contents of a directory in JSON format:
GET /path/to/dir?json=1
Response:
{
"path": "/path/to/dir",
"items": [
{
"name": "file.txt",
"type": "file",
"size": 1024,
"mtime": 1234567890.0
},
{
"name": "subdir",
"type": "dir",
"size": 4096,
"mtime": 1234567890.0
}
]
}
Download File
Download a file:
GET /path/to/file.txt
The file will be served with the appropriate Content-Type header based on the file extension.
Upload File (requires --upload)
Upload a file using multipart form data:
POST /path/to/destination/dir
Content-Type: multipart/form-data
# Form field name must be "file"
curl -X POST http://127.0.0.1:8765/dest/dir \
-F "file=@/path/to/local/file.txt"
Upload a file using raw binary data:
POST /path/to/destination/dir?filename=file.txt
Content-Type: application/octet-stream
curl -X POST "http://127.0.0.1:8765/dest/dir?filename=file.txt" \
--data-binary "@/path/to/local/file.txt"
Optional Query Parameters:
overwrite=1— Overwrite existing files (default:0)
Response (201 Created):
{
"path": "/dest/dir/file.txt",
"size": 1024
}
Error Response (409 Conflict):
{
"error": "File exists",
"path": "/dest/dir/file.txt"
}
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fexp-1.0.0.tar.gz.
File metadata
- Download URL: fexp-1.0.0.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09539e91629976ab947c3bfd5e3adf075ca4f44c4aff6f238631427cac6ea2e6
|
|
| MD5 |
9c4121980fb14f519fa646d3057fa00c
|
|
| BLAKE2b-256 |
9c4ee718048ba8ad160a051bd673176295160768903629f2109cb2f9fcb7478a
|
File details
Details for the file fexp-1.0.0-py3-none-any.whl.
File metadata
- Download URL: fexp-1.0.0-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62c5b2ed929524867370077abc618496f5c49bd8e358c6345c6d4a2b1abc4d14
|
|
| MD5 |
f381aca8835c6c48cb7e092b53605b07
|
|
| BLAKE2b-256 |
ef1e444b558d30ed9a64dfc66162dda365243a40661c9e2c173bd0bcf203de65
|