Tutorial#

lepton-tutorial is an interactive tour: each lesson explains a topic and suggests a command to run for real. It is offered once after installation and runs any time. These are its lessons, generated from the tutorial itself, with the key bindings from the dotfiles.

1. Welcome#

Lepton is a Unix-like system whose userland is written in Elixir and runs on the BEAM as PID 1. Everything you'll use - the shell, editor, multiplexer, git - is configured from your dotfiles.

Try:

neofetch

2. Files and directories#

The usual tools work: ls, cd, mkdir, cp, mv, rm, cat, tree, find. Your zsh aliases are loaded too (try l, which is ls -lah).

Try:

mkdir -p ~/tutorial && echo 'hello, lepton' > ~/tutorial/hello.txt && l ~/tutorial

3. Pipes, redirection and text tools#

Programs are BEAM processes connected by pipes. grep, sort, uniq, wc, sed, awk, cut, tr, head and tail are all here.

Try:

help | grep -i git | head -5

4. Jobs and processes#

& runs a job in the background, C-z suspends the foreground job, fg/bg/jobs manage them, and ps, kill and top work on the process table.

Try:

sleep 2 & jobs; ps

5. Services: long-running apps#

svc (also systemctl) runs apps in the background for you, like systemd: svc start NAME, svc stop NAME, svc restart NAME, svc status NAME and svc logs NAME (-f follows). A crashed service is restarted, and svc enable NAME starts it at every boot. Services run as root, so changing them takes sudo (it asks for your password); svc lists them. Two come with Lepton: hello (an example) and httpd, a web server.

Try:

sudo svc start hello && sleep 5 && svc status hello && sudo svc stop hello

6. The editor: le#

le FILE (also vim/nvim/emacs/e) is Spacemacs-style: SPC opens the leader menu (SPC f s saves, SPC f f finds a file, SPC w / splits, SPC g s is magit), jk leaves insert state, ; opens the ex prompt, and C-h/j/k/l move between windows - and into tmux panes. Try: le ~/tutorial/hello.txt (quit with SPC q q or ;q)

7. The multiplexer: tmux#

Your prefix is C-t. C-t v splits side by side (split-window -h), C-t s splits below, C-t h/j/k/l move between panes, C-t c opens a window, C-t C-h / C-l move between windows, C-t [ starts vi copy mode (v, y), and C-t d detaches - tmux attach brings it back.

8. git and GitHub#

git understands your ~/.gitconfig aliases (git st, git ci, git gl...). gh auth login stores a GitHub token; then git push/pull and gh repo, gh issue and gh pr work over HTTPS.

Try:

cd ~/tutorial && git init -q && git add . && git ci -q -m 'first commit' && git gl

9. Packages#

lpm installs Elixir/Erlang packages straight from hex.pm, compiles them inside Lepton and loads them (and any Lepton commands they define). Try: lpm search json / sudo lpm install jason Built-in apps get updates only from the signed official list: lpm official shows them, sudo lpm upgrade grep installs one and sudo lpm revert grep goes back. A package can't take over a built-in.

Try:

lpm list

10. Network#

The network comes up with DHCP. ip addr, ping, curl and the text browser www are available. With a Wi-Fi adapter, wifi scan lists networks and sudo wifi connect NAME joins one.

Try:

ip addr

11. Help#

help lists commands, man CMD describes one, keys shows every binding loaded from your dotfiles, and lepton-test runs the self-test suite. Run lepton-tutorial to see this again.

Try:

keys tmux | head -8
Generated from the source of lepton@ac55150.