🚀 Auto-deploy: BotVPS atualizado em 28/03/2026 17:56:20
This commit is contained in:
32
cronos_util.py
Normal file
32
cronos_util.py
Normal file
@@ -0,0 +1,32 @@
|
||||
import sys
|
||||
import argparse
|
||||
import json
|
||||
from tools import cronos_log, cronos_query
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Utilitário CLI para o Sistema Cronos (Memória Permanente)")
|
||||
parser.add_argument("--log", type=str, help="Conteúdo para salvar no log")
|
||||
parser.add_argument("--query", type=str, help="Termo para pesquisar na memória")
|
||||
parser.add_argument("--topic", type=str, default="geral", help="Assunto do log (nome do arquivo .md)")
|
||||
parser.add_argument("--folder", type=str, default="current_week", help="Pasta (current_week ou knowledge)")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.log:
|
||||
payload = {
|
||||
"topic": args.topic,
|
||||
"content": args.log,
|
||||
"folder": args.folder
|
||||
}
|
||||
result = cronos_log(json.dumps(payload))
|
||||
print(result)
|
||||
elif args.query:
|
||||
# Formata arg como string simples ou pair para o parser do tools.py
|
||||
query_arg = f'query="{args.query}" folder="{args.folder}"'
|
||||
result = cronos_query(query_arg)
|
||||
print(result)
|
||||
else:
|
||||
parser.print_help()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user