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:
curl -fsSL https://code.llmotions.com/install.sh | shSee 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:
- Quit the app before you start a
ncodesession. While the app is running under your user account, everyncodecommand except--versionand--helprefuses to start and exits with status 3, naming the running app. Starting it with a different home folder does not change this. - Exit
ncodebefore you reopen the app. The app does not check for a runningncodesession, so this rule is yours to keep. - Keep both on the same version. If
ncodesays the database needs an upgrade, open the app once and quit it. If it says the database is newer than it understands, updatencode.
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.
ncodecan 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
ncodedoes not apply them. - Workflow runs left behind by a crash are tidied up by the app.
A typical day with both#
- Work in the desktop app during the day; its schedules and retention run while it is open.
- Before a terminal session (over SSH, in a tmux pane), quit the app with ⌘+Q.
- Run
ncode. Your projects, conversations and keys are all there. - 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 app | In the terminal app |
|---|---|
| approval buttons on cards | single-key answers |
| the agents pane with tree, grid, timeline and changes | a side panel and an agents overlay |
| settings in the Settings window | settings in a full-screen settings view, and ncode config for scripts |
| schedules fire | schedules can be managed but do not fire |