ncode CLI Get started
Install
The ncode command installs into your home folder with one line. It needs no administrator password and touches nothing outside its own folders.
One-line install#
curl -fsSL https://code.llmotions.com/install.sh | shThe installer:
- checks that the Mac runs macOS 15 or later on Apple silicon (arm64), and stops with a message otherwise;
- downloads the release for version 0.3.0 and checks its SHA-256 checksum against the one pinned in the installer; on a mismatch it stops and changes nothing;
- puts the release in
~/.local/share/ncodein one step, so an interrupted or failed install leaves the release you had (see Update), clears any quarantine mark, and writes a smallncodecommand in~/.local/bin; - prints the installed version, the one line that puts the command on your
PATHif it is not there yet, and what to do next:
Installed ncode 0.3.0: ~/.local/bin/ncode -> ~/.local/share/ncode ncode 0.3.0 Next: ncode settings providers (add your model key; ncode has no built-in key)
It never touches your conversations, settings or keys: those live in the ncode data folder, ~/Library/Application Support/SwarmCode, which the desktop app shares.
To install somewhere else, set a prefix. The release then goes to <prefix>/share/ncode and the command to <prefix>/bin:
curl -fsSL https://code.llmotions.com/install.sh | NCODE_PREFIX="$HOME/tools" sh
This screenshot is the 0.1.0 installer; later versions also print the installed version and the next step, as shown above.
Check that it works#
ncode --versionThis prints ncode 0.3.0. ncode --help prints every option, with examples, the short flags and the exit codes. Both are answered before anything else starts, so they work even while the desktop app is open. The plain words work too: ncode version, ncode help and ncode doctor (short for ncode config doctor). Any other single word that is not a folder is refused with ncode: '<word>' is not a folder or a command. Did you mean --help? (To open a folder named <word>, use ./<word>.).
Put ~/.local/bin on your PATH#
If your shell says command not found: ncode, the folder is not on your PATH yet. The installer tells you when that is the case and prints the exact line to run; it never edits your shell files itself.
For zsh, the default shell on macOS:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrcFor bash:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profileUpdate#
Run the same line again:
curl -fsSL https://code.llmotions.com/install.sh | shIt replaces the release without a gap: the new release is unpacked beside the old one, the two are swapped, and if anything fails along the way the old release is put back. Your conversations, settings and keys stay where they are, so nothing is lost. Quit any running ncode session first, because a running session needs the files of the release it started from.
Uninstall#
curl -fsSL https://code.llmotions.com/install.sh | sh -s -- --uninstallThe installer first lists exactly what it will remove and asks:
ncode: these paths will be removed: ~/.local/bin/ncode ~/.local/bin/swarmcode ~/.local/share/ncode Remove these? [y/N]
The answer is read from your terminal, so it works even though the script comes through a pipe. Anything but y removes nothing. In a script with no terminal, add --yes (... | sh -s -- --uninstall --yes); without it the installer stops with ncode: --uninstall needs --yes when not run from a terminal. If a release from before the rename is still in ~/.local/share/swarmcode, it is listed and removed too. By hand, the same is:
rm -f ~/.local/bin/ncode ~/.local/bin/swarmcode
rm -rf ~/.local/share/ncode ~/.local/share/swarmcodeWarning Neither way deletes your data. ~/Library/Application Support/SwarmCode holds your conversations, settings and provider keys, and the desktop app uses the same folder. Delete it only if you are removing the app too and want everything gone.
Installer options#
When you run the installer from a pipe, put its options after sh -s --. It checks every option before it does anything, so a typo can never install or remove something:
| Option | Does |
|---|---|
--help, -h | prints the usage and exits; nothing is installed or removed (also --uninstall --help) |
--uninstall | lists what it removes, asks, then removes it |
--yes | with --uninstall only: do not ask |
Any other option exits with code 2 and ncode: unknown option '<x>'. Run with --help.
The old command name#
ncode was called by another name before this release, and its command was swarmcode. The installer also writes swarmcode as an alias: it runs ncode with the same arguments and, in a terminal, prints a one-line note that the name has changed. Scripts that call swarmcode keep working; move them to ncode when you can, because the alias will be removed in a later release. The older SWARM_… environment variables are still read too (see Environment variables).
Developer preview: why it opens without a warning#
ncode 0.3.0 is a developer preview. It is not notarized by Apple, because notarizing needs a paid Apple Developer ID, which ncode does not have yet.
macOS checks an unnotarized program when it carries a quarantine mark, which browsers and Mail add to everything they download. curl adds no such mark, so a release installed by the one-line installer starts without a Gatekeeper prompt. As a precaution the installer also removes any quarantine mark from the release it installs. A release you download with a browser and unpack yourself is quarantined, and macOS refuses to run its programs until the mark is removed (see the manual install below).
Install the release by hand#
If you prefer not to pipe a script into sh, download ncode-0.3.0-darwin-arm64.tar.gz directly:
cd ~/Downloads
curl -fLO https://code.llmotions.com/downloads/ncode-0.3.0-darwin-arm64.tar.gz
shasum -a 256 ncode-0.3.0-darwin-arm64.tar.gzCompare the printed checksum with the one on the changelog; stop if they differ. Then unpack it and put it where the installer would:
tar -xzf ncode-0.3.0-darwin-arm64.tar.gz
mkdir -p ~/.local/share ~/.local/bin
rm -rf ~/.local/share/ncode
mv ncode-0.3.0 ~/.local/share/ncode
chmod 0600 ~/.local/share/ncode/releases/COOKIE
ln -sf ~/.local/share/ncode/bin/ncode ~/.local/bin/ncodeIf you downloaded the archive with a browser instead of curl, clear the quarantine mark before the first run, or macOS blocks the programs inside:
xattr -dr com.apple.quarantine ~/.local/share/ncodeBuild from source#
For contributors. You need mise, which installs the pinned Erlang, Elixir and Rust versions, plus a C11 compiler, python3 and, on macOS, the Xcode command line tools (clang and codesign).
git clone https://github.com/zaalipro/swarm-code-cli.git
cd swarm-code-cli
mise install
mise exec -- mix setup
scripts/install.shscripts/install.sh builds the release (including the native terminal helper) and installs it exactly like the one-line installer, into ~/.local/share/ncode and ~/.local/bin; NCODE_PREFIX changes the prefix. Re-run it after pulling changes.
Note The full contributor gate, mix precommit, is for maintainers: it re-derives the shared engine from a checkout of the desktop app's repository at a pinned commit, which is not public. Building, installing and running the tests do not need it.