zcf (Zero-Config Code Flow)

repository·main·Indexed 27 days ago

https://github.com/ufomiao/zcf

A one-click configuration tool for Claude Code and Codex environments. zcf streamlines AI-driven coding workflows through an intelligent agent system, bilingual support, and personalized AI assistants. It provides a preset system for API providers (such as 302.AI, GLM, and Kimi) to simplify the setup of base URLs and authentication, and includes CLI commands for initialization, updating workflows, and managing multi-configuration switching.

Tokens
48.8K
Snippets
158
Records
311
Agent score
88%

What's inside zcf

  1. Overview of ZCF core capabilities

    main

    ZCF is a CLI tool that integrates environment configuration, workflow import, and toolchain management. Its core capabilities include:

    • Environment Initialization: Full initialization for Claude Code and Codex, including API settings, output styles, memory, templates, MCP, workflows, and status bar.
    • Configuration Management: Supports incremental management, backup strategies, multiple API configurations, and separation of template language from AI output language.
    • Workflow System: Includes pre-configured workflows such as the six-stage workflow, Feat workflow, BMad agile, Spec extension, and Git smart commands.
    • Integration Ecosystem: Integrates with CCR, CCometixLine, Context7, Open Web Search, DeepWiki, Playwright, Serena, and more.
    • Command Line Tools: Provides a set of dedicated CLI commands and an interactive menu for management.
  2. Overview of ZCF Configuration Directories

    main

    ZCF manages configurations across several main directories. Understanding these locations is essential for manual management, backups, and version control.

    Main Configuration Directories

    DirectoryDescriptionMain Files
    ~/.claude/Claude Code main configuration directorysettings.json, CLAUDE.md, prompts/, workflows/
    ~/.codex/Codex main configuration directoryconfig.toml, auth.json, prompts/, AGENTS.md
    ~/.ufomiao/zcf/ZCF global configuration directoryconfig.toml
    ~/.claude-code-router/CCR configuration directoryconfig.json
    ~/.claude/backup/Claude Code backup directoryTimestamp backup files
    ~/.codex/backup/Codex backup directoryTimestamp backup files

    Claude Code Structure (~/.claude/)

    • settings.json: Main configuration (API, MCP, permissions).
    • CLAUDE.md: Project memory and system prompts.
    • prompts/: Contains output-style/ and memory/ templates.
    • workflows/: Contains various workflows (e.g., zcf-workflow/, feat/, git/, bmad/).
  3. Overview of Claude Code Router (CCR)

    main

    Claude Code Router (CCR) is a proxy router middleware that enables intelligent routing and cost optimization for multiple AI models. It acts as an intermediary layer that forwards Claude Code requests to various model providers based on task requirements.

    Key capabilities include:

    • Intelligent Model Routing: Automatically selects models based on task complexity (e.g., free models for simple tasks, reasoning models like DeepSeek R1 for thinking tasks, or high-performance models like Claude Opus for complex tasks).
    • Cost Optimization: Reduces API costs by selecting the most economical model for specific tasks.
    • Multi-Provider Support: Integrates with OpenRouter, DeepSeek, Ollama, Gemini, Volcengine, and SiliconFlow.
    • Visual Management: Includes a built-in Web UI for real-time monitoring, cost analysis, and graphical configuration of routing rules.
  4. Overview of ZCF (Zero-Config Code Flow)

    main

    ZCF is a CLI tool designed to provide end-to-end environment initialization for Claude Code and Codex in minutes. It automates the creation of configuration directories, API/proxy integration, MCP (Model Context Protocol) service integration, workflow imports, and common tool installations.

    Key Features:

    • Zero-configuration: Automatically detects OS, language preferences, and installation status.
    • Multi-tool support: Unified CLI for both Claude Code and Codex.
    • Structured workflows: Includes pre-configured flows like Feat planning and BMad agile flows with built-in agents.
    • Rich MCP integration: Default support for services like Context7, Open Web Search, Spec Workflow, DeepWiki, Playwright, and Serena.
    • Extensible configuration: Supports parallel API configurations, output style switching, and template/language separation.
  5. Overview of ZCF features

    main

    ZCF (Zero-Config Code Flow) provides a streamlined environment for AI-assisted development (such as Claude Code/Codex). Key capabilities include:

    • API & Proxy Management: Supports official login, API Key, and CCR proxy modes with presets for providers like 302.AI, GLM, MiniMax, and Kimi.
    • Security & Configuration: Automates environment variables, permission templates, and backup strategies.
    • Workflow Automation: Automatically imports /workflow, /feat, and /git-commit skills and agent configurations.
    • MCP Support: One-click enablement of mainstream Model Context Protocol (MCP) servers with intelligent environment variable prompting.
    • Customization: Command-line control over AI output language, project-level/global output styles, and Codex memory instructions.
    • Toolchain: Includes CCometixLine status bar installation, CCR management menus, and Codex CLI management.
  6. Explore ZCF Best Practices

    main

    The Best Practices documentation provides guidance for maximizing the benefits of ZCF in team collaboration and multi-project scenarios. Key areas covered include:

    • Usage Tips: High-frequency operations and recommendations for daily use.
    • Worktree Parallel Development: Strategies for efficiently utilizing Git Worktree with ZCF.
    • Output Style Strategy: Management of output styles and solutions for team sharing.
  7. CCometixLine Requirements

    main

    To use CCometixLine effectively, ensure your environment meets these requirements:

    • Git: Version 1.5+ (Version 2.22+ is recommended for improved branch detection).
    • Terminal: Must support Nerd Fonts for correct icon rendering (e.g., FiraCode Nerd Font, JetBrains Mono Nerd Font).
    • Claude Code: Required for statusline integration.
  8. Understand the ZCF Architecture

    main

    ZCF is built using a layered architecture designed for CLI extensibility and cross-platform compatibility. The project uses TypeScript (ESM-only) and requires Node.js >= 22.

    Core Layers:

    1. CLI Entry Layer: Handles framework initialization (via cac), command registration, i18n, and error management.
    2. Command Layer: Contains the business logic for specific CLI commands (e.g., init, menu, update).
    3. Utility Layer: Provides reusable logic for configuration management, installers, platform adaptation, and workflow management.
    4. Integration Modules: Specialized modules for third-party tools like CCR, Codex, and CCometixLine.
  9. Analyze Claude Code/Codex CLI usage with ccusage

    main

    Use ccusage to perform fast and informative token usage and cost analysis from local JSONL log files. It is designed to help developers understand and optimize AI-assisted development costs by parsing local logs into detailed statistical reports.

    Core capabilities include:

    • Multi-dimensional Reports: Daily, weekly, and monthly usage summaries.
    • Cost Analysis: Precise calculation of token consumption and dollar costs.
    • Model Breakdown: Usage ratios for different models (e.g., Claude Opus, Sonnet, Haiku).
    • Trend Analysis: Visualized changes in usage trends.
    • Data Export: Supports JSON and CSV formats for integration with other tools.
    • Real-time Display: Integrated with CCometixLine for status bar support.
  10. Set the Template language

    main

    Template language controls the language version of workflow templates and prompts. It is independent of the CLI language.

    Supported languages:

    • zh-CN: Chinese templates
    • en: English templates

    Priority: --config-lang parameter > templateLang in config file > current CLI language > system default (en).

    # Set during initialization
    npx zcf init --config-lang zh-CN
    
    # Set during update
    npx zcf update --config-lang zh-CN
    
    # Use the unified parameter (recommended)
    npx zcf init --all-lang zh-CN