subcommands

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogsCmd = &cobra.Command{
	Use:   "logs",
	Short: "Show daemon logs from log file",
	Long: "\nShow logs from the background indexing daemon.\n\n" +
		"By default, displays the last 50 lines. Use -f to follow logs in real-time, " +
		"or -n to specify the number of lines to display.",
	Example: `  # Show last 50 lines of logs
  memorizer daemon logs

  # Follow logs in real-time
  memorizer daemon logs -f

  # Show last 100 lines
  memorizer daemon logs -n 100

  # Follow logs starting from last 20 lines
  memorizer daemon logs -f -n 20`,
	PreRunE: validateLogs,
	RunE:    runLogs,
}
View Source
var RebuildCmd = &cobra.Command{
	Use:   "rebuild",
	Short: "Force immediate index rebuild via daemon API",
	Long: "\nForce the daemon to perform an immediate full index rebuild.\n\n" +
		"This triggers a rebuild via the daemon's HTTP API. The daemon will re-process " +
		"all files in the memory directory, extracting metadata, performing semantic " +
		"analysis, and rebuilding all graph relationships.\n\n" +
		"Use --force to clear the graph before rebuilding (otherwise, existing entries " +
		"are updated in place).\n\n" +
		"Use --sync to synchronize the graph with the filesystem after rebuilding. This " +
		"removes stale file nodes (files no longer on disk) and orphaned nodes (Tags, " +
		"Topics, Entities with no file connections).\n\n" +
		"Use --clear-stale to remove stale cache entries before rebuilding. This ensures " +
		"files are re-analyzed with the current analysis version.",
	Example: `  # Rebuild with default settings
  memorizer daemon rebuild

  # Force full rebuild, clearing graph first
  memorizer daemon rebuild --force

  # Rebuild and remove stale graph nodes
  memorizer daemon rebuild --sync

  # Clear stale cache entries before rebuilding
  memorizer daemon rebuild --clear-stale

  # Full rebuild with all cleanup options
  memorizer daemon rebuild --force --sync --clear-stale`,
	PreRunE: validateRebuild,
	RunE:    runRebuild,
}
View Source
var RestartCmd = &cobra.Command{
	Use:   "restart",
	Short: "Restart the daemon with graceful shutdown",
	Long: "\nRestart the background indexing daemon by stopping and starting it.\n\n" +
		"Performs a graceful shutdown by sending SIGTERM to the running daemon, " +
		"then waits up to 3 seconds for the daemon to stop before starting a new instance.",
	Example: `  # Restart the daemon
  memorizer daemon restart`,
	PreRunE: validateRestart,
	RunE:    runRestart,
}
View Source
var StartCmd = &cobra.Command{
	Use:   "start",
	Short: "Start the daemon in foreground mode",
	Long: "\nStart the background indexing daemon in foreground mode.\n\n" +
		"The daemon will continuously monitor the memory directory and rebuild " +
		"the index as needed. Press Ctrl+C to stop the daemon.\n\n" +
		"A PID file is created at ~/.memorizer/daemon.pid to track the running " +
		"daemon. If you encounter 'daemon already running' errors, check the PID file.",
	Example: `  # Start daemon in foreground
  memorizer daemon start`,
	PreRunE: validateStart,
	RunE:    runStart,
}
View Source
var StatusCmd = &cobra.Command{
	Use:   "status",
	Short: "Show daemon status and configuration",
	Long: "\nShow the current status of the background indexing daemon.\n\n" +
		"Displays whether the daemon is running and configuration details.",
	Example: `  # Check if daemon is running
  memorizer daemon status`,
	PreRunE: validateStatus,
	RunE:    runStatus,
}
View Source
var StopCmd = &cobra.Command{
	Use:   "stop",
	Short: "Stop the running daemon gracefully",
	Long: "\nStop the running background indexing daemon by sending a SIGTERM signal.\n\n" +
		"The daemon will gracefully shut down, completing any in-progress operations before exiting.",
	Example: `  # Stop the running daemon
  memorizer daemon stop`,
	PreRunE: validateStop,
	RunE:    runStop,
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL