ncode

Desktop docs Using with the CLI

ncode Desktop Maintain

Using with the CLI

ncode also comes as a terminal app, ncode, for people who live in the terminal. It runs the same engine and reads and writes the same data as the desktop app, so you can start a conversation in one and continue it in the other.

Install it with one line:

sh
curl -fsSL https://code.llmotions.com/install.sh | sh

See the CLI docs for everything about the terminal app, especially Install and Works with the desktop app.

One machine, one database#

The desktop app and the ncode command on the same Mac use the same database, ~/Library/Application Support/SwarmCode/swarm_code.db. Your projects, conversations, settings, keys and schedules are the same in both: a conversation started in one can be continued in the other.

Only one of them may have the database open at a time. Three rules keep it safe:

  1. Quit the app before you start a ncode session. While the app is running under your user account, every ncode command except --version and --help refuses to start and exits with status 3, naming the running app. Starting it with a different home folder does not change this.
  2. Exit ncode before you reopen the app. The app does not check for a running ncode session, so this rule is yours to keep.
  3. Keep both on the same version. If ncode says the database needs an upgrade, open the app once and quit it. If it says the database is newer than it understands, update ncode.

What only the app does#

Some background work runs only inside the desktop app, and only while it is running:

  • Scheduled tasks fire only in the app. ncode can list, create, edit, switch on or off and "run now" a task, but a schedule never fires from the terminal.
  • Storage retention (deleting or pruning old sessions on a schedule) runs once a day in the app. The settings are shared, but ncode does not apply them.
  • Workflow runs left behind by a crash are tidied up by the app.

A typical day with both#

  1. Work in the desktop app during the day; its schedules and retention run while it is open.
  2. Before a terminal session (over SSH, in a tmux pane), quit the app with ⌘+Q.
  3. Run ncode. Your projects, conversations and keys are all there.
  4. When you are done, exit ncode, then open the app again. The conversations you had in the terminal are in the sidebar.

Differences to expect#

The two apps share their features but not their screens:

In the desktop appIn the terminal app
approval buttons on cardssingle-key answers
the agents pane with tree, grid, timeline and changesa side panel and an agents overlay
settings in the Settings windowsettings in a full-screen settings view, and ncode config for scripts
schedules fireschedules can be managed but do not fire