Something went wrong. Try again.
CLI tools and operational extensions for the void architecture on ATProtocol.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940import sys
def modify_cli(): filepath = "/home/cameron/void/src/void_tools/cli.py" with open(filepath, 'r') as f: content = f.read()
# The string we want to find and insert our logic before target_str = """ client = get_client() actions = outbox.get("actions", [])""" # What we're inserting patch_str = """ # Run Constitutional Linter import subprocess linter_path = os.path.join(os.path.dirname(__file__), "constitutional_linter.py") if os.path.exists(linter_path): print("Running Constitutional Linter...") result = subprocess.run([sys.executable, linter_path, args.file], capture_output=True, text=True) if result.returncode != 0: print("Dispatch aborted: Constitutional violations detected.") print(result.stderr) sys.exit(1) else: print("Constitutional Linter passed.") else: print("Warning: constitutional_linter.py not found. Skipping linting.")
client = get_client() actions = outbox.get("actions", [])"""
if target_str in content: new_content = content.replace(target_str, patch_str) with open(filepath, 'w') as f: f.write(new_content) print("Successfully patched cli.py") else: print("Target string not found in cli.py")
modify_cli()