contox export
Export your project brain to formats compatible with various AI coding tools. This lets you use Contox memory with tools that read static instruction files rather than MCP or CLI output.
Usage
contox export -f <format> [options]
Options
| Flag | Description | Required | Default |
|---|---|---|---|
-f, --format <format> | Export format | Yes | -- |
-o, --output <path> | Custom output file path | No | format-specific default |
--stdout | Write to stdout instead of a file | No | false |
Formats
| Format | Default output path | Description |
|---|---|---|
cursorrules | .cursorrules | Cursor Rules file, loaded automatically by Cursor |
copilot | .github/copilot-instructions.md | GitHub Copilot custom instructions |
markdown | contox-brain.md | Plain markdown, usable with any tool |
Examples
Export for Cursor:
contox export -f cursorrules
This creates a .cursorrules file in your project root that Cursor automatically reads.
Export for GitHub Copilot:
contox export -f copilot
This creates .github/copilot-instructions.md, which GitHub Copilot uses for custom instructions.
Export to a custom file:
contox export -f markdown -o docs/ai-context.md
Print to stdout:
contox export -f markdown --stdout
When to use export
Use contox export when your AI tool reads static files rather than calling the CLI or MCP server at runtime. Common scenarios:
- Cursor -- Reads
.cursorrulesat project open - GitHub Copilot -- Reads
.github/copilot-instructions.md - Other tools -- Any tool that can read a markdown context file
For tools that support MCP (like Claude Code) or can execute CLI commands (like Aider), prefer using contox memory or the MCP server directly, as these always return the latest brain content.
Notes
- Exported files are static snapshots. Run
contox exportagain after saving new sessions or scanning your codebase to keep the file up to date. - Consider adding the export command to a git hook or CI step to keep the exported file current.
- The
--stdoutflag is useful for piping the brain content into other commands or scripts.