[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-92776":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":12,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":14,"stars30d":14,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":15,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":16,"fork":16,"defaultBranch":17,"hasWiki":18,"hasPages":16,"topics":19,"createdAt":10,"pushedAt":10,"updatedAt":20,"readmeContent":21,"aiSummary":22,"trendingCount":14,"starSnapshotCount":14,"syncStatus":23,"lastSyncTime":24,"discoverSource":25},92776,"CyCode","vibe-cy\u002FCyCode","vibe-cy","CyCode is a lightweight AI coding agent that runs in your terminal. It uses an OpenAI-compatible Chat Completions API and provides built-in tools for reading files, applying precise edits, searching code, running shell commands, and delegating work to sub-agents.","",null,"TypeScript",51,1,0,37.9,false,"main",true,[],"2026-07-22 04:02:07","# CyCode\n\nCyCode is a lightweight AI coding agent that runs in your terminal. It uses an OpenAI-compatible Chat Completions API and provides built-in tools for reading files, applying precise edits, searching code, running shell commands, and delegating work to sub-agents.\n\nIt is designed for local software engineering workflows: understanding codebases, fixing bugs, refactoring code, generating focused changes, and automating repository-level tasks.\n\n## Features\n\n- **OpenAI-compatible API**: Works with OpenAI, DeepSeek, DashScope\u002FQwen, and other providers that support compatible Chat Completions APIs.\n- **Terminal-first UX**: Starts an Ink-based TUI by default, with an automatic text REPL fallback when TTY rendering is unavailable.\n- **One-shot mode**: Run a single prompt with `--message` or `--prompt` for scripts, automation, and CI-style usage.\n- **Local coding tools**: Read files, apply exact text replacements, write files, run regex search, run glob search, and execute shell commands.\n- **Session management**: Save, list, and resume conversations.\n- **Context compression**: Compress long conversations to reduce the risk of exceeding the model context window.\n- **Token and cost tracking**: Tracks prompt and completion tokens, with estimated cost for known models.\n\n## Requirements\n\n- Node.js 18 or later\n- npm\n- An OpenAI-compatible API key\n\n## Quick Start\n\n```bash\nnpm install\ncp .env.example .env\nnpm run build\nnpm start\n```\n\nEdit `.env` and configure at least one API key:\n\n```bash\nOPENAI_API_KEY=your_api_key\nOPENAI_BASE_URL=https:\u002F\u002Fapi.openai.com\u002Fv1\nMODEL=gpt-5-mini\n```\n\nFor other compatible providers, you can also use `CYCODE_API_KEY`, `DEEPSEEK_API_KEY`, or `DASHSCOPE_API_KEY`.\n\n## Usage\n\n### Interactive Mode\n\n```bash\nnpm start\n```\n\nAfter building, you can run the compiled CLI directly:\n\n```bash\nnode dist\u002Fcli.js\n```\n\nIf the package has been linked with `npm link`, run:\n\n```bash\ncycode\n```\n\n### One-Shot Tasks\n\n```bash\nnode dist\u002Fcli.js -p \"Read src\u002Fagent.ts and summarize the Agent execution flow\"\nnode dist\u002Fcli.js -m \"Add a focused README for this project\"\n```\n\n### Use a Different Working Directory\n\n```bash\nnode dist\u002Fcli.js --dir \u002Fpath\u002Fto\u002Fproject -p \"Inspect the test structure in this repository\"\n```\n\n### Override Model or API Settings\n\n```bash\nnode dist\u002Fcli.js --model gpt-5-mini --base-url https:\u002F\u002Fapi.openai.com\u002Fv1 --api-key \"$OPENAI_API_KEY\"\n```\n\n## CLI Options\n\n| Option | Description |\n| --- | --- |\n| `-m, --message \u003Ctext>` | Run a one-shot message and skip interactive mode |\n| `-p, --prompt \u003Ctext>` | Alias for `--message` |\n| `-r, --resume \u003Cid>` | Resume a saved session |\n| `-d, --dir \u003Cpath>` | Set the working directory, defaults to the current directory |\n| `--model \u003Cname>` | Set the model name |\n| `--base-url \u003Curl>` | Set the API base URL |\n| `--api-key \u003Ckey>` | Set the API key |\n| `-V, --version` | Print the version |\n| `-h, --help` | Show help |\n\n## Interactive Commands\n\n| Command | Description |\n| --- | --- |\n| `\u002Fhelp` | Show available commands |\n| `\u002Freset` | Clear the current conversation history |\n| `\u002Fmodel` | Show the active model |\n| `\u002Fmodel \u003Cname>` | Switch models during the current session |\n| `\u002Ftokens` | Show token usage and estimated cost when available |\n| `\u002Fcompact` | Compress the current conversation context |\n| `\u002Fdiff` | Show files modified during the current session |\n| `\u002Fsave` | Save the current session |\n| `\u002Fsessions` | List recently saved sessions |\n| `quit` \u002F `exit` | Exit CyCode |\n\n## Configuration\n\nCyCode loads `.env` from the current directory or a parent directory. Common configuration variables:\n\n| Environment Variable | Description | Default |\n| --- | --- | --- |\n| `CYCODE_API_KEY` | CyCode-specific API key, highest priority | None |\n| `OPENAI_API_KEY` | OpenAI API key | None |\n| `DEEPSEEK_API_KEY` | DeepSeek API key | None |\n| `DASHSCOPE_API_KEY` | DashScope API key | None |\n| `CYCODE_MODEL` | CyCode-specific model name | `qwen3.6-plus` |\n| `MODEL` | Generic model name | `qwen3.6-plus` |\n| `OPENAI_BASE_URL` | OpenAI-compatible base URL | None |\n| `CYCODE_BASE_URL` | CyCode-specific base URL | None |\n| `DASHSCOPE_BASE_URL` | DashScope base URL | None |\n| `MAX_TURNS` | Maximum tool-use turns for a single task | `50` |\n| `CYCODE_MAX_TOKENS` | Maximum model output tokens per call | `4096` |\n| `CYCODE_TEMPERATURE` | Model sampling temperature | `0` |\n| `CYCODE_MAX_CONTEXT` | Context compression threshold | `128000` |\n| `CYCODE_HOME` | Root directory for saved sessions | `~\u002F.cycode` |\n\nAPI key priority is: `CYCODE_API_KEY`, `OPENAI_API_KEY`, `DEEPSEEK_API_KEY`, `DASHSCOPE_API_KEY`.\n\n## Built-In Tools\n\nCyCode exposes the following tools to the model:\n\n| Tool | Description |\n| --- | --- |\n| `read_file` | Read file contents with optional line ranges |\n| `edit_file` | Replace a unique text fragment and return a unified diff |\n| `write_file` | Create a new file or fully rewrite a file |\n| `bash` | Run a shell command in the working directory and return stdout\u002Fstderr |\n| `grep` | Search file contents with a regular expression |\n| `glob` | Find files with a glob pattern |\n| `agent` | Spawn a sub-agent for complex subtasks |\n\nThe `bash` tool blocks several high-risk command patterns, such as forced recursive deletion, filesystem formatting, and piping downloaded scripts into a shell. This is not a complete sandbox. Run CyCode only in repositories and environments you trust.\n\n## Project Structure\n\n```text\n.\n├── src\u002F\n│   ├── agent.ts              # Agent loop, tool execution, and lifecycle events\n│   ├── cli.ts                # CLI entry point and option parsing\n│   ├── config.ts             # Environment and runtime configuration\n│   ├── context.ts            # Context estimation and compression\n│   ├── llm.ts                # OpenAI-compatible streaming client wrapper\n│   ├── repl.ts               # Interactive entry point and text REPL fallback\n│   ├── session.ts            # Session save, load, and list operations\n│   ├── tool-registry.ts      # Tool registration and execution\n│   ├── tools\u002F                # Built-in tool implementations\n│   └── tui\u002F                  # Ink TUI UI and components\n├── tests\u002F                    # Node.js test runner tests\n├── docs\u002F                     # Design documentation\n├── package.json\n└── tsconfig.json\n```\n\n## Development\n\n```bash\nnpm run build\nnpm test\nnpm run dev\n```\n\nScripts:\n\n| Script | Description |\n| --- | --- |\n| `npm run build` | Compile TypeScript into `dist\u002F` |\n| `npm start` | Run `dist\u002Fcli.js` |\n| `npm run dev` | Build, then run the CLI |\n| `npm test` | Build, then run `tests\u002F*.test.mjs` |\n\n## Programmatic API\n\nAfter building, the core modules can be reused from the package entry point:\n\n```ts\nimport { Agent, loadConfig, createToolRegistry } from \"cycode\";\n\nconst config = loadConfig({ workingDir: process.cwd() });\nconst registry = createToolRegistry(config);\nconst agent = new Agent(config, registry);\n\nconst result = await agent.run(\"Summarize the current project structure\");\nconsole.log(result);\n```\n\n## Sessions\n\nUse `\u002Fsave` in interactive mode to save the current session. Sessions are stored by default in:\n\n```text\n~\u002F.cycode\u002Fsessions\n```\n\nResume a session:\n\n```bash\nnode dist\u002Fcli.js --resume session_20260627_abcdef12\n```\n\nTo change the session storage root:\n\n```bash\nCYCODE_HOME=\u002Fpath\u002Fto\u002Fcycode-home node dist\u002Fcli.js\n```\n\n## Notes\n\n- CyCode can read and modify files in the working directory and execute shell commands. Use it in trusted workspaces.\n- `edit_file` depends on exact text matching. If the target fragment is not unique, the edit is rejected and more context is required.\n- One-shot mode preserves plain stdout behavior for scripting. Interactive mode prefers the TUI.\n- Different compatible providers may vary in streaming, tool calling, and `stream_options` support. CyCode retries with a downgraded streaming request when needed.\n\n## License\n\nThis repository does not currently declare a license. Add an explicit license before publishing or distributing the project.\n","CyCode 是一个轻量级终端内 AI 编程智能体，专为本地软件工程任务设计。它兼容 OpenAI Chat Completions API（支持 OpenAI、DeepSeek、Qwen 等多厂商模型），提供文件读取、精准文本编辑、代码搜索、Shell 命令执行及子智能体协同等内置工具，并具备会话管理、上下文压缩与令牌\u002F成本追踪能力。其终端优先交互界面（Ink TUI + 文本 REPL 回退）和一键式命令模式（--message\u002F--prompt）适合开发者在理解代码库、修复缺陷、重构代码、生成局部变更及自动化仓库级任务时使用。",2,"2026-07-10 02:30:27","CREATED_QUERY"]