A simple, fast, and modern file and directory server with a built-in terminal UI, powered by Bun.
yeet offers a robust and user-friendly solution for serving files and directories, packed with powerful features:
- High-Performance File Serving: Experience blazing fast delivery of files and directories, powered by Bun.
- Optimized for Web Applications & Rapid Prototyping: Seamlessly serve built Single Page Applications (SPAs) like those from Vite, React, Vue, or Angular.
yeetsimplifies development by providing instant serving with automaticindex.htmlfallbacks. Crucially, when authentication is enabled,yeetautomatically provides themed login and signup pages, handling the entire authentication flow for your web application out-of-the-box. This allows you to focus on your application logic without worrying about building or integrating authentication infrastructure. - Integrated Secure Authentication & User Management: Get built-in JWT-based authentication, user login/signup, and comprehensive user management (create, delete, change password, permissions) via an intuitive Terminal UI. This allows you to quickly scaffold and serve web projects with secure access control from day one, without writing a single line of authentication code for your frontend.
- User Login & Signup: Users can securely log in, and new users can sign up (configurable).
- Role-Based Access Control: Implement a path-based permission system to precisely control user access to specific directories.
- Interactive Terminal UI (TUI): A beautiful and intuitive TUI for comprehensive server and user management, including:
- Creating and deleting users.
- Changing user passwords.
- Managing user permissions with ease.
- Customizable Web Interface:
- Modern Directory Listing: Enjoy a sleek, dark-themed, and browsable directory listing.
- Theming Support: Personalize the web interface with a variety of built-in themes.
- Folder Download: Easily download entire folders as ZIP archives.
To install yeet globally, download or clone this repository and run the install.sh script:
git clone https://github.com/fractal-solutions/yeet.git
cd yeet
chmod +x install.sh
./install.shThis script will:
- Check for Bun runtime and install it if not found (using
npmorcurl). - Build the
yeetexecutable. - Move the executable to
~/.local/bin. - Automatically add
~/.local/binto your shell's PATH (for bash/zsh).
After installation, please restart your terminal or run source ~/.bashrc (or source ~/.zshrc) for the changes to take effect.
Once installed, you can run yeet from any directory.
yeet [options] [path][path]: The file or directory you want to serve. Defaults to the current directory (.).--port=<port_number>: Specifies the port on which the server will listen. Defaults to3000or the value of thePORTenvironment variable.
These options are only relevant when --auth is enabled.
--auth: Enables JWT-based authentication, protecting all file serving and activating user management features in the TUI.--no-signup: When used with--auth, this disables the public signup page, meaning new users can only be created via the TUI.--session=<duration>: Sets the JWT session expiration time. Examples:15m(15 minutes),1h(1 hour),3d(3 days),30s(30 seconds). If not provided, sessions default to1h.
--title="<Your Title>": Sets a custom title that will be displayed on the login, signup, and explorer pages. Defaults toyeet.--theme=<theme_name>: Applies a visual theme to the web interface. Available themes:default: The standard dark theme.blue: A cool blue-toned dark theme.green: A calm green-toned dark theme.dark: A very dark, high-contrast theme.light: A bright, light-mode theme.zen: A calm, minimalist theme with soft greens and grays.glass: A theme with subtle transparency, giving a frosted glass effect.aero: A vibrant theme with gradients and a slightly metallic, modern feel.matrix: A dark theme with neon green accents, reminiscent of the Matrix movie.solarized: An eye-friendly theme with a carefully selected color palette. Defaults todefault.
yeet is ideal for quickly serving static web applications, Single Page Applications (SPAs), or individual HTML files.
- Serving a Build Directory: Point
yeetto your project's build output directory (e.g.,dist,build,public) to instantly serve your compiled Vite, React, Vue, or Angular applications.yeetwill automatically serveindex.htmlfor directory requests.yeet ./dist
- Serving an HTML File: Directly serve a specific HTML file.
yeet ./my-app/index.html
When you start the server, you will be greeted by the TUI. This is your main control panel.
- Create User: (Auth only) Add a new user to the system.
- Manage Users: (Auth only) Enter the user management menu to edit existing users.
- Exit Server: Gracefully shuts down the server process.
When you run with the --auth flag, all file serving is protected. Users accessing the server from a web browser will be redirected to a login page. The TUI becomes your admin panel.
From the Manage Users menu, you can select a user to perform the following actions:
- Manage Permissions: Enter the permissions editor for that user.
- Change Password: Update the user's password.
- Delete User: Permanently remove the user from the system.
The permission system is path-based. Each user has a list of paths they are allowed to access. A user can access a path if it or any of its parent directories are in their permission list.
Example:
A user with the permissions ["/docs", "/images/cats"]:
- ✅ Can access
/docs/guide.pdf - ✅ Can access
/images/cats/fluffy.jpg - ❌ Cannot access
/videos/funny.mp4 - ❌ Cannot access
/images/dogs/buddy.png
By default, a new user is given permission to /, which grants access to everything.
Managing Permissions in the TUI:
- Navigate to
Manage Usersand select a user. - Choose
Manage Permissions. - You will see a list of the user's current permissions.
- Add Permission: Prompts you to type a new path (must start with
/). - Remove Permission: Opens a multi-select prompt allowing you to check which paths to remove from the user's list.
The bun start command executes the tui.ts file. This script is the main entry point and launches the interactive terminal UI. It then spawns the actual Bun server (index.ts) as a background process. The TUI then acts as a controller, sending API calls to the local server to manage users and shutting down the server process when you exit.