CLI Commands

CLI Commands

Overview of the Cognova CLI for managing your self-hosted installation.

The Cognova CLI manages the lifecycle of your installation. All commands operate on the install directory chosen during cognova init.

Command Reference

cognova init

Interactive setup wizard. Creates the install directory, generates configuration, sets up the database, installs dependencies, and starts the app with PM2.

cognova init

The wizard steps are covered in detail in Installation.

cognova start

Starts the app using the PM2 ecosystem file in the install directory.

cognova start

Requires ecosystem.config.cjs to exist (created by init). If PM2 is not installed, you can start manually:

cd ~/cognova && node .output/server/index.mjs

cognova stop

Stops the PM2 process.

cognova stop

cognova restart

Restarts the PM2 process. Use after editing .env or other configuration.

cognova restart

cognova update

Checks for a newer version on npm, downloads it, updates source files, runs migrations, and restarts.

cognova update

What it does:

  1. Checks npm view cognova version against the installed version
  2. Creates a backup of current source files (.update-backup/)
  3. Downloads and extracts the new package
  4. Copies updated source files (preserves .env, .api-token, node_modules, ecosystem.config.cjs, logs)
  5. Syncs Claude config (skills, hooks, rules) to ~/.claude/
  6. Runs pnpm install and pnpm db:migrate
  7. Restarts the app via PM2

If any step fails, the update automatically rolls back to the backup.

After updating, run cognova reset if you want to regenerate CLAUDE.md or settings.json with any new defaults from the update.

cognova doctor

Runs a comprehensive health check across your installation.

cognova doctor

Checks performed:

CheckWhat it validates
.env fileExists in install directory
node_modulesDependencies installed
Build output.output/server/index.mjs exists
~/.claude/CLAUDE.mdAgent identity file
~/.claude/skills/Skills directory
~/.claude/hooks/Hooks directory
~/.claude/rules/Rules directory
~/.claude/settings.jsonClaude settings
Claude Code CLIclaude --version succeeds
Python 3python3 --version succeeds
PM2 processcognova process is online
Health endpointGET /api/health returns ok
DatabaseHealth endpoint reports database available
Vault directoryPath from metadata exists
VersionMatches latest on npm

Each check reports PASS, FAIL, or WARN.

cognova reset

Re-generates Claude Code configuration files. Use when you want to update your agent personality or restore config files to defaults.

cognova reset

Presents a multi-select menu:

OptionWhat it resets
CLAUDE.mdRe-runs personality prompts, regenerates ~/.claude/CLAUDE.md
SkillsRe-copies skills to ~/.claude/skills/
HooksRe-copies hooks to ~/.claude/hooks/
RulesRe-copies rules to ~/.claude/rules/
SettingsRe-generates ~/.claude/settings.json

cognova update syncs skills, hooks, and rules automatically. Use reset only for CLAUDE.md/settings regeneration or manual config recovery.

How the CLI Finds Your Installation

The CLI locates your install directory by checking:

  1. A .cognova metadata file in the current working directory
  2. A .cognova metadata file in your home directory (~/.cognova)

The metadata file is written by cognova init and contains the install path, vault path, version, and timestamps.

Deployment Options

Beyond the bare-metal CLI setup, Cognova supports: