Skip to main content

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)
  • --root root directory to expose (default: $PWD)
  • --quiet disable logging output (default: false)
  • --upload enable upload support (default: false)
  • --cors enable 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fexp-1.0.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fexp-1.0.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

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

Hashes for fexp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 09539e91629976ab947c3bfd5e3adf075ca4f44c4aff6f238631427cac6ea2e6
MD5 9c4121980fb14f519fa646d3057fa00c
BLAKE2b-256 9c4ee718048ba8ad160a051bd673176295160768903629f2109cb2f9fcb7478a

See more details on using hashes here.

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

Hashes for fexp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 62c5b2ed929524867370077abc618496f5c49bd8e358c6345c6d4a2b1abc4d14
MD5 f381aca8835c6c48cb7e092b53605b07
BLAKE2b-256 ef1e444b558d30ed9a64dfc66162dda365243a40661c9e2c173bd0bcf203de65

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page