personal memory agent
at main 36 lines 1.1 kB view raw
1# SPDX-License-Identifier: AGPL-3.0-only 2# Copyright (c) 2026 sol pbc 3 4"""Example maintenance task demonstrating the maint interface. 5 6This no-op task shows the recommended patterns for maintenance scripts: 7- Proper docstring (first line used as description in `sol maint --list`) 8- Using setup_cli for consistent argument parsing and logging 9- Progress output to stdout (captured in state file) 10- Clean exit with appropriate exit code 11""" 12 13import argparse 14import logging 15 16from think.utils import setup_cli 17 18logger = logging.getLogger(__name__) 19 20 21def main(): 22 parser = argparse.ArgumentParser(description=__doc__.split("\n")[0]) 23 setup_cli(parser) 24 25 logger.info("Example maintenance task starting") 26 print("This is an example maintenance task.") 27 print("Real tasks would process journal data here.") 28 print("Use numeric prefixes (000_, 001_) to control execution order.") 29 logger.info("Example maintenance task complete") 30 31 # Exit code 0 = success, non-zero = failure 32 # No explicit sys.exit(0) needed - implicit on clean return 33 34 35if __name__ == "__main__": 36 main()