sxcli.devSimple Extensible CLI

$C>sxcli-fw

Simple Extensible CLI — a Go framework for command-line tools and services, built around one idea: your configuration struct is your entire interface.

Every field is at once a command-line argument, an environment variable, and a config-file key — merged with clear precedence, validated strictly, and handed to your code filled in.

services + injectionordered lifecycleslog sinkswindows SCMbusybox-style applets
terminal
sh
$ go get sxcli.dev/fw
main.go
go
import (
    fw "sxcli.dev/fw"
    _  "sxcli.dev/fw/sink/console"
    _  "sxcli.dev/fw/configfmt/yaml"
)

func main() { fw.Main() }
▼ features

# features

argv[0] dispatch

Busybox-style symlink dispatch or first-argument subcommands — one binary, many applets.

dependency injection

Declare dependencies with struct tags; instances are resolved, ordered and injected before anything runs.

unified configuration

defaults < config files < environment < arguments, driven by one struct per service. JSON native, YAML shipped, formats pluggable.

ordered lifecycle

Configured → Start → Run → Stop in dependency order, reverse-order shutdown, sequential by design.

slog logging

Pluggable sinks: console, file, syslog/journald. Startup records are buffered and replayed, never lost.

cross-platform

One codebase, Unix and Windows alike: platform-aware argument sourcing, config locations (/etc, XDG, %ProgramData%) and log sinks.

windows service

The same applet runs as a console process or under the SCM — console-mode service debugging comes for free.

▲ intro▼ how it works

# how it works

register

init() registers services and applets

resolve

dispatch picks the applet; its dependency closure is resolved

configure

config structs filled from args, env and files

start

Starters run in dependency order

run

the applet takes over; reverse-order Stop afterwards

Read the docs →Browse the demos
▲ features