Skip to main content
CogOS provides a full command-line interface via the cogos command.

Init

Initialize the project — generates config and template files (run once):
cogos init

# Re-generate all files, overwriting existing ones
cogos init --force

# Use a custom config filename
cogos init -o configs/cogos_myproject.yaml

Build

Process text into structured memory:
# Build from a file
cogos build --input conversation.md --session user1

# Build with a preset template
cogos build --template general --text "I'm Bob" --session user1

# Build from stdin
cat notes.md | cogos build --session user1

Chat

Chat with memory-augmented responses:
# Single-shot chat
cogos chat --message "What do I like?" --session user1

# Interactive chat
cogos chat --session user1

Interactive chat commands

When in interactive chat mode (cogos chat):
CommandDescription
/build <text>Add memory inline
/schemasList registered schemas
quit / exitEnd the session

Schemas

Inspect registered schemas:
cogos schemas

Serve

Start the API server in the foreground:
# Default settings
cogos serve

# Custom host and port
cogos serve --host 0.0.0.0 --port 8000

# With preset template
cogos serve --port 8000 --template general
When invoked without a subcommand, cogos serve runs the server in the foreground (Ctrl+C to stop). For background service management, see the subcommands below.

Service management subcommands

Only one CogOS daemon can run at a time. If a daemon is already running, start will refuse to launch a new one regardless of the port specified. Use stop first, then start with a new port. Port can be set via the --port flag (highest priority) or in configs/cogos.yaml under server.port (default: 8000).
CommandDescription
cogos serve startStart as a background daemon
cogos serve start --autostartStart daemon + enable auto-start on boot (systemd)
cogos serve stopStop the daemon
cogos serve stop --remove-autostartStop daemon + disable auto-start on boot
cogos serve restartRestart the daemon
cogos serve statusShow running status, PID, uptime, memory
cogos serve logsView server logs
# Start as a background daemon (port from config, default 8000)
cogos serve start

# Specify port via flag (overrides config)
cogos serve --port 9000 start

# Start daemon + enable auto-start on boot
cogos serve start --autostart

# Check status
cogos serve status

# Stop the daemon
cogos serve stop

# Stop + disable auto-start
cogos serve stop --remove-autostart

# Restart with a different port
cogos serve --port 9000 restart

# View logs
cogos serve logs -n 100       # last 100 lines
cogos serve logs -f           # follow in real time
See Service management for details on daemon mode, auto-start, and log management.

Summary

CommandDescription
cogos initInitialize project (config + templates)
cogos buildProcess text into memory
cogos chatChat with memory
cogos schemasInspect schemas
cogos serveStart API server + Web UI (foreground)
cogos serve startStart as background daemon
cogos serve start --autostartStart daemon + enable boot auto-start
cogos serve stopStop background daemon
cogos serve statusShow daemon status