Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/TrinaxCode/TrinaxAI/llms.txt

Use this file to discover all available pages before exploring further.

Every TrinaxAI CLI command is a subcommand of the trinaxai binary. Run trinaxai --help for a top-level summary or trinaxai <command> --help for per-command usage. Each command section below includes the full flag list extracted from the source.
All commands require the TrinaxAI backend to be running (trinaxai start) unless otherwise noted. Use trinaxai doctor to verify that services are healthy before running queries.

trinaxai ask

Send a single question to TrinaxAI and print the answer, then exit. Ideal for scripting, shell aliases, or quick lookups.Syntax
trinaxai ask [--session <name>] [--collections <ids>] "your question here"
Flags
FlagDefaultDescription
prompt (positional)The question or prompt text. Multiple words are joined into one string.
--session <name>defaultSession name used to persist this exchange to ~/.local/share/trinaxai/sessions/<name>.jsonl.
--collections <ids>Comma-separated collection IDs to scope the RAG retrieval, e.g. --collections myproject,docs.
Examples
trinaxai ask "What does the index.py file do?"
trinaxai ask always uses the RAG engine so answers are grounded in your indexed code and documents. To force the generative Ollama engine instead, use trinaxai chat --prompt "..." with --engine ollama set in your config.

trinaxai chat

Start a streaming, context-aware chat session. Without --prompt, opens a full interactive REPL with multi-turn conversation history and slash commands. With --prompt, behaves like a richer version of ask with streaming output.Syntax
trinaxai chat [--prompt "text"] [--session <name>] [--collections <ids>]
Flags
FlagDefaultDescription
--prompt <text>Run a single prompt and exit instead of opening the REPL.
--session <name>defaultConversation session name. Messages are appended to the session log on disk.
--collections <ids>Comma-separated collection IDs to target for RAG retrieval.
Slash Commands (REPL only)
CommandDescription
/helpShow all slash commands
/exit or /quitExit the chat REPL
/clearClear in-memory conversation history (session log is kept)
/model [name]Show the current model hint or set a new one for subsequent messages
/index [path]Index a folder directly from within chat (defaults to current directory)
/statusPrint local service status
Examples
trinaxai chat

trinaxai index

Recursively indexes a local directory using AST-aware chunking and stores the result in the local RAG vector store. Indexing is incremental — on subsequent runs only changed files are re-processed.Syntax
trinaxai index [path] [--folder <path>] [--collection <id>] [--append]
Flags
FlagDefaultDescription
path (positional)Directory to index. Expanded to an absolute path automatically.
--folder <path>Legacy alias for the positional path argument.
--collection <id>defaultCollection ID to store the indexed data in.
--appendfalseAppend-only mode: add new files but do not remove chunks for deleted files.
The indexer is invoked as a subprocess running index.py from the TrinaxAI project root. Environment variables such as TRINAXAI_INDEX_BATCH_SIZE (from .env) apply automatically.Examples
trinaxai index .
After indexing, run trinaxai browse list-files --collection <id> to confirm that your files were ingested correctly.

trinaxai research

Performs a multi-pass deep research query. TrinaxAI breaks the question into sub-questions, retrieves context from the RAG store across multiple passes, and synthesises a comprehensive answer with cited sources.Syntax
trinaxai research --query "question" [--collections <ids>] [--depth 1|2|3]
Flags
FlagDefaultDescription
--query <text>(required)The research question.
--collections <ids>Comma-separated collection IDs to scope retrieval.
--depth <1|2|3>2Number of research passes. Higher depth is more thorough but slower.
The output includes the generated sub-questions, the final synthesised answer rendered as Markdown, and a list of up to eight source citations showing file path and page number.Examples
trinaxai research --query "How does the auth middleware work?" --depth 1

trinaxai doctor

Runs a comprehensive local health check and prints a summary table. Use this after installation or whenever a command fails to narrow down the root cause.Syntax
trinaxai doctor
Checks performed
CheckWhat it verifies
Python packageCLI import works correctly
Service managerservice_manager.py is present in the project root
Ollama commandollama is on $PATH
ServicesReports running/stopped status via service_manager.py status
RAG APIHTTP health endpoint (/health) is reachable
Index builtAt least one document has been indexed
ProjectsNumber of indexed projects
CollectionsNames of the first five collections
Usage statsTotal messages and estimated token usage
Memory summaryPrints the AI-generated memory summary if one exists
The command exits with code 0 if the Python package and Service manager checks both pass, and 1 otherwise.Example
trinaxai doctor
┌─────────────────── TrinaxAI doctor ────────────────────┐
│ check            │ status │ detail                      │
│ Python package   │ OK     │ CLI import works             │
│ Service manager  │ OK     │ /home/user/TrinaxAI/...py   │
│ Ollama command   │ OK     │ /usr/local/bin/ollama        │
│ Services         │ OK     │ rag_api running | pwa running│
│ RAG API          │ OK     │ http://localhost:3333        │
│ Index built      │ OK     │ ready                        │
│ Projects         │ OK     │ 3                            │
│ Collections      │ OK     │ default, myproject, docs     │
└────────────────────────────────────────────────────────┘

trinaxai memory

Creates, lists, and deletes persistent memory entries. Memories are short facts (“remember that the API uses JWT for auth”) that TrinaxAI injects into context automatically during chat. They persist across sessions and devices (via the shared backend state).Syntax
trinaxai memory <list|add|forget|refresh|summary> [flags]
Subcommands
SubcommandDescription
listDisplay all stored memories in a table (id, text, tags, created)
addAdd a new memory entry
forgetDelete a memory by its ID or unique ID prefix
refreshRe-generate the AI memory summary from all current entries
summaryPrint the current AI-generated memory summary
Flags for memory add
FlagDescription
--text <text>Memory text. If omitted, the CLI prompts interactively.
--tags <tags>Comma-separated tags for organisation, e.g. --tags auth,backend.
Flags for memory forget
FlagDescription
--memory-id <id>Full UUID or a unique prefix. If omitted, the CLI prompts interactively.
Examples
trinaxai memory list

trinaxai collections

Creates, lists, deletes, and switches between RAG collections. Collections are independent vector stores — useful for separating projects, clients, or topics so RAG retrieval stays focused.Syntax
trinaxai collections <list|create|delete|use> [flags]
Subcommands
SubcommandDescription
listShow all collections with their ID, name, and creation time
createCreate a new collection
deletePermanently delete a collection and all its indexed data
useSet the active collection used by default for queries
Flags for collections create
FlagDescription
--name <name>Display name for the collection. If omitted, the CLI prompts interactively.
Flags for collections delete
FlagDescription
--collection-id <id>ID of the collection to delete. The default collection cannot be deleted. A confirmation prompt is shown before deletion.
Flags for collections use
FlagDescription
--collection-id <id>Collection ID to activate. Saved to the local CLI config.
Examples
trinaxai collections list
trinaxai collections delete removes all indexed data for that collection. This action is irreversible. Re-indexing the source directory is required to restore the data.

trinaxai browse

Inspects the RAG index — lists collections, files within a collection, or the raw text chunks for a specific file. Useful for verifying that indexing succeeded and for debugging retrieval quality.Syntax
trinaxai browse <list-collections|list-files|show-chunks> [flags]
Subcommands
SubcommandDescription
list-collectionsShow all available collections
list-filesList every indexed file in a collection with chunk count, size, and mtime
show-chunksDisplay the raw text chunks stored for a given file
Flags for browse list-files
FlagDefaultDescription
--collection <id>defaultCollection to inspect.
Flags for browse show-chunks
FlagDefaultDescription
--collection <id>defaultCollection containing the file.
--file <path>(required)Relative file path as stored in the index.
--limit <n>50Maximum number of chunks to display.
Examples
trinaxai browse list-collections

trinaxai watch

Controls the background file watcher daemon. When running, the watcher monitors one or more directories for changes and automatically re-indexes modified files into the RAG store without any manual intervention.Syntax
trinaxai watch <start|stop|status> [flags]
Subcommands
SubcommandDescription
startStart the watcher daemon
stopStop the watcher daemon
statusShow whether the watcher is running and how many events it has processed
Flags for watch start
FlagDescription
--paths <dir> [dir ...]One or more directories to watch. Multiple values are space-separated.
--collection <id>Restrict auto-reindex to a single collection path.
Examples
trinaxai watch start --paths .

trinaxai export

Exports a saved chat session to a Markdown file. Each exchange (user message + assistant reply) is written out in order with role labels and timestamps. Useful for sharing conversations, creating runbooks, or archiving research sessions.Syntax
trinaxai export [--session <name>] [--format md] [--output <path>]
Flags
FlagDefaultDescription
--session <name>defaultName of the session to export. Sessions are stored at ~/.local/share/trinaxai/sessions/<name>.jsonl.
--format <fmt>mdOutput format. Currently only md (Markdown) is supported.
--output <path>./trinaxai-<session>.mdFile path for the exported output. If omitted, the file is written to the current working directory.
Examples
trinaxai export

trinaxai start

Starts all TrinaxAI local services: the RAG API (FastAPI) and the PWA frontend. Uses the platform’s service manager (service_manager.py) so the services are also registered for auto-start.Syntax
trinaxai start
This command has no additional flags. It runs service_manager.py start with a 180-second timeout and streams service manager output directly to the terminal.Example
trinaxai start
# Starting TrinaxAI services...
# rag_api  → started (pid 12345)
# pwa      → started (pid 12346)
On Linux the service manager uses user-level systemd units. On macOS it uses launchctl. On Windows it uses a subprocess supervisor. trinaxai start wraps all three transparently.

trinaxai stop

Stops AI services and optionally the PWA frontend. By default it stops only the AI backend (RAG API and Ollama supervisor). Pass --all to also take down the PWA.Syntax
trinaxai stop [--all] [-y | --yes]
Flags
FlagDefaultDescription
--allfalseAlso stop the PWA frontend (runs stop-all instead of stop-ai).
-y / --yesfalseSkip the interactive confirmation prompt.
Examples
trinaxai stop

Build docs developers (and LLMs) love