Install lnk
Get lnk from a release, from source with cargo, or straight from a
build, and switch between them without losing your agents or files.
Three ways
Pick one and keep to it. lnk runs its modules (lnk-agent,
lnk-box, ...) from its own folder first and then the PATH, so two
installs on one PATH mix versions.
| Way | lnk and its modules live in | Modules come from | Update with |
|---|---|---|---|
| The script | ~/.lnk/exec/bin | lnk up, lnk module add (signed release) | lnk upgrade |
| Cargo | ~/.cargo/bin | Selected source modules from your checkout | install.sh --source, lnk up --source . |
| No install | target/debug | cargo build builds the core; -p selects other modules | cargo build |
The script (a release)
The script installs a signed release, and lnk then adds and updates
its modules from releases too.
curl -fsSL https://local.link/install.sh | shlnk uplnk upgradeCargo (from source)
Install Rust and Cargo with rustup, then run the
bootstrap from the repository root. It installs only the CLI on your PATH,
normally in ~/.cargo/bin. Add modules separately with the installed CLI.
sh core/cli/install.sh --sourcelnk up --source .Build prerequisites
The first source build needs your platform's compiler and development
libraries. The bootstrap installs release-mode binaries rather than
selecting the programs in target/debug, and it never downloads
released modules.
Unsupported platforms are skipped according to each package's source metadata.
Update core and modules
Run the bootstrap again to update core, including an older CLI that does
not support source installation. Run lnk up --source . again to update
modules. Both use Cargo's installation records and reuse build output.
A failure stops the command and names the package. Earlier installations
remain. Neither command starts or restarts agents.
Include another workspace
The source command also accepts module-only workspaces. Repeat --source
to include additional workspaces in the same installation:
lnk up --source . --source /path/to/addonsValidate the combined installation
All selected workspaces are checked before installation starts. Duplicate workspace paths and conflicting executable names are refused. Build output is shared in the first workspace's target directory. Core is excluded from module installation. Module discovery scans only explicitly named workspaces, while builds also read their dependencies. Installing does not publish code.
Select modules
Separate names with commas or repeat --module to install only named modules. Names are executable
names without the lnk- prefix, such as agent or man, rather than
Cargo package names. Unknown names and explicitly selected unsupported
modules are refused before any installation changes.
lnk up --source . --module agent,man,modelWhere modules go
A source-built lnk puts its modules where it is itself, so it finds
them beside it and never mixes them with a second install. Run from a
Cargo target folder, such as ./target/debug/lnk, it builds each module
with cargo build into that folder and profile. Run from a Cargo
installation's bin, such as ~/.cargo/bin, it installs each with
cargo install --root into that installation. Anywhere else it changes
nothing, and names where it is and what to run instead.
Refresh installed modules
Use --stale to refresh only modules already found beside the running
CLI or on PATH. Cargo checks source, dependencies, build scripts, compiler
and build settings, then builds changed inputs. The command compares the
resulting executable with the installed file and skips identical files.
Missing modules remain uninstalled. Add --module to narrow the refresh.
lnk up --source . --stalelnk up --source . --module agent --staleRefresh locations and failures
A changed module is replaced where lnk's modules go
(Where modules go). In a target folder, Cargo
rebuilds it in place. Unchanged executables need no installation write. A failed build leaves that module in place and
stops the refresh. A dependency change whose output is identical requires
no replacement. Module refresh never updates core.
Without a checkout
Without a checkout, from a branch (main is everything merged, released
or not):
CARGO_NET_GIT_FETCH_WITH_CLI=true cargo install --git https://github.com/so-local/link --branch main \
link-cli link-agent link-manHarnesses and connections
The source installer includes the workspace's supported harness adapters and connection
modules. It installs Link's adapters, not the external harness programs or
accounts those adapters use. A module from another checkout can be installed
with cargo install --path /path/to/module.
Add modules with cargo
With a Cargo install, use lnk up --source . for all source modules,
or add --module <name> for selected modules. A source-built lnk
records the checkout it was built from, so plain lnk up,
lnk module add and the "Install it?" offer of a missing module build
from that checkout the same way, never downloading a release. If the
checkout has moved or been deleted, they name the lnk up --source
command with the path they expected. Don't run lnk upgrade, because
it replaces the programs in ~/.cargo/bin with a release's.
No install (target/debug)
Run directly from build output when you do not want to install programs on your PATH.
cargo build -p link-cli -p link-man./target/debug/lnk --version./target/debug/lnk module listBuild other desired packages with cargo build -p <package>, or select
all workspace members with cargo build --workspace --bins.
./target/debug/lnk up --source . builds every module supported on your
host into target/debug, and ./target/debug/lnk module add <module>
builds one there. A lnk built from source never installs a released module of Link's
tools on its own. Without lnk-scheduler-tool, lnk-run-tool or
lnk-file-tool built next to it, an agent starts without that tool
and says so.
Switch between them
Your agents, settings and files (~/.lnk, ~/Link) are shared by
every install and kept by default. These are shared data folders, not
isolated production and development environments. lnk uninstall --yes
stops services. Script installations also remove their programs. Cargo
installations print a cargo uninstall command you must run to finish.
--yes only confirms the prompt. Start the agents again with
the new install, because a running agent's service points at the old
one's programs.
Script to cargo
Remove the script's programs, install with cargo as above, and start your agents again:
lnk uninstall --yessh core/cli/install.sh --sourcelnk up --source .lnk agent startCargo to the script
Remove the programs cargo installed, run the script, and start your agents again:
lnk uninstall --yesRun the complete cargo uninstall command it prints, including the module
packages. The core package is link-cli, not lnk. Keep ~/.cargo/bin on
PATH because other Rust tools use it. Then install the release:
curl -fsSL https://local.link/install.sh | shlnk uplnk agent startCheck it worked
One lnk should be on the PATH, with its modules beside it:
type -a lnklnk module listlnk --versionIf your shell remembers the previous executable, open a new terminal or
run rehash in zsh, or hash -r in bash. Another executable path means
another installation still exists. Uninstall that copy before restarting
agents with the intended installation. With two on the PATH, every lnk command in a terminal starts with a
note naming both.
More about it
What to do when two installs mix, or a module won't install, is in
Troubleshooting. Install options
(LNK_INSTALL_DIR, LNK_VERSION, ...) are in
Configuration.