Skip to content

Latest commit

 

History

130 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚡️ Slim

Simple command to get clean HTTPS local domains for your projects

Website Go 1.25+ Platform

myapp.test        → localhost:3000
myapp.test/api    → localhost:8080
dashboard.test    → localhost:5173
app.loc           → localhost:4000

Install

curl -sL https://slim.sh/install.sh | sh

or build from source

git clone https://github.com/kamranahmedse/slim.git
cd slim
make build
make install

Requires Go 1.25 or later.

Quick Start

Create a custom HTTPs Domain for local development using slim start

slim start myapp --port 3000
# https://myapp.test → localhost:3000

To share your local project on a public URL

slim share --port 3000
# https://cheeky-panda.slim.show

Local Usage

Start or stop a local service using slim start or slim stop

slim start myapp --port 3000
slim start api --port 8080
slim stop myapp                  # stop one domain
slim stop                        # stop all domains

If you don't specify the TLD, you get a .test domain. Specify a full domain to use any TLD:

slim start app.loc --port 3000   # https://app.loc → localhost:3000
slim start my.demo --port 4000   # https://my.demo → localhost:4000

Note: Avoid .local — it's reserved for mDNS and can cause slow DNS resolution on macOS/Linux.

Route different URL paths to different upstream ports on a single domain:

slim start myapp --port 3000 --route /api=8080 --route /ws=9000

Define all services for a project in a .slim.yaml file at the project root:

services:
  - domain: myapp
    port: 3000
    routes:
      - path: /api
        port: 8080
  - domain: dashboard
    port: 5173
  - domain: app.loc
    port: 4000
log_mode: minimal  # full | minimal | off
cors: true         # enable CORS headers on proxied responses
slim up                              # start all services
slim up --config /path/to/.slim.yaml # specify a config path
slim down                            # stop all project services

Internet Sharing

Expose a local server to the internet with a public slim.show URL. Requires slim login first.

slim share --port 3000                              # random subdomain
slim share --port 3000 --subdomain demo             # https://demo.slim.show
slim share --port 3000 --password secret            # password protected
slim share --port 3000 --ttl 30m                    # auto-expires after 30 minutes
slim share --port 3000 --domain myapp.example.com   # custom domain

Browser warning page

Random-name tunnels (for example a1b2c3.slim.show) show visitors a one-time warning page before serving your content, letting them know the site is served from someone's computer and is not hosted or verified by slim. This protects the shared slim.show domain from abuse. It appears only for browser page loads.

The warning is skipped automatically for tunnels that opt out of anonymity: those with a password, a verified custom domain, or a reserved subdomain.

Programmatic clients (webhooks, curl, mobile SDKs, fetch/XHR calls, CORS preflights) are never shown the page and reach your server directly. To bypass it from a browser-like client too, send the header Slim-Skip-Browser-Warning: 1:

curl -H "Slim-Skip-Browser-Warning: 1" https://a1b2c3.slim.show/

Logs and Diagnostics

slim list                # inspect running domains
slim list --json

slim logs                # view access logs
slim logs --follow myapp # tail logs for a domain
slim logs --flush        # clear log file

slim doctor              # run diagnostic checks
$ slim doctor
  ✓  CA certificate        valid, expires 2035-02-28
  ✓  CA trust              trusted by OS
  ✓  Port forwarding       active (80→10080, 443→10443)
  ✓  Hosts: myapp.test    present in /etc/hosts
  !  Daemon                not running
  ✓  Cert: myapp.test     valid, expires 2027-06-03

Updating

Run slim update to update to latest version.

Uninstall

Remove everything: CA, certs, hosts entries, port-forward rules, config

slim uninstall

License

PolyForm Shield 1.0.0 © Kamran Ahmed

About

Give your localhost a local or public URL

Resources

Stars

2.1k stars

Watchers

7 watching

Forks

Releases

Contributors

Languages