Install Link from a release or source
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 plugins (lnk-agent,
lnk-tunnel, ...) from its own folder first and then the PATH, so two
installs on one PATH mix versions.
| Way | lnk and its plugins live in | Plugins come from | Update with |
|---|---|---|---|
| The script | ~/.lnk/bin | lnk up, lnk plugin add (signed release) | lnk upgrade |
| Cargo | ~/.cargo/bin | Selected source plugins from your checkout | install.sh --source, lnk up --source . |
| No install | target/debug | cargo build builds the core; -p selects other plugins | cargo build |
The script (a release)
The script installs a signed release, and lnk then adds and updates
its plugins from releases too.
curl -fsSL https://local.link/install.sh | sh
lnk up # asks which parts, and installs their plugins
lnk upgrade # later: lnk and its plugins, to the latest releaseCargo (from source)
Install Rust and Cargo with rustup, then run the
bootstrap from the public workspace. It installs only the CLI on your PATH,
normally in ~/.cargo/bin. Add plugins separately with the installed CLI.
# Install or update only the CLI
sh core/cli/install.sh --source
lnk up --source . # install every supported source pluginBuild prerequisites
The first source build needs your platform's compiler and development
libraries. It installs release-mode binaries rather than selecting the
programs in target/debug, and it never downloads released plugins.
Unsupported platforms are skipped according to each package's source metadata.
Update core and plugins
Run the bootstrap again to update core, including an older CLI that does
not support source installation. Run lnk up --source . again to update
plugins. 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 plugin-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 plugin installation. Plugin discovery scans only explicitly named workspaces, while builds also read their dependencies. Installing does not publish code.
Select plugins
Separate names with commas or repeat --plugin to install only named plugins. Names are executable
names without the lnk- prefix, such as agent or man, rather than
Cargo package names. Unknown names and explicitly selected unsupported
plugins are refused before any installation changes.
lnk up --source . --plugin agent,man,modelRefresh installed plugins
Use --stale to refresh only plugins 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 plugins remain uninstalled. Add --plugin to narrow the refresh.
lnk up --source . --stale
lnk up --source . --plugin agent --staleRefresh locations and failures
A changed plugin is reinstalled with Cargo into the installation where
it was found, which must have a bin folder. Unchanged executables need
no installation write. A failed build leaves that plugin in place and
stops the refresh. A dependency change whose output is identical requires
no replacement. Plugin refresh never updates core.
Without a checkout
Without a checkout, from a branch (dev is everything merged but not
released):
CARGO_NET_GIT_FETCH_WITH_CLI=true cargo install --git https://github.com/so-local/link --branch dev \
link-cli link-plugin-tunnel link-plugin-manHarnesses and connections
The source installer includes the workspace's supported harness adapters and connection
plugins. It installs Link's adapters, not the external harness programs or
accounts those adapters use. A plugin from another checkout can be installed
with cargo install --path /path/to/plugin.
Add plugins with cargo
With a Cargo install, use lnk up --source . for all source plugins,
or add --plugin <name> for selected plugins. Plain lnk up and
lnk plugin add use released plugins. Work branches keep the last released version, so
those download that version's released plugins next to your source-built
lnk, and so does the "Install it?" offer of a command whose plugin is
missing. Don't run lnk upgrade either, 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-plugin-man
./target/debug/lnk --version
./target/debug/lnk plugin listBuild other desired packages with cargo build -p <package>. Whole-workspace
builds include Linux-only VM libraries and do not build on macOS. For all
plugins supported on your host, use the installed source workflow above. A lnk built from source never installs a released plugin of Link's
tools on its own. Without lnk-link-scheduler, lnk-link-run 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 --yes # removes ~/.lnk/bin/lnk and its plugins
sh core/cli/install.sh --source
lnk 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 plugin
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 | sh
lnk up
lnk agent startCheck it worked
One lnk should be on the PATH, with its plugins beside it:
type -a lnk
lnk plugin list # its plugins
lnk --version # its version, where it runs from, and any other lnk on the PATHIf 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 plugin won't install, is in
Troubleshooting. Install options
(LNK_INSTALL_DIR, LNK_VERSION, ...) are in
Configuration.