[Unit]
Description=Companion AI Full Index (One-shot)
Documentation=https://github.com/santhoshjan/companion

[Service]
Type=oneshot
User=companion
Group=companion
WorkingDirectory=/opt/companion
Environment=PYTHONPATH=/opt/companion
Environment=COMPANION_CONFIG=/opt/companion/config.json
Environment=COMPANION_DATA_DIR=/var/lib/companion

# Run full index
ExecStart=/opt/companion/venv/bin/python -m companion.indexer_daemon.cli index

# Security hardening
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/var/lib/companion
