Configuration
JD.AI works out of the box with sensible defaults. This page covers the main ways to customize it — project instruction files, default commands, config files, and environment variables. For the full configuration reference, see Configuration Reference.
Project instructions (JDAI.md)
JDAI.md is a special file that JD.AI reads at the start of every session. Place it in your repository root to declare build commands, code style rules, and project-specific conventions. JD.AI injects its contents into the system prompt so every response respects your project's standards.
File search order
JD.AI looks for instruction files in this priority order:
JDAI.md— JD.AI native formatCLAUDE.md— recognized instruction filenameAGENTS.md— recognized instruction filename.github/copilot-instructions.md— recognized instruction filename.jdai/instructions.md— dot-directory variant
All discovered files are merged, with JDAI.md taking highest priority when directives overlap.
Example JDAI.md
# Build & Test
- Build: `dotnet build MyProject.slnx`
- Test: `dotnet test --filter "Category!=Integration"`
- Format: `dotnet format MyProject.slnx`
- Lint: build must pass with zero warnings
# Code Style
- File-scoped namespaces
- XML doc comments on all public APIs
- Async/await throughout (no .Result or .Wait())
- ILogger<T> for logging, never Console.WriteLine
# Git Conventions
- Conventional commits (feat:, fix:, chore:, etc.)
- PR branches: feature/, fix/, chore/
# Project Notes
- Authentication module is in src/Auth/ — uses JWT
- Database migrations: `dotnet ef database update`
What to include vs. exclude
| ✅ Include | ❌ Exclude |
|---|---|
| Build/test commands | Obvious language conventions |
| Code style rules that differ from defaults | Standard patterns the AI already knows |
| Project-specific conventions | Detailed API documentation |
| Architecture decisions | File-by-file descriptions |
View loaded instructions
/instructions # Show all loaded instruction content
Setting defaults with /default
Persist your preferred provider and model so they're used for all future sessions:
/default provider openai # Set global default provider
/default model gpt-4o # Set global default model
/default # Show current defaults
Per-project defaults
Override global defaults for a specific project:
/default project provider ollama
/default project model llama3.2:latest
Per-project defaults are stored in .jdai/defaults.json in the project root.
Resolution priority
When determining which provider and model to use:
- CLI flags —
--providerand--modelpassed at launch - Session state — set during the session via
/model setor/provider - Per-project defaults —
.jdai/defaults.json - Global defaults —
~/.jdai/config.json - First available — first provider with a valid connection
Global config file
~/.jdai/config.json stores global defaults:
{
"defaultProvider": "openai",
"defaultModel": "gpt-4o"
}
Edit this file directly or use the /default commands.
Directory structure
JD.AI stores local state in ~/.jdai/:
~/.jdai/
├── config.json # Global default provider/model
├── credentials.enc # Encrypted credential store
├── sessions.db # SQLite session database
├── update-check.json # NuGet update cache
├── exports/ # Exported session JSON files
└── models/ # Local GGUF models and registry
└── registry.json # Model manifest
Environment variables
| Variable | Description | Default |
|---|---|---|
OLLAMA_ENDPOINT |
Ollama API URL | http://localhost:11434 |
OLLAMA_CHAT_MODEL |
Default Ollama chat model | llama3.2:latest |
OLLAMA_EMBEDDING_MODEL |
Default embedding model | all-minilm:latest |
OPENAI_API_KEY |
OpenAI / Codex API key | — |
ANTHROPIC_API_KEY |
Anthropic API key | — |
JDAI_MODELS_DIR |
Local model storage directory | ~/.jdai/models/ |
HF_HOME |
HuggingFace cache directory | ~/.cache/huggingface/ |
HF_TOKEN |
HuggingFace API token | — |
See Provider Setup for the full list of provider-specific environment variables.
Governance and workflow store
| Variable | Description | Default |
|---|---|---|
JDAI_ORG_CONFIG |
Path to organization policy YAML directory | — |
JDAI_WORKFLOW_STORE_URL |
Git remote URL for shared workflow store | — (local file store) |
See Governance & Policies for the full governance configuration reference, and Environment Variables for the complete list.
Runtime commands
| Command | Description |
|---|---|
/autorun |
Toggle auto-approve for tool execution |
/permissions |
Toggle all permission checks |
/compact |
Force context compaction |
/clear |
Clear conversation history |
/spinner [style] |
Change the loading animation |
/config list |
Show persisted runtime settings |
/config get prompt_cache |
Show prompt caching enablement |
/config set prompt_cache on|off |
Enable or disable automatic prompt caching |
/config set prompt_cache_ttl 5m|1h |
Set prompt cache TTL for supported providers |
/config set welcome_cwd on|off |
Toggle working-directory line in the welcome panel |
/config set welcome_motd on + /config set welcome_motd_url <url> |
Enable and source welcome MoTD text |
Prompt caching defaults:
prompt_cache=onprompt_cache_ttl=5m
See Prompt Caching Reference for thresholds and provider behavior.
See also
- Provider Setup — provider credentials and environment variables
- Sessions & History — session storage and persistence
- Checkpointing — checkpoint strategy configuration
- Governance & Policies — policy documents, budget limits, tool/provider restrictions
- Audit Logging — audit sinks and compliance logging
- Shared Workflow Store — publishing and installing shared workflows
- Configuration Reference — full reference