# fake-cc **Repository Path**: wndproc12/fake-cc ## Basic Information - **Project Name**: fake-cc - **Description**: A fake Claude Code CLI with simulated AI conversation, tool execution, and session persistence. - **Primary Language**: TypeScript - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-06-20 - **Last Updated**: 2026-06-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # fake-cc A fake Claude Code CLI with simulated AI conversation, tool execution, session persistence, and an Electron desktop wrapper. ## Features - **Interactive CLI** with Ink-based terminal UI - **Simulated AI** with data-driven conversation matching, fuzzy matching, and context-aware branch logic - **Real tools**: glob, readFile, edit, execute, question — executed in isolated project workspaces - **Session persistence** with auto-save, `--resume` support, and `/resume` command - **Configurable** thinking level (`/effort low|medium|high|xhigh|max`), model switching - **Up/down arrow** input history navigation - **Project workspaces** (`~/.fake-cc/projects//`) for sandboxed file operations - **Desktop app** (Electron + Next.js + shadcn/ui) in `fake-cc-desktop/` - Sidebar session list, Markdown rendering, code highlighting + copy - Light/dark theme, streaming response, model selector in input bar - Question options as clickable buttons, attachment upload - Session auto-save, delete confirmation ## Quick Start ```bash npm run build node dist/cli.js ``` On first launch, you'll be prompted for a project workspace name. ## Usage ``` $ fake-cc # New session Enter project workspace name: my-project $ fake-cc --resume # Pick a session to resume $ fake-cc --resume # Resume a specific session directly ``` ### Commands | Command | Description | |---------|-------------| | `/model ` | Switch AI model | | `/effort ` | Set thinking level (low/medium/high/xhigh/max) | | `/resume [number\|uuid]` | List or resume a saved session | | `/exit` | Exit the CLI | | `/help` | Show help | ## Data-Driven Conversations AI responses are driven by JSON data files in `~/.fake-cc/data/`: ``` ~/.fake-cc/data/ ├── chat/ # Social conversation (no tool calls) ├── code/ # Code-related tasks (with tool execution) └── work/ # Work processing (extensible) ``` Each item contains: - `triggers` — keywords to match user input (fuzzy matching with partial word support) - `tools` — tools to execute (glob, readFile, execute, etc.) - `branches` — conditional responses based on tool output + conversation context - `fallback` — default response when no branch matches ## Directory Structure ``` ~/.fake-cc/ ├── config/config.yaml # Configuration (models, thinking level) ├── data/{chat,code,work}/ # Conversation data files ├── sessions/ # Saved sessions └── projects// # Project workspace for AI ``` ## Configuration `~/.fake-cc/config/config.yaml`: ```yaml models: - name: claude-fable-5[1m] alias: claude - name: gpt-5.5 alias: gpt - name: deepseek-v4-flash[1m] alias: deepseek thinking_level: medium tokens_per_second: 40 ``` Use `/effort low|medium|high|xhigh|max` to change thinking level at runtime. ## Desktop App ```bash cd fake-cc-desktop pnpm dev # Start Next.js + Electron dev (auto-clean port) pnpm dev:linux # Linux: start with --ozone-platform=x11 pnpm test # Run tests (39 tests) pnpm build:linux:dir # Build Linux unpacked ``` ### Desktop features - shadcn/ui components, dark/light theme via `next-themes` - Streaming response with configurable speed (`tokens_per_second`) - Sidebar session list with inline delete confirmation, resizable panes - Markdown rendering with code highlighting and copy button - Model selector and attachment button in floating input composer - Settings dialog for model, thinking level, port - Bidirectional session sync with `~/.fake-cc/sessions/` - Built-in conversation data auto-written on first launch (chat/code/work) - Project-based workspaces at `~/.fake-cc/projects//` ## Development ```bash npm run dev # Watch mode (tsup) npm test # Run CLI tests (356+ tests) npm run build # Build CLI to dist/cli.js cd fake-cc-desktop pnpm dev # Start Next.js + Electron dev pnpm dev:linux # Linux: start with --ozone-platform=x11 pnpm test # Run desktop tests (39 tests) pnpm build:linux # Build desktop for Linux ``` ## Architecture ### CLI (source/) ``` source/ ├── cli.tsx ← Entry point ├── app.tsx ← Main App component ├── reducer.ts ← State, actions, constants ├── simulator.ts ← AI engine (matching, branching, tool execution) ├── hooks/ │ ├── use-conversation.ts ← Step processing, auto-save, question answering │ └── use-input.ts ← Keyboard handling, commands, suggestions, history ├── config/index.ts ← YAML config loader + saver ├── session/index.ts ← Session CRUD ├── types.ts ← Shared interfaces ├── tools/ ← Tool implementations ├── components/ ← Ink components └── utils/ ← Matcher, random, delay, format ``` ### Desktop (fake-cc-desktop/) ``` fake-cc-desktop/ ├── src/ │ ├── app/ │ │ ├── page.tsx ← Main chat page │ │ ├── settings/page.tsx ← Settings page │ │ ├── layout.tsx ← Theme provider + font │ │ └── api/{chat,config,sessions}/route.ts ← API routes │ ├── components/ │ │ ├── ui/ ← shadcn/ui components │ │ ├── sidebar.tsx ← Session list │ │ ├── chat-area.tsx ← Message list + input │ │ ├── message.tsx ← Message renderer │ │ ├── message-markdown.tsx ← Markdown + code highlight │ │ ├── input-box.tsx ← Textarea + model select + attach │ │ ├── question-message.tsx ← Question options UI │ │ └── settings-form.tsx ← Settings dialog │ ├── hooks/ │ │ ├── use-chat.ts ← Chat state (useReducer + streaming) │ │ ├── use-sessions.ts ← Session list management │ │ └── use-config.ts ← Config read/write │ └── lib/ │ ├── simulator.ts ← AI engine (reimplemented) │ ├── matcher.ts ← Fuzzy matching │ ├── data-loader.ts ← Load data from ~/.fake-cc/data/ │ ├── session.ts ← Session CRUD │ ├── config.ts ← YAML config read/write │ └── tools.ts ← Tool execution ├── electron/ │ ├── main.js ← Window management + persistence │ └── preload.js ← IPC bridge └── tests/ ← 34 unit tests (vitest) ``` ## License MIT