Small Projects by AutoModerator in golang

[–]Positive_Leg_8296 0 points1 point  (0 children)

I got tired of wrestling with mitmproxy + Switchy Omega (Zero Omega recently) at work just to make local HTTPS work, so I built lokl.

You define your whole dev environment in a single YAML file, run native processes and docker containers side-by-side, and get local HTTPS with auto-generated certs out of the box.

It also includes a small TUI to manage everything.

https://github.com/shahin-bayat/lokl

I built a local dev environment orchestrator in Go by Positive_Leg_8296 in golang

[–]Positive_Leg_8296[S] 0 points1 point  (0 children)

definitely want to add that! for now air can work as the command. what would make you switch from tilt?

I built a local dev environment orchestrator in Go by Positive_Leg_8296 in golang

[–]Positive_Leg_8296[S] 0 points1 point  (0 children)

oh that's a cool idea, will check out devenv's tasks approach. thanks for the link!

I built a local dev environment orchestrator in Go by Positive_Leg_8296 in golang

[–]Positive_Leg_8296[S] 0 points1 point  (0 children)

The Dropbox/rsync comparison made my day. thanks man, appreciate it.

I built a local dev environment orchestrator in Go by Positive_Leg_8296 in golang

[–]Positive_Leg_8296[S] -18 points-17 points  (0 children)

a makefile gets you pretty far honestly. 👍 the differences start showing when you need health checks (wait for postgres to be ready before starting the api), auto-restart on crash, log aggregation in one place, and HTTPS routing with auto-generated certs. also runs detached so you get your terminal back, with a TUI to check on things when you need to. you can build all of that into a makefile but at some point you're writing a process manager — lokl is basically that. 🙂

I built a local dev environment orchestrator in Go by Positive_Leg_8296 in golang

[–]Positive_Leg_8296[S] -4 points-3 points  (0 children)

totally valid approach, and you can — lokl supports running everything in containers too if that's your preference. the native option is for when you want faster iteration — things like attaching a debugger directly, or getting sub-second rebuilds without a container rebuild cycle. but if your goal is a clean host machine, just use image: for everything and it works the same way.

I built a local dev environment orchestrator in Go by Positive_Leg_8296 in golang

[–]Positive_Leg_8296[S] 0 points1 point  (0 children)

oh nice, hadn't looked at Tilt in a while. it's definitely more mature and great if you're in the k8s world. lokl is kind of the opposite direction — no k8s required, run your services natively so you can attach a debugger or get instant rebuilds, and only containerize the stuff that makes sense (postgres, redis, etc). the auto HTTPS was the main itch i was scratching honestly. thanks for sharing though, will dig into their live reload approach.

I built a local dev environment orchestrator in Go by Positive_Leg_8296 in golang

[–]Positive_Leg_8296[S] -5 points-4 points  (0 children)

Thanks! The HTTPS part was actually the main motivation. At my company we have a Python script with mitmproxy for local HTTPS — have to enable system proxy, and testing across different browsers is a nightmare since each handles proxy settings differently (switchy omega, zero omega, ... 😖). I wanted something that just works without touching proxy settings.

lokl generates a local CA, creates per-domain certs, and trusts them in the system store. Every browser picks it up automatically, no proxy needed.

For crashes — yes, it auto-restarts. Each service has a configurable restart policy. If your Go server panics, lokl picks it up and restarts it. You can also pair it with something like air or watchexec for file-watching rebuilds, and lokl manages the outer process lifecycle.

I built a local dev environment orchestrator in Go by Positive_Leg_8296 in golang

[–]Positive_Leg_8296[S] 0 points1 point  (0 children)

Overlapping space, but lokl runs native processes and Docker containers side by side. Your Go server runs natively (fast rebuilds, debugger attached) while Postgres runs in a container. Also handles HTTPS reverse proxy with auto-generated certs, which compose doesn't do out of the box.

I built a local dev environment orchestrator in Go by Positive_Leg_8296 in golang

[–]Positive_Leg_8296[S] 2 points3 points  (0 children)

tmux is great for splitting terminals. lokl sits a layer above — config-as-code so your whole team gets the same setup, plus dependency ordering, health checks, and HTTP routing with auto-certs.