Wiki / Reference

Configuration#

PortCode reads portcode.json. portcode init writes a commented starting file in the current folder. Comments (//) are allowed.

Where it is read from#

Later layers win:

  1. built-in defaults and provider presets
  2. ~/.config/portcode/portcode.json (your global file)
  3. ./portcode.json, or ./.portcode/portcode.json
  4. environment variables: PORTCODE_MODEL, PORTCODE_BASE_URL, PORTCODE_API_KEY

Commit portcode.json. Keep keys in environment variables or in portcode auth set <provider> (stored in ~/.config/portcode/auth.json, mode 0600). Never commit a key.

An example#

{
  "model": "lakomoor/deepseek-chat",
  "small_model": "ollama/qwen3:4b",
  "prompt_style": "auto",
  "venv": true,
  "suggest": true,
  "team": { "enabled": false, "parallel": 3 },
  "provider": {
    "lakomoor": { "base_url": "https://lakomoor.com/v1", "api_key_env": "LAKOMOOR_API_KEY" },
    "ollama":   { "base_url": "http://localhost:11434/v1" }
  },
  "models": { "qwen3:14b": { "context_window": 32768, "parallel_tool_calls": false } },
  "permission": { "edit": "ask", "bash": { "*": "ask", "cargo test*": "allow" } },
  "agent": { "build": { "steps": 80 } },
  "mcp": { "rea": { "command": ["npx", "-y", "rea-agents@latest", "mcp"] } }
}

Every setting#

KeyTypeDefaultMeaning
modelstringlakomoor/deepseek-chatprovider/model to use
small_modelstringthe main modelcheaper model for context compaction
default_agentstringbuildagent to start with
providermappresetsendpoints: base_url, api_key, api_key_env, headers. See Providers
modelsmapbuilt-in profilesper-model overrides keyed by model id (the part after provider/): sampling, context_window, parallel_tool_calls, prompt_style, reasoning_effort…
prompt_styleauto compact full qwen38autoprompt flavour for every model; a per-model entry wins
permissionmapask for edits and commandsrules per tool, see Permissions
agentmapper-agent model, steps, prompt_append
mcpmapMCP servers: command (array), env, enabled
max_stepsnumberper agentupper bound on steps in one run
modeclean-room deepclean-roomsee Clean-room and deep mode
cli_permissionstringacceptEditsClaude Code's permission mode: acceptEdits, plan, bypassPermissions, default. Read-only agents always use plan. See Claude Code and Codex
team{enabled, parallel}off, 3see Team mode
venvbooltruesee Python environments
suggestbooltruethe grey first-message suggestion, see A tour
allowed_dirsarray[]extra folders file tools may touch without asking

Remembered choices#

A few choices you make in the app are remembered in a small state file in your config folder rather than in portcode.json: the last model (/model, /provider) and the theme (/theme). -m and PORTCODE_MODEL still win over the remembered model, and PORTCODE_THEME over the theme.

Environment variables#

VariableEffect
PORTCODE_MODELmodel, as provider/model
PORTCODE_BASE_URLendpoint of the active provider
PORTCODE_API_KEYkey for the active provider
PORTCODE_THEMElight or dark
PORTCODE_NO_UPDATE_CHECK1 turns off the daily update check
PORTCODE_INSTALL_DIRwhere install.sh puts the binary
LAKOMOOR_API_KEY and the other provider variablesprovider keys, named in api_key_env

Edit this page on GitHub