CLI Addendum

This page documents CLI commands that are available in AFS but not covered in the main CLI Reference. These commands come from the SKILL.md reference, which is the authoritative source for agent-oriented CLI usage.


Memory Archive / Unarchive

Archive a memory to exclude it from default queries. Unarchive to restore it.

afs memory archive --agent-id myagent --memory-id mem_abc123
afs memory unarchive --agent-id myagent --memory-id mem_abc123

Archived memories can still be included in search and list results by passing --include-archived.


Maintenance: Reindex

Rebuild search indices offline. Requires the --yes flag for confirmation.

afs maintenance reindex --agent-id myagent --yes

Rebuild only the text (FTS5) index:

afs maintenance reindex --yes --text-only

Force reindex even if the scheduler is running:

afs maintenance reindex --yes --force

Maintenance: Scrub Embedding Vectors

Remove stale or orphaned embedding vectors from the HNSW index.

For a single agent:

afs maintenance scrub-embedding-vectors --agent-id myagent --yes

For all agents:

afs maintenance scrub-embedding-vectors --all --yes

Models Namespace

The models namespace manages a local inference pipeline for embeddings, reranking, and query expansion. This is useful in offline or air-gapped environments where cloud APIs are unavailable.

Install models

afs models install

Serve models

Start the local model server. The --role flag selects which model roles to serve.

afs models serve --role all
afs models serve --role embeddings
afs models serve --role rerank
afs models serve --role expand

Run as a background daemon:

afs models serve --role embeddings --daemon

Check status

afs models status
afs models status --json

Stop models

afs models stop --role embeddings
afs models stop --all

Quick Reference

CategoryCommandDescription
Memoryafs memory archive --agent-id X --memory-id MArchive a memory
afs memory unarchive --agent-id X --memory-id MUnarchive a memory
Maintenanceafs maintenance reindex --agent-id X --yesRebuild search indices
afs maintenance reindex --yes --text-onlyRebuild FTS index only
afs maintenance scrub-embedding-vectors --agent-id X --yesRemove stale vectors
afs maintenance scrub-embedding-vectors --all --yesScrub all agents
Modelsafs models installInstall local models
afs models serve --role allStart model server
afs models statusCheck model server status
afs models stop --allStop model server

See Also

  • CLI Reference for the main command documentation.
  • SKILL.md for the full agent-oriented CLI reference including common mistakes and workflow examples.