cf init

Initialize workspace with documentation folders and platform configuration.

Overview

Interactive setup for Coding Friend. Run it in the root directory of your project:

cf init

cf init has two modes depending on whether the project has been initialized before:

  • First run (no .coding-friend/ directory) — runs a linear step-by-step wizard that walks you through all settings in order.
  • Subsequent runs (.coding-friend/ directory exists) — shows an interactive menu where you pick which setting to configure or reconfigure. Each menu item shows its current status.

You can run cf init as many times as you want.

💡 To edit individual settings later, you can also use cf config.

Config File Locations

At the start, cf init displays config file locations:

Config files:
  Global: ~/.coding-friend/config.json
  Local:  .coding-friend/config.json (this project)
Local overrides global at property level.

Status Display

Configs can be stored in two different locations - global and local. Local overrides global at the property level.

  • Global config: ~/.coding-friend/config.json
  • Local config: <project>/.coding-friend/config.json
  • The meaning of the labels is as follows:
    • [global] - set only in global config
    • [local] - set only in local (project) config
    • [both] - set in both global and local config
    • [-] - not configured anywhere (using defaults)

Setup Steps

  1. Step 1 - Docs folder name (default: "docs"), where plans, memory, research, and session docs are stored in your project.
  2. Step 2 - Configure .gitignore. Keeps Coding Friend's AI-generated docs and config out of your git history. You can edit it later in .gitignore.
  3. Step 3 - Docs language. Skills like /cf-plan, /cf-ask, /cf-remember will write docs in this language.
  4. Step 4 - /cf-learn config. The settings for the learning extraction skill. You can configure the language, output directory, and categories.
  5. Step 5 - Shell completion. Adds tab completion for cf commands to your shell.
  6. Step 6 - Statusline. The statusline is a small section at the bottom of the screen that shows the current status of the Coding Friend session. You can configure it later with cf statusline.
  7. Step 7 - CF Memory. Runs the full memory setup wizard — installs dependencies, builds the database, configures MCP, and optionally enables memory.autoCapture. You can configure it later with cf memory config.
  8. Step 8 - Auto-approve. Opt-in hook that auto-approves safe tool calls (read-only commands), blocks destructive ones, and prompts for ambiguous operations. Uses two-tier classification: rule-based + Sonnet LLM fallback.
  9. Step 9 - Claude permissions. Offers to apply all recommended Coding Friend permissions (Tier 1 static rules + Tier 2 plugin script rules). You choose the scope: project-level (.claude/settings.local.json) or user-level (~/.claude/settings.json). If you configured an external /cf-learn output directory, external learn directory rules are also included. For fine-grained control, use cf permission or see the Permissions Reference.

Interactive Menu (Returning Users)

When .coding-friend/ already exists, cf init shows an interactive menu instead of running the wizard:

? Which setting to configure? (Use arrow keys)
❯ Docs folder [local] (docs)
  .gitignore (configured)
  Docs language [global] (en)
  /cf-learn config [local]
  Shell completion (installed)
  Statusline (configured)
  CF Memory MCP (configured)
  Auto-approve [-]
  Permissions (12/14 rules)
  ──────────────
  Exit

Select any item to reconfigure it, then return to the menu. Choose Exit when done.

Non-Git Directories

cf init can work outside git repos. All git-related steps are automatically skipped in that case.

See Also