Getting Started
This guide will help you get up and running with x-fidelity quickly.
Installation
Install x-fidelity using Node.js 18+ and Yarn:
yarn global add x-fidelity
export PATH="$PATH:$(yarn global bin)"
For persistent access, add the PATH line to your ~/.bashrc
or ~/.zshrc
file.
run with demo config
- Run x-fidelity in your project directory:
xfidelity .
- View the help documentation:
xfidelity --help
Command Line Options
Options:
-d, --dir <directory> code directory to analyze
-a, --archetype <archetype> archetype to use (default: "node-fullstack")
-c, --configServer <configServer> config server URL
-o, --openaiEnabled <boolean> enable OpenAI analysis
-t, --telemetryCollector <url> telemetry collector URL
-m, --mode <mode> 'client' or 'server' (default: "client")
-p, --port <port> server port (default: "8888")
-l, --localConfigPath <path> path to local config
-j, --jsonTTL <minutes> server cache TTL (default: "10")
-e, --extensions <modules...> space-separated plugin modules
-x, --examine validate archetype config only
-v, --version output version number
-h, --help display help
Note: Plugins can be loaded in two ways:
- Via the
-e
option (CLI-specified plugins) - Via the
plugins
array in your archetype configuration
Environment Variables
OPENAI_API_KEY
: Your OpenAI API keyOPENAI_MODEL
: OpenAI model to use (default: 'gpt-4')XFI_LISTEN_PORT
: Config server portCERT_PATH
: SSL certificate pathNODE_TLS_REJECT_UNAUTHORIZED
: Allow self-signed certsXFI_SHARED_SECRET
: Shared secret for securityXFI_LOG_COLOR
: Set to 'false' to disable colored output in logsNOTIFICATIONS_ENABLED
: Enable notification systemNOTIFICATION_PROVIDERS
: Comma-separated list of notification providers to useCODEOWNERS_PATH
: Path to CODEOWNERS file (default: .github/CODEOWNERS)CODEOWNERS_ENABLED
: Enable code owners integration
Example Commands
# Analyze current directory
xfidelity .
# Use specific archetype
xfidelity . -a java-microservice
# Use remote config server
xfidelity . -c https://config-server.example.com
# Enable OpenAI analysis
xfidelity . -o true
# Run as config server
xfidelity -m server -p 9999
# Use local config
xfidelity . -l /path/to/config
# Load plugins
xfidelity . -e plugin1 plugin2
Next Steps
- Learn about Archetypes
- Configure Rules
- Set up Remote Configuration