Skip to main content

CLI Commands

LocalGPT provides a comprehensive command-line interface with several subcommands.

Overview

localgpt <COMMAND>

Commands:
chat Interactive multi-turn conversation
ask Single question and response
daemon Manage the background daemon
memory Memory management operations
config Configuration management
help Print help information

Global Options

localgpt [OPTIONS] <COMMAND>

Options:
-c, --config <PATH> Path to config file (default: ~/.localgpt/config.toml)
-m, --model <MODEL> Override the default model
-v, --verbose Enable verbose logging
-h, --help Print help
-V, --version Print version

Command Summary

CommandDescription
chatInteractive multi-turn conversation with session support
askSingle-turn question answering
daemonStart/stop/status of the background daemon
memorySearch, reindex, and manage memory
configShow and validate configuration

Examples

# Start an interactive chat
localgpt chat

# Ask a single question
localgpt ask "What is the capital of France?"

# Use a specific model
localgpt -m claude-3-sonnet chat

# Start the daemon
localgpt daemon start

# Search memory
localgpt memory search "project ideas"

# Show memory statistics
localgpt memory stats

Built-in Chat Commands

When in interactive chat mode, these commands are available:

CommandDescription
/helpShow help for chat commands
/quit or /exitExit the chat session
/newStart a fresh session
/memory <query>Search memory for a term
/saveForce save current context to memory
/compactManually trigger session compaction
/statusShow session status (tokens, turns)
/clearClear the terminal screen
/skillsList available skills

Additionally, any installed skills can be invoked via /skill-name (e.g., /commit, /github-pr). See Skills System for details.

Exit Codes

CodeMeaning
0Success
1General error
2Configuration error
3API/Provider error