diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index f0255751789..f03b57b2bb8 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -1,10 +1,5 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# Sample workflow for building and deploying a Jekyll site to GitHub Pages -name: Deploy Jekyll site to Pages +# Workflow for building and deploying the docmd site to GitHub Pages +name: Deploy site to Pages on: push: @@ -40,21 +35,21 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Setup Ruby - uses: ruby/setup-ruby@v1 + - name: Setup Node + uses: actions/setup-node@v4 with: - ruby-version: '3.3' # Not needed with a .ruby-version file - bundler-cache: true # runs 'bundle install' and caches installed gems automatically - cache-version: 0 # Increment this number if you need to re-download cached gems - working-directory: '${{ github.workspace }}/cecli/website' + node-version: '20' + cache: npm + cache-dependency-path: 'cecli/website/package-lock.json' - name: Setup Pages id: pages uses: actions/configure-pages@v3 - - name: Build with Jekyll - # Outputs to the './_site' directory by default - run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" - env: - JEKYLL_ENV: production + - name: Install dependencies + run: npm ci + working-directory: cecli/website + - name: Build site with docmd + run: bash ../../scripts/docmd_build.sh + working-directory: cecli/website - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: @@ -71,7 +66,7 @@ jobs: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 - + - name: Set up Python 3.12 uses: actions/setup-python@v5 with: @@ -84,4 +79,4 @@ jobs: - name: Run linkchecker run: | - linkchecker --ignore-url='.+\.(mp4|mov|avi)' https://cecli.dev + linkchecker --ignore-url='.+\\.(mp4|mov|avi)' https://cecli.dev diff --git a/.gitignore b/.gitignore index a81d4afa99d..22b4725523a 100644 --- a/.gitignore +++ b/.gitignore @@ -44,4 +44,7 @@ env/ __pycache__/ # Ignore Folders -cecli/website/_site/* \ No newline at end of file +cecli/website/_site/* +cecli/website/.sass-cache/* +cecli/website/.docmd-*/* +cecli/website/node_modules/* \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index efa5bcf3f7e..a5069f91e35 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,7 +23,7 @@ ensure that your contributions can be integrated smoothly. ```bash # Clone the repository -git clone https://github.com/dwash96/cecli.git +git clone https://github.com/cecli-dev/cecli.git cd cecli # Make a venv @@ -68,12 +68,12 @@ In order for your PR to be accepted it must: 2. Comply with project coding standards (including running the pre-commit formatting hooks) 3. Include test coverage 4. Update relevant user-facing documentation: - - Primary documentation will live in `aider/website/docs/config/` + - Primary documentation will live in `cecli/website/docs/config/` - Check new cli arguments with the output of `/help` and `--help` ### Python Compatibility -cecli supports Python versions 3.10, 3.11, 3.12, 3.13, and 3.14. When contributing code, ensure compatibility with these supported Python versions. +Cecli supports Python versions 3.10, 3.11, 3.12, 3.13, and 3.14. When contributing code, ensure compatibility with these supported Python versions. ### Code Style @@ -81,7 +81,7 @@ The project follows the [PEP 8](https://www.python.org/dev/peps/pep-0008/) style ### Testing -The project uses [pytest](https://docs.pytest.org/en/latest/) for running unit tests. The test files are located in the `aider/tests` directory and follow the naming convention `test_*.py`. +The project uses [pytest](https://docs.pytest.org/en/latest/) for running unit tests. The test files are located in the `tests` directory and follow the naming convention `test_*.py`. #### Running Tests @@ -105,7 +105,7 @@ The project uses GitHub Actions for continuous integration. The testing workflow - `.github/workflows/ubuntu-tests.yml`: Runs tests on Ubuntu for Python versions 3.9 through 3.12. - `.github/workflows/windows-tests.yml`: Runs that on Windows -These workflows are triggered on push and pull request events to the `main` branch, ignoring changes to the `aider/website/**` and `README.md` files. +These workflows are triggered on push and pull request events to the `main` branch, ignoring changes to the `cecli/website/**` and `README.md` files. #### Docker Build and Test @@ -113,9 +113,9 @@ The `.github/workflows/docker-build-test.yml` workflow is used to build a Docker #### Writing Tests -When contributing new features or making changes to existing code, ensure that you write appropriate tests to maintain code coverage. Follow the existing patterns and naming conventions used in the `aider/tests` directory. +When contributing new features or making changes to existing code, ensure that you write appropriate tests to maintain code coverage. Follow the existing patterns and naming conventions used in the `tests` directory. -If you need to mock or create test data, consider adding it to the test files or creating separate fixtures or utility functions within the `aider/tests` directory. +If you need to mock or create test data, consider adding it to the test files or creating separate fixtures or utility functions within the `tests` directory. #### Test Requirements @@ -142,21 +142,27 @@ You can also pass one argument to `pip-compile.sh`, which will flow through to ` ### Building the Documentation -The project's documentation is built using Jekyll and hosted on GitHub Pages. To build the documentation locally, follow these steps: +The project's documentation is built with [docmd](https://docmd.io) and hosted on GitHub Pages. To build the documentation locally, follow these steps: -1. Install Ruby and Bundler (if not already installed). -2. Navigate to the `aider/website` directory. -3. Install the required gems: +1. Install Node.js 18 or newer (the build uses `npx`). +2. Navigate to the `cecli/website` directory. +3. Install the required npm dependencies: ``` - bundle install + npm install ``` 4. Build the documentation: ``` - bundle exec jekyll build + npm run build + ``` + Or run the full site build (homepage + docs + assets) with: + ``` + bash ../../scripts/docmd_build.sh ``` 5. Preview the website while editing (optional): ``` - bundle exec jekyll serve + npm run dev ``` +Built documentation is written to `cecli/website/_site` by `scripts/docmd_build.sh` (docs land in `_site/docs`, the homepage in `_site/index.html`). + The built documentation will be available in the `cecli/website/_site` directory. diff --git a/cecli/coders/agent_coder.py b/cecli/coders/agent_coder.py index 78bd299c077..a6951ad5771 100644 --- a/cecli/coders/agent_coder.py +++ b/cecli/coders/agent_coder.py @@ -12,6 +12,8 @@ from datetime import datetime from pathlib import Path +import xxhash + from cecli.args import AGENT_CONFIG_LIST_FIELDS from cecli.change_tracker import ChangeTracker from cecli.helpers import nested, responses @@ -631,6 +633,8 @@ def format_chat_chunks(self): ConversationService.get_chunks(self).add_readonly_files_messages() ConversationService.get_chunks(self).add_chat_files_messages() + ConversationService.get_manager(self).flush_queue() + # Add post-message context blocks (priority 250 - between CUR and REMINDER) ConversationService.get_chunks(self).add_post_message_context_blocks() @@ -920,20 +924,20 @@ async def gather_and_await(): "# Fix the linting errors below, and then continue with your task.", 1, ) + lint_hash = xxhash.xxh3_128_hexdigest(lint_errors.encode("utf-8", errors="replace")) ConversationService.get_manager(self).add_message( message_dict=dict(role="user", content=lint_errors), tag=MessageTag.LINT, - hash_key=("lint_errors", "agent", lint_errors), + hash_key=("lint_errors", "agent", lint_hash), ) - ConversationService.get_manager(self).add_message( + ConversationService.get_manager(self).queue_message( message_dict=dict( role="user", content="Please address the latest linting errors." ), tag=MessageTag.LINT, - hash_key=("lint_errors", "agent", lint_errors, "cta"), + hash_key=("lint_errors", "agent", lint_hash, "cta"), promotion=ConversationService.get_manager(self).DEFAULT_TAG_PROMOTION_VALUE, mark_for_demotion=1, - mark_for_delete=0, ) else: if has_errors: @@ -1351,7 +1355,7 @@ def _generate_tool_context(self, repetitive_tools): ) if repetition_warning: - ConversationService.get_manager(self).add_message( + ConversationService.get_manager(self).queue_message( message_dict=dict(role="user", content=repetition_warning), tag=MessageTag.CUR, hash_key=("repetition", "agent"), diff --git a/cecli/coders/base_coder.py b/cecli/coders/base_coder.py index f7c3b3c2419..ecea205b025 100755 --- a/cecli/coders/base_coder.py +++ b/cecli/coders/base_coder.py @@ -19,6 +19,8 @@ from collections import defaultdict from datetime import date, datetime +import xxhash + # Optional dependency: used to convert locale codes (eg ``en_US``) # into human-readable language names (eg ``English``). try: @@ -40,6 +42,7 @@ from cecli.helpers.conversation import ConversationService, MessageTag from cecli.helpers.file_system import FileSystemService from cecli.helpers.io_proxy import IOProxy +from cecli.helpers.memory_control import trim_memory from cecli.helpers.observations.service import ObservationService from cecli.helpers.profiler import TokenProfiler from cecli.helpers.threading import ThreadSafeEvent @@ -317,6 +320,7 @@ async def create( mcp_manager=from_coder.mcp_manager, registered_tools=copy.deepcopy(from_coder.registered_tools), registered_servers=copy.deepcopy(from_coder.registered_servers), + auto_memory=from_coder.auto_memory, uuid=from_coder.uuid, parent_uuid=from_coder.parent_uuid, repo=from_coder.repo, @@ -1797,6 +1801,8 @@ async def generate(self, user_message, preproc): self.run_one_completed = True self.compact_context_completed = True self.io.stop_spinner() + # Trim memory in the background so it doesn't stall the event loop + coroutines.fire_and_forget(asyncio.to_thread(trim_memory)) def copy_context(self): if self.auto_copy_context: @@ -1880,6 +1886,8 @@ async def run_one(self, user_message, preproc): ConversationService.get_chunks(self).flush_removals() self.last_user_message = user_message self.error_code = None + # Trim memory in the background so it doesn't delay the response + coroutines.fire_and_forget(asyncio.to_thread(trim_memory)) # Fire memorizer after each user request # if self.auto_memory and self.edit_format not in ["subagent"]: # from cecli.helpers.memory.utils import invoke_memorizer @@ -2439,6 +2447,8 @@ def format_chat_chunks(self): # Add chat and edit file messages ConversationService.get_chunks(self).add_chat_files_messages() + ConversationService.get_manager(self).flush_queue() + # Return formatted messages for LLM return ConversationService.get_manager(self).get_messages_dict() @@ -2567,12 +2577,14 @@ async def send_message(self, inp): self.format_chat_chunks() # Always add user message to conversation manager - ConversationService.get_manager(self).add_message( + ConversationService.get_manager(self).queue_message( message_dict=dict(role="user", content=inp), tag=MessageTag.CUR, - hash_key=("user_message", inp, str(time.monotonic_ns())), - promotion=ConversationService.get_manager(self).DEFAULT_TAG_PROMOTION_VALUE, - mark_for_demotion=1, + hash_key=( + "user_message", + xxhash.xxh3_128_hexdigest(inp.encode("utf-8", errors="replace")), + str(time.monotonic_ns()), + ), ) ConversationService.get_manager(self).decrement_message_markers() @@ -2765,6 +2777,7 @@ async def format_in_executor(): await self.show_exhausted_error() self.num_exhausted_context_windows += 1 + self._release_response_buffers() return if self.partial_response_function_call: args = self.parse_partial_args() @@ -2798,6 +2811,9 @@ async def format_in_executor(): mark_for_demotion=1, ) + # The reply was interrupted mid-stream; drop the partial chunk buffers + # rather than holding them until the next send(). + self._release_response_buffers() return edited = await self.apply_updates() @@ -2883,6 +2899,11 @@ async def format_in_executor(): self.reflected_message = test_errors return + # Turn complete: drop the per-turn LLM stream buffers. They are reset at + # the start of the next send(), so holding on to them while idle only + # wastes memory (chunks can be large for long streaming responses). + self._release_response_buffers() + def _extract_and_prepare_tool_calls(self, tool_call_response): """ Unified extraction and preparation of tool calls. @@ -3401,6 +3422,16 @@ def __del__(self): """Cleanup when the Coder object is destroyed.""" self.ok_to_warm_cache = False + def _release_response_buffers(self): + """Drop per-turn LLM stream data now that the turn has completed. + + `partial_response_content` is intentionally kept: subclasses and callers + (get_edits, reply_completed, run_stream, ...) read it after the turn. + """ + self.partial_response_chunks = [] + self.partial_response_consolidated = None + self.partial_response_reasoning_content = "" + async def add_assistant_reply_to_cur_messages(self): """ Add the assistant's reply to `cur_messages`. @@ -3447,10 +3478,17 @@ async def add_assistant_reply_to_cur_messages(self): self.io.tool_warning("Execution stopped by end message hook") return + if self.edit_format in ("agent", "subagent"): + msg.pop("function_call", None) + ConversationService.get_manager(self).add_message( message_dict=msg, tag=MessageTag.CUR, - hash_key=("assistant_message", str(msg), str(time.monotonic_ns())), + hash_key=( + "assistant_message", + xxhash.xxh3_128_hexdigest(str(msg).encode("utf-8", errors="replace")), + str(time.monotonic_ns()), + ), # promotion=ConversationService.get_manager(self).DEFAULT_TAG_PROMOTION_VALUE, # mark_for_demotion=1, ) diff --git a/cecli/commands/__init__.py b/cecli/commands/__init__.py index ef69f9053eb..a95eb7d0104 100644 --- a/cecli/commands/__init__.py +++ b/cecli/commands/__init__.py @@ -13,6 +13,7 @@ from .agent_tree import AgentTreeCommand from .architect import ArchitectCommand from .ask import AskCommand +from .auto_memory import AutoMemoryCommand from .clear import ClearCommand from .code import CodeCommand from .command_prefix import CommandPrefixCommand @@ -61,6 +62,7 @@ from .reasoning_effort import ReasoningEffortCommand from .remove_hook import RemoveHookCommand from .remove_mcp import RemoveMcpCommand +from .remove_memory import RemoveMemoryCommand from .remove_skill import RemoveSkillCommand from .report import ReportCommand from .reset import ResetCommand @@ -68,6 +70,7 @@ from .run import RunCommand from .save import SaveCommand from .save_session import SaveSessionCommand +from .search_memory import SearchMemoryCommand from .settings import SettingsCommand from .spawn_agent import SpawnAgentCommand from .switch_agent import SwitchAgentCommand @@ -100,6 +103,7 @@ CommandRegistry.register(AgentTreeCommand) CommandRegistry.register(ArchitectCommand) CommandRegistry.register(AskCommand) +CommandRegistry.register(AutoMemoryCommand) CommandRegistry.register(ClearCommand) CommandRegistry.register(CodeCommand) CommandRegistry.register(CommandPrefixCommand) @@ -150,6 +154,7 @@ CommandRegistry.register(ReasoningEffortCommand) CommandRegistry.register(RemoveHookCommand) CommandRegistry.register(RemoveMcpCommand) +CommandRegistry.register(RemoveMemoryCommand) CommandRegistry.register(RemoveSkillCommand) CommandRegistry.register(ReportCommand) CommandRegistry.register(ResetCommand) @@ -157,6 +162,7 @@ CommandRegistry.register(RunCommand) CommandRegistry.register(SaveCommand) CommandRegistry.register(SaveSessionCommand) +CommandRegistry.register(SearchMemoryCommand) CommandRegistry.register(SettingsCommand) CommandRegistry.register(TerminalSetupCommand) CommandRegistry.register(TestCommand) @@ -176,6 +182,7 @@ "AgentTreeCommand", "ArchitectCommand", "AskCommand", + "AutoMemoryCommand", "BaseCommand", "ClearCommand", "CodeCommand", @@ -237,6 +244,7 @@ "ReloadProgramSignal", "RemoveHookCommand", "RemoveMcpCommand", + "RemoveMemoryCommand", "RemoveSkillCommand", "ReportCommand", "ResetCommand", @@ -244,6 +252,7 @@ "RunCommand", "SaveCommand", "SaveSessionCommand", + "SearchMemoryCommand", "SettingsCommand", "SwitchCoderSignal", "TerminalSetupCommand", diff --git a/cecli/commands/auto_memory.py b/cecli/commands/auto_memory.py new file mode 100644 index 00000000000..775adeacd37 --- /dev/null +++ b/cecli/commands/auto_memory.py @@ -0,0 +1,117 @@ +"""Auto-memory command - view or toggle automatic memorizer invocation. + +Controls the ``coder.auto_memory`` flag, which decides whether the +memorizer sub-agent is fired automatically after context compaction. +``on``/``off`` propagate the setting to every tracked sub-agent so the +whole agent tree stays consistent. +""" + +from typing import List + +from cecli.commands.utils.base_command import BaseCommand +from cecli.commands.utils.helpers import format_command_result +from cecli.helpers.agents.service import AgentService + + +class AutoMemoryCommand(BaseCommand): + NORM_NAME = "auto-memory" + DESCRIPTION = "View or toggle automatic memory (memorizer) on/off" + + @classmethod + async def execute(cls, io, coder, args, **kwargs): + """View or toggle automatic memory on/off. + + Syntax: + /auto-memory — Show the current status + /auto-memory on — Enable for this coder and all sub-agents + /auto-memory off — Disable for this coder and all sub-agents + """ + arg = args.strip().lower() + + if not arg: + cls._show_status(io, coder) + + return format_command_result(io, cls.NORM_NAME, "Displayed auto-memory status") + + if arg not in ("on", "off"): + io.tool_error("Usage: /auto-memory [on|off]") + + return format_command_result( + io, + cls.NORM_NAME, + "Unknown option", + f"Expected 'on' or 'off', got '{arg}'", + ) + + enabled = arg == "on" + updated = cls._set_auto_memory(coder, enabled) + state = "ON" if enabled else "OFF" + + io.tool_output( + f"Auto memory is now {state} for the current coder and {len(updated)} sub-agent(s)." + ) + + return format_command_result(io, cls.NORM_NAME, f"Auto memory set to {state}") + + @classmethod + def get_completions(cls, io, coder, args) -> List[str]: + """Return completion options for auto-memory.""" + return ["on", "off"] + + @classmethod + def get_help(cls) -> str: + """Get help text for the auto-memory command.""" + help_text = super().get_help() + help_text += "\nUsage:\n" + help_text += " /auto-memory # Show the current status\n" + help_text += " /auto-memory on # Enable automatic memory for all agents\n" + help_text += " /auto-memory off # Disable automatic memory for all agents\n" + help_text += "\nWith 'on' or 'off' the setting is applied to the current coder and\n" + help_text += "iterated through every sub-agent so the whole tree stays consistent.\n" + + return help_text + + @classmethod + def _show_status(cls, io, coder) -> None: + """Print the current auto-memory status for the coder and its sub-agents.""" + state = "ON" if getattr(coder, "auto_memory", True) else "OFF" + io.tool_output(f"Auto memory is {state} for the current coder.") + + sub_infos = cls._get_sub_agent_infos(coder) + + if not sub_infos: + return + + io.tool_output(f"Sub-agents ({len(sub_infos)}):") + + for info in sub_infos: + sub_state = "ON" if getattr(info.coder, "auto_memory", True) else "OFF" + io.tool_output(f" {info.name} ({info.coder.uuid}): {sub_state}") + + @classmethod + def _set_auto_memory(cls, coder, enabled: bool) -> list: + """Set auto_memory on *coder* and every tracked sub-agent coder. + + Returns the list of sub-agent info objects whose coder was updated. + """ + coder.auto_memory = enabled + updated = [] + + for info in cls._get_sub_agent_infos(coder): + try: + info.coder.auto_memory = enabled + updated.append(info) + except Exception: + continue + + return updated + + @classmethod + def _get_sub_agent_infos(cls, coder) -> list: + """Return all sub-agent info objects tracked by the coder's AgentService.""" + try: + agent_service = AgentService.get_instance(coder) + + return list(agent_service.sub_agents.values()) + except Exception: + return [] diff --git a/cecli/commands/code.py b/cecli/commands/code.py index c093c1e85de..590e8461b74 100644 --- a/cecli/commands/code.py +++ b/cecli/commands/code.py @@ -16,7 +16,7 @@ async def execute(cls, io, coder, args, **kwargs): edit_format = coder.main_model.edit_format else: # Default to a reasonable edit format if main_model is not available - edit_format = "wholefile" + edit_format = "whole" return await cls._generic_chat_command(io, coder, args, edit_format) @classmethod diff --git a/cecli/commands/copy.py b/cecli/commands/copy.py index 4edb3b1c180..7c30b6a303e 100644 --- a/cecli/commands/copy.py +++ b/cecli/commands/copy.py @@ -15,7 +15,9 @@ class CopyCommand(BaseCommand): @classmethod async def execute(cls, io, coder, args, **kwargs): # Get all messages from ConversationManager - all_messages = ConversationService.get_manager(coder).get_messages_dict() + manager = ConversationService.get_manager(coder) + manager.flush_queue() + all_messages = manager.get_messages_dict() assistant_messages = [msg for msg in reversed(all_messages) if msg["role"] == "assistant"] if not assistant_messages: diff --git a/cecli/commands/copy_context.py b/cecli/commands/copy_context.py index ced8704a8cf..1a0c5fe9859 100644 --- a/cecli/commands/copy_context.py +++ b/cecli/commands/copy_context.py @@ -16,6 +16,7 @@ class CopyContextCommand(BaseCommand): async def execute(cls, io, coder, args, **kwargs): """Execute the copy-context command with given parameters.""" manager = ConversationService.get_manager(coder) + manager.flush_queue() markdown = "" diff --git a/cecli/commands/help.py b/cecli/commands/help.py index e3e364d0828..14c5c29fd39 100644 --- a/cecli/commands/help.py +++ b/cecli/commands/help.py @@ -17,6 +17,8 @@ async def execute(cls, io, coder, args, **kwargs): await cls._basic_help(io, coder) return format_command_result(io, "help", "Displayed basic help") + from uuid import uuid4 as generate_unique_id + from cecli.coders.base_coder import Coder from cecli.help import Help, install_help_extra @@ -34,15 +36,18 @@ async def execute(cls, io, coder, args, **kwargs): from cecli.commands import Commands commands_instance = Commands(io, coder) - commands_instance.help = Help() + commands_instance.help = Help(coder=coder) help_instance = commands_instance.help # Use the editor_model from the main_model if it exists, otherwise use the main_model itself editor_model = coder.main_model.editor_model or coder.main_model + original_coder = coder + kwargs = dict() kwargs["io"] = io + kwargs["uuid"] = str(generate_unique_id()) kwargs["from_coder"] = coder kwargs["edit_format"] = "help" kwargs["summarize_from_coder"] = False @@ -76,7 +81,7 @@ async def execute(cls, io, coder, args, **kwargs): raise SwitchCoderSignal( edit_format=coder.edit_format, summarize_from_coder=False, - from_coder=help_coder, + from_coder=original_coder, map_tokens=map_tokens, map_mul_no_files=map_mul_no_files, show_announcements=False, diff --git a/cecli/commands/remove_memory.py b/cecli/commands/remove_memory.py new file mode 100644 index 00000000000..8104722d54b --- /dev/null +++ b/cecli/commands/remove_memory.py @@ -0,0 +1,66 @@ +"""Remove-memory command - delete facts from the Memorizer fact database. + +Parses a list of fact ids from the argument string — any separator is +accepted (spaces, commas, semicolons, etc.) — and forwards them to the +``remove_facts`` memory utility for deletion. +""" + +import re +from typing import List + +from cecli.commands.utils.base_command import BaseCommand +from cecli.commands.utils.helpers import format_command_result + + +class RemoveMemoryCommand(BaseCommand): + NORM_NAME = "remove-memory" + DESCRIPTION = "Remove facts from the memory fact database by id" + + @classmethod + async def execute(cls, io, coder, args, **kwargs): + """Remove facts from the memory fact database by their ids. + + Syntax: + /remove-memory [ ...] + + Ids may be separated by any non-numeric character (spaces, + commas, semicolons, etc.). Each continuous run of digits is + treated as a fact id and forwarded to ``remove_facts`` for + deletion from the database. + """ + from cecli.helpers.memory.utils import remove_facts + + id_facts = [int(m) for m in re.findall(r"\d+", args)] + + if not id_facts: + io.tool_error("Usage: /remove-memory [ ...]") + + return format_command_result(io, cls.NORM_NAME, "No fact ids provided") + + try: + removed = remove_facts(coder, id_facts=id_facts) + except Exception as exc: + return format_command_result(io, cls.NORM_NAME, "Remove failed", str(exc)) + + io.tool_output(f"Removed {removed} fact(s): {', '.join(str(i) for i in id_facts)}") + + return format_command_result(io, cls.NORM_NAME, f"Removed {removed} fact(s)") + + @classmethod + def get_completions(cls, io, coder, args) -> List[str]: + """Return completion options for remove-memory.""" + return [] + + @classmethod + def get_help(cls) -> str: + """Get help text for the remove-memory command.""" + help_text = super().get_help() + help_text += "\nUsage:\n" + help_text += " /remove-memory [ ...] # Delete facts from the fact database\n" + help_text += "\nExamples:\n" + help_text += " /remove-memory 1\n" + help_text += " /remove-memory 1,2,3 7 10,30\n" + help_text += "\nIds may be separated by any non-numeric character; each\n" + help_text += "continuous run of digits is treated as a fact id.\n" + + return help_text diff --git a/cecli/commands/search_memory.py b/cecli/commands/search_memory.py new file mode 100644 index 00000000000..f78d5df2a39 --- /dev/null +++ b/cecli/commands/search_memory.py @@ -0,0 +1,73 @@ +"""Search-memory command - search the Memorizer fact database. + +Runs the same full-text search the memorizer sub-agent uses (FTS5 +prefix match over fact text via ``search_facts``) and prints the id, +category (tags) and text of every matching fact. +""" + +from typing import List + +from cecli.commands.utils.base_command import BaseCommand +from cecli.commands.utils.helpers import format_command_result + + +class SearchMemoryCommand(BaseCommand): + NORM_NAME = "search-memory" + DESCRIPTION = "Search the memory fact database (same search the memorizer uses)" + + @classmethod + async def execute(cls, io, coder, args, **kwargs): + """Search the memory fact database. + + Syntax: + /search-memory [ ...] + + Each word is matched as a prefix against the fact text, exactly + like the memorizer's SearchFacts tool. Matching facts are shown + with their id, category (tags) and text. + """ + from cecli.helpers.memory.utils import search_facts + + words = args.strip().split() + + if not words: + io.tool_error("Usage: /search-memory [ ...]") + + return format_command_result(io, cls.NORM_NAME, "No search terms provided") + + try: + results = search_facts(coder, words=words) + except Exception as exc: + return format_command_result(io, cls.NORM_NAME, "Search failed", str(exc)) + + if not results: + io.tool_output(f"No facts found matching: {' '.join(words)}") + + return format_command_result(io, cls.NORM_NAME, "No matching facts") + + io.tool_output(f"Found {len(results)} fact(s) matching: {' '.join(words)}") + + for r in results: + category = ", ".join(r["tags"]) if r["tags"] else "(uncategorized)" + io.tool_output(f"[{r['id_fact']}] ({category})\n{r['fact']}\n") + + return format_command_result(io, cls.NORM_NAME, f"Found {len(results)} matching fact(s)") + + @classmethod + def get_completions(cls, io, coder, args) -> List[str]: + """Return completion options for search-memory.""" + return [] + + @classmethod + def get_help(cls) -> str: + """Get help text for the search-memory command.""" + help_text = super().get_help() + help_text += "\nUsage:\n" + help_text += " /search-memory [ ...] # Search the fact database\n" + help_text += "\nExamples:\n" + help_text += " /search-memory preferences\n" + help_text += " /search-memory memory db schema\n" + help_text += "\nRuns the same FTS5 prefix search the memorizer sub-agent uses and\n" + help_text += "prints each match with its id, category (tags) and text.\n" + + return help_text diff --git a/cecli/help.py b/cecli/help.py index 22ae6b03104..338025f4415 100755 --- a/cecli/help.py +++ b/cecli/help.py @@ -66,7 +66,7 @@ def fname_to_url(filepath): return f"https://cecli.dev/{url_path}" -def get_index(): +def get_index(coder=None): from llama_index.core import ( Document, StorageContext, @@ -84,29 +84,45 @@ def get_index(): except (OSError, json.JSONDecodeError): shutil.rmtree(dname) if index is None: - parser = MarkdownNodeParser() - nodes = [] - for fname in get_package_files(): - fname = Path(fname) - if any(fname.match(pat) for pat in exclude_website_pats): - continue - doc = Document( - text=importlib_resources.files("cecli.website") - .joinpath(fname) - .read_text(encoding="utf-8"), - metadata=dict( - filename=fname.name, extension=fname.suffix, url=fname_to_url(str(fname)) - ), - ) - nodes += parser.get_nodes_from_documents([doc]) - index = VectorStoreIndex(nodes, show_progress=True) - dname.parent.mkdir(parents=True, exist_ok=True) - index.storage_context.persist(dname) + io = getattr(coder, "io", None) if coder is not None else None + in_tui = io is not None and _in_tui(coder) + + # Inside the Textual TUI, stdout/stderr are redirected to streams whose + # fileno() == -1, so tqdm's lazily-created multiprocessing.RLock crashes + # with "bad value(s) in fds_to_keep". Use coder.io spinner states instead + # of tqdm there; keep the tqdm progress bar everywhere else. + if in_tui: + io.start_spinner("Parsing help docs...") + try: + parser = MarkdownNodeParser() + nodes = [] + for fname in get_package_files(): + fname = Path(fname) + if any(fname.match(pat) for pat in exclude_website_pats): + continue + doc = Document( + text=importlib_resources.files("cecli.website") + .joinpath(fname) + .read_text(encoding="utf-8"), + metadata=dict( + filename=fname.name, extension=fname.suffix, url=fname_to_url(str(fname)) + ), + ) + nodes += parser.get_nodes_from_documents([doc]) + + if in_tui: + io.update_spinner("Embedding help docs...") + index = VectorStoreIndex(nodes, show_progress=not in_tui) + dname.parent.mkdir(parents=True, exist_ok=True) + index.storage_context.persist(dname) + finally: + if in_tui: + io.stop_spinner() return index class Help: - def __init__(self): + def __init__(self, coder=None): from huggingface_hub.utils import disable_progress_bars from llama_index.core import Settings from llama_index.embeddings.huggingface import HuggingFaceEmbedding @@ -116,7 +132,7 @@ def __init__(self): logging.set_verbosity_error() Settings.embed_model = HuggingFaceEmbedding(model_name="BAAI/bge-small-en-v1.5") - index = get_index() + index = get_index(coder=coder) self.retriever = index.as_retriever(similarity_top_k=20) def ask(self, question): @@ -130,3 +146,25 @@ def ask(self, question): context += node.text context += "\n\n\n" return context + + +def _in_tui(coder): + """Return True if coder is attached to a live TUI app. + + The TUI stores itself on coders as a weakref (``coder.tui = weakref.ref(app)``), + so we dereference it (``tui()``) to confirm the app is alive — mirroring the + ``if coder.tui and coder.tui():`` idiom used across the codebase. + """ + try: + import weakref + + tui_ref = getattr(coder, "tui", None) + if tui_ref is None: + return False + + if isinstance(tui_ref, weakref.ref): + return tui_ref() is not None + + return bool(tui_ref) + except Exception: + return False diff --git a/cecli/helpers/agents/defaults/memorizer.md b/cecli/helpers/agents/defaults/memorizer.md index 28265a4094c..ad7311bde45 100644 --- a/cecli/helpers/agents/defaults/memorizer.md +++ b/cecli/helpers/agents/defaults/memorizer.md @@ -69,6 +69,9 @@ context (e.g. compaction / yield summaries). Your job: 3. Task specific details are not worth recording, focus on user intention and add facts that would help them explain the project to another person succinctly +Start each response with an incrementing number at the beginning, e.g. "1) ...", "2) ..." +When this number hits at most 10, update what you can and yield. Do not deliberate over many turns. +Important facts will be easy to search for and extract from the given context. Always prefer **concrete, reusable** facts over vague prose. Focus on extracting clear results and aids for navigating, modifying, and extending the project in the future. diff --git a/cecli/helpers/agents/service.py b/cecli/helpers/agents/service.py index 0b120f87786..daee627e738 100644 --- a/cecli/helpers/agents/service.py +++ b/cecli/helpers/agents/service.py @@ -424,6 +424,16 @@ def _cleanup_sub_agent(self, agent_uuid: str) -> None: except (KeyError, AttributeError, RuntimeError): logger.warning("Failed to destroy conversation instances", exc_info=True) + # Unregister the sub-agent's input queue from the global registry so it + # does not leak for the process lifetime (IOProxy registers one queue + # per coder, including every sub-agent). + from cecli.helpers import queues as _queues + + try: + _queues.unregister_coder_queue(info.coder.uuid) + except (KeyError, AttributeError, RuntimeError): + logger.warning("Failed to unregister coder queue", exc_info=True) + # Destroy hook resources for the sub-agent from cecli.hooks.service import HookService diff --git a/cecli/helpers/background_commands.py b/cecli/helpers/background_commands.py index 7e21687d194..47d4e1c41fa 100644 --- a/cecli/helpers/background_commands.py +++ b/cecli/helpers/background_commands.py @@ -183,6 +183,31 @@ def reader(): def _strip_ansi(text: str) -> str: return _ansi_escape.sub("", text) + def _pump(stream, use_readline=False, strip_ansi=False): + """Blocking read pump for a single output stream. + + Uses a blocking read instead of non-blocking reads + polling, + so it consumes no CPU while idle and works identically on + Linux, macOS, and Windows (select/os.set_blocking are + socket-only on Windows and cannot be used on pipes there). + """ + while not self._stop_event.is_set(): + try: + if use_readline: + # Fallback when fileno() is unavailable + # (e.g. mock objects in tests) + data = stream.readline() + else: + data = os.read(stream.fileno(), 4096).decode(errors="replace") + except (OSError, EOFError, ValueError): + break + if not data: + # EOF: the process exited or the stream closed + break + if strip_ansi: + data = _strip_ansi(data) + self.buffer.append(data) + try: if self.master_fd is not None: while not self._stop_event.is_set(): @@ -195,64 +220,49 @@ def _strip_ansi(text: str) -> str: except (OSError, EOFError): break else: - has_stdout_fileno = hasattr(self.process.stdout, "fileno") - if has_stdout_fileno: - os.set_blocking(self.process.stdout.fileno(), False) - while not self._stop_event.is_set(): - try: - if has_stdout_fileno: - # Use os.read() instead of readline() to capture - # partial line output (e.g. REPL prompts without newlines) - data = os.read(self.process.stdout.fileno(), 4096).decode( - errors="replace" - ) - else: - # Fallback to readline when fileno() is unavailable - # (e.g. mock objects in tests) - data = self.process.stdout.readline() - if data: - self.buffer.append(data) - else: - # Check if process died - if not self.is_alive(): - if has_stdout_fileno: - # Read any remaining data - try: - remaining = os.read( - self.process.stdout.fileno(), 4096 - ).decode(errors="replace") - if remaining: - self.buffer.append(remaining) - except (OSError, EOFError): - pass - break - import time - - time.sleep(0.05) - except (OSError, EOFError, ValueError): - if not self.is_alive(): - break - import time - - time.sleep(0.05) - - # Also capture stderr (best-effort, non-blocking) + # Pipe mode: spawn one blocking pump per stream so stderr + # cannot fill up while stdout is being read. Pumps use + # blocking reads and stop on EOF, which stop() triggers by + # terminating the process (closing the pipe write ends). + # A grandchild that inherits those write ends keeps a pump + # alive until it exits (bounded by the daemon thread and + # self-healing). + pumps = [] + if hasattr(self.process.stdout, "fileno"): + # Use os.read() instead of readline() to capture + # partial line output (e.g. REPL prompts without newlines) + pumps.append( + threading.Thread( + target=_pump, + args=(self.process.stdout,), + daemon=True, + ) + ) + else: + # Fallback to readline when fileno() is unavailable + # (e.g. mock objects in tests) + pumps.append( + threading.Thread( + target=_pump, + args=(self.process.stdout, True), + daemon=True, + ) + ) if hasattr(self.process.stderr, "fileno"): - try: - os.set_blocking(self.process.stderr.fileno(), False) - while True: - try: - err_data = os.read(self.process.stderr.fileno(), 4096).decode( - errors="replace" - ) - if not err_data: - break - self.buffer.append(err_data) - except (OSError, EOFError): - break - except Exception: - pass + # Best-effort stderr capture + pumps.append( + threading.Thread( + target=_pump, + args=(self.process.stderr,), + daemon=True, + ) + ) + + for pump_thread in pumps: + pump_thread.start() + for pump_thread in pumps: + pump_thread.join() except Exception as e: self.buffer.append(f"\n[Error reading process output: {str(e)}]\n") diff --git a/cecli/helpers/memory_control.py b/cecli/helpers/memory_control.py new file mode 100644 index 00000000000..481ababe639 --- /dev/null +++ b/cecli/helpers/memory_control.py @@ -0,0 +1,99 @@ +import logging +import threading +import time + +logger = logging.getLogger(__name__) + +# Global variables for throttling +_LAST_TRIM_TIME = 0.0 +_TRIM_THROTTLE_SECONDS = 15.0 +_TRIM_LOCK = threading.Lock() + + +def trim_memory(): + """ + Attempt to release unused memory back to the operating system. + + Runs gc.collect() first, then makes OS-specific calls. On non-Linux + platforms this degrades to a gc-only pass. Throttled to run at most + once every 15 seconds. + """ + global _LAST_TRIM_TIME + + current_time = time.monotonic() + + # Atomically check-and-update the throttle so concurrent callers + # (TUI, command runner, MCP threads) cannot both pass the window. + with _TRIM_LOCK: + if current_time - _LAST_TRIM_TIME < _TRIM_THROTTLE_SECONDS: + logger.debug( + f"trim_memory() throttled. (Ran {current_time - _LAST_TRIM_TIME:.1f}s ago)" + ) + return + + # Update the timestamp for this run + _LAST_TRIM_TIME = current_time + + # Defensive guard: never let memory-trimming failure break the caller. + try: + _trim_memory_impl() + except Exception as e: + logger.warning(f"trim_memory() failed: {e}", exc_info=True) + + +def _rss_kb(): + """Return current RSS in KB from /proc/self/status (0 if unavailable).""" + try: + with open("/proc/self/status") as f: + for line in f: + if line.startswith("VmRSS:"): + return int(line.split()[1]) + except (OSError, ValueError, IndexError): + pass + return 0 + + +def _load_libc(): + """Load the C library and configure the malloc_trim signature.""" + import ctypes + import ctypes.util + + libc_name = ctypes.util.find_library("c") or "libc.so.6" + libc = ctypes.CDLL(libc_name) + libc.malloc_trim.argtypes = [ctypes.c_size_t] + libc.malloc_trim.restype = ctypes.c_int + return libc + + +def _trim_memory_impl(): + """Run the gc.collect() + OS-specific memory trimming work.""" + import gc + import sys + + # 1. First, force Python to clean up unreferenced objects + reclaimed = gc.collect() + logger.debug(f"Python GC reclaimed {reclaimed} objects.") + + # 2. Make OS-specific calls to release the empty space + if sys.platform.startswith("linux"): + try: + libc = _load_libc() + result = libc.malloc_trim(0) + if result: + logger.debug("Linux: malloc_trim(0) successfully released memory to the OS.") + else: + logger.debug("Linux: malloc_trim(0) ran, but no memory was released.") + except OSError as e: + logger.info(f"Linux: glibc not found (likely musl). Skipping malloc_trim. ({e})") + except AttributeError as e: + logger.info(f"Linux: malloc_trim not supported by this C library. ({e})") + + +if __name__ == "__main__": + logging.basicConfig(level=logging.DEBUG) + + before = _rss_kb() + trim_memory() + after = _rss_kb() + + print(f"RSS before: {before} KB, after: {after} KB, delta: {after - before} KB") diff --git a/cecli/helpers/observations/service.py b/cecli/helpers/observations/service.py index 99b922ecb65..3759bf9f2e5 100644 --- a/cecli/helpers/observations/service.py +++ b/cecli/helpers/observations/service.py @@ -77,7 +77,12 @@ async def run_observation(self, messages): self.is_processing = True try: - all_messages = ConversationService.get_manager(coder).get_messages_dict() + # Use the fully-formatted message dict (system prompt, rules, repo map, + # file contexts, and conversation) from format_chat_chunks() so that + # background observation requests share the same prompt prefix as the + # main chat and get a higher cache hit ratio. Pass a copy because + # summarize_all_as_text() appends the observation prompt in place. + all_messages = list(coder.format_chat_chunks()) prompt = coder.gpt_prompts.observation_prompt if self.observations: prompt += "\n\n---\nCURRENT OBSERVATIONS (Do not duplicate):\n\n" diff --git a/cecli/helpers/orchestration/environment.py b/cecli/helpers/orchestration/environment.py index c8e082b9cdf..0d301da54d5 100644 --- a/cecli/helpers/orchestration/environment.py +++ b/cecli/helpers/orchestration/environment.py @@ -545,122 +545,42 @@ def build_orchestration_context_block(agent_config: dict[str, Any]) -> str | Non orchestration_config = agent_config.get("orchestration", {}) context = """ -The `Orchestrate` tool lets you batch multiple tool calls in a single step by writing Python code in a limited, secure sandbox. -This is much more efficient than making individual tool calls for loop-heavy workflows. -Variables and methods defined in a script are persisted in subsequent turns. -As such, results from previous calls can be reused and helper methods can be defined to enhance ease of use within the environment. +The `Orchestrate` tool runs Python in a sandbox where you can call other tools programmatically. +Use it for batch or loop-heavy workflows. +Variables and helpers persist across calls; `state` persists across all Orchestrate calls in the session. ### Primitives -| Primitive | Description | -|-----------|-------------| -| `Agent.allowed_methods()` | List all available builtin function names | -| `Agent.allowed_tools()` | List all available tool names | +| Primitive | What it does | +|-----------|--------------| +| `Agent.allowed_methods()` / `Agent.allowed_tools()` | List helper methods and available tools | +| `Agent.get_tool(name)` | Get a tool proxy (case-insensitive; `Local--` / `{{Server Name}}--` prefixes ok) | +| `await tool.call(**params)` | Run a tool; returns `{"result": [...], "errors": [...], "details": [...]}`, items with shape `{"content", "_"}` | +| `Agent.peek(result)` / `Agent.get_value(result, "path", default?)` | Inspect / extract values from tool results | +| `Agent.resolve_regions(path, specs)` / `Agent.edit_region(path, edits)` | Resolve text boundaries once, then apply edits | +| `gather(**tasks)` | Run tasks concurrently; results expose `.key` and `["key"]` | +| `state` / `shared_state` | Persistent dicts; `state.get(k)` falls back to `shared_state` | +| `print(...)` / `reset(local_vars=True, state=False)` | Emit output / clear namespaces | +| `typeof(x)`, `isinstance(x, t)`, `hasattr(x, n)`, `repr(x)`, `vars(obj)` | Type inspection and debugging | -| `Agent.get_tool(name)` | Get a tool proxy (case-insensitive, accepts `Local--` or `{{Server}}--` prefix) | -| `await tool.call(**params)` | Execute a tool; returns `{"result": [...], "errors": [...], "details": [...]}` — each result item is `{"content": ..., "_": {...}}` | +### Region editing -| `Agent.peek(result)` | Inspect a tool result's structure and leaf content — returns a string; use `print(Agent.peek(result))` to see it | -| `Agent.get_value(result, path, default?)` | Safely access nested values in tool results using dot-notation (e.g. `"result.0.content"`) | +- `resolve_regions(path, specs)`: + `specs` = `[{"name", "start", "end", "start_line_hint"?, "end_line_hint"?}]`; `start`/`end` are line text, `@L{num}`, or a content ID. + Returns `regions` with `.get(name)` -> `{"start", "end", "start_line", "end_line"}` plus `.get_start(name)` / `.get_end(name)`. +- `edit_region(path, edits)`: + `edits` = `[{"region": regions.get(name), "text", "operation" ("replace"|"delete", default "replace")}]`. -| `Agent.get_content_id(path, text)` | Resolve a content ID from `@L{num}` or line text for EditFile | -| `Agent.resolve_regions(path, regions)` | Batch-resolve text patterns to content IDs. Use `start_line_hint` / `end_line_hint` in region spec entries for disambiguation. Unlike ReadFile (where hints are embedded inline), hints are passed as **separate keys**. For `@L` hints, using an **integer** (e.g., `start_line_hint=394`) is preferred over a string (e.g., `start_line_hint="@L394"`). Ambiguous patterns raise immediately. The returned `AgentRegion` has `.get_start(name)`, `.get_end(name)`, `.names()`, `.get(name)` | -| `Agent.edit_region(path, edits)` | Thin wrapper around EditFile that accepts pre-resolved region dicts `{"start": content_id, "end": content_id}`. Returns the EditFile ToolResult. Use with `Agent.resolve_regions()` and `regions.get(name)` | +### Modules -| `await Agent.sleep(seconds)` | Pause execution (0-120s max) | +Pre-imported, read-only: `re`, `math`, `itertools`, `collections`, `datetime`, `pathlib` (I/O blocked), `json`, `traceback`. Any other import fails. -| `gather(**named_tasks)` | Run tasks concurrently; returns an iterable with `.key` / `["key"]` access | -| `state` / `shared_state` | `state` persists across *all* `Orchestrate` calls within the same agent session (not just one call). `state.get(key)` falls through to ``shared_state`` when the key is not local. `shared_state` persists across *all* agent sessions globally | -| `print(...)` / `reset(local_vars=True, state=False)` | Output messages; clear local namespace (and optionally state) | -| `typeof(x)` / `isinstance(x, t)` / `hasattr(x, n)` / `repr(x)` / `vars(obj)` | Type inspection and debugging | +### Conventions -### Available Modules - -Pre-imported, read-only standard library modules: - -| Module | Common uses | -|--------|-------------| -| `re` | Regular expressions: `re.search(r"pat", s)`, `re.findall(...)` | -| `math` | Math functions: `math.ceil(n)`, `math.sqrt(n)` | -| `itertools` | Combinatorics: `itertools.chain(a, b)`, `itertools.product(...)` | -| `collections` | Container helpers: `collections.Counter(...)`, `collections.defaultdict(...)` | -| `datetime` | Date/time: `datetime.datetime.now()`, `datetime.timedelta(...)` | -| `pathlib` | Safe filesystem paths: `pathlib.Path("/tmp/foo")`, `.parent`, `.name`, `/` joining. I/O methods (``read_text``, ``write_text``, etc.) blocked | -| `json` | Parse / serialize: `json.loads(s)`, `json.dumps(obj, indent=2)` | -| `traceback` | Traceback formatting: `traceback.format_exc()`, `traceback.format_tb(...)` | - -All other module imports will fail. - -### Usage - -```python -tool = Agent.get_tool("delegate") -tool_outputs = await gather( - a=tool.call(prompt="A"), - b=tool.call(prompt="B"), -) -print(tool_outputs.a) # attribute access -print(tool_outputs["b"]) # key access -``` - -### Working with Results - -Use `Agent.peek()` to discover a result's structure, then `Agent.get_value()` -to extract specific fields by dot-path:: - - result = await read_tool.call(file_path="foo.py", range_start="@000", range_end="000@") - print(Agent.peek(result)) - # Shows: result[0].content: str = '...' - # result[0]._.file_path: str = 'foo.py' - - content = Agent.get_value(result, "result.0.content") - file_path = Agent.get_value(result, "result.0._.file_path", "unknown") - -Result list items are plain dicts — use item['content'] / item.get('content') -and item['_'] / item.get('_') to access data and metadata respectively. - - -### Editing with Regions - -Use `Agent.resolve_regions()` to convert text patterns into content IDs, then `Agent.edit_region()` to apply edits using the resolved IDs. - -#### Step 1 — resolve region boundaries once - -```python -regions = Agent.resolve_regions("foo.py", [ - {"name": "my_func", "start": "def my_func", "end": "return result"}, - {"name": "init", "start": "def __init__", "end": "self.x = x"}, -]) -``` - -#### Step 2 — Use `regions.get(name)` with `Agent.edit_region()` (recommended shorthand) - -```python -result = await Agent.edit_region( - file_path="foo.py", - edits=[ - {"region": regions.get("my_func"), "text": "def my_func():\n return 42"}, - ], -) - -# edit_region calls EditFile under the hood -change_id = Agent.get_value(result, "result.0._.change_id") -``` - -#### Alternative: Call `EditFile` directly with `regions.get_start()` / `regions.get_end()` - -### Gotchas - -- **Types**: compare with `typeof(x) == dict` or `isinstance(x, dict)` — NOT `typeof(x) == "dict"` -- **Args**: use keyword args only — `tool.call(file_path="f", ...)` -- **gather**: always use named `gather(x=a, y=b)` — positional args are not supported - -### Rules - -1. No imports - use only the primitives and modules above -2. Do not access attributes starting with `_` (private/dunder) -3. All tool calls must be awaited -4. Use `print(...)` to output results — only printed output is returned +- Keyword args only; `gather()` takes named tasks +- Do not touch private (`_`) attributes or `__builtins__` +- Always `await` tool calls +- Inspect tool results with `Agent.peek()` / `Agent.get_value()`; edit files via `Agent.resolve_regions()` + `Agent.edit_region()` or `EditFile` directly """ # Task 6: Append sandbox configuration overrides when non-empty diff --git a/cecli/helpers/queues.py b/cecli/helpers/queues.py index fe5c0c60fbb..0628bb4a39a 100644 --- a/cecli/helpers/queues.py +++ b/cecli/helpers/queues.py @@ -2,6 +2,7 @@ from __future__ import annotations +import asyncio import queue from typing import Any @@ -11,6 +12,13 @@ # First-registered coder is tracked as the primary (used when no coder_uuid is given) _primary_coder_id: str | None = None +# Event-loop state for waking input consumers. All per-coder input is consumed +# on the coder worker loop; producers (TUI, WebSocket, ACP) push to the +# thread-safe queues and wake waiters through _input_wake instead of forcing +# consumers to poll. +_input_loop: asyncio.AbstractEventLoop | None = None +_input_wake: asyncio.Event | None = None + def register_coder_queue(coder_uuid: str, q: "queue.Queue") -> None: """Register a per-coder input queue. @@ -44,7 +52,8 @@ def push_coder_input(coder_uuid: str, message: str | dict[str, Any]) -> bool: """Push a user input message directly to a coder's input queue. Accepts either a raw string (text input) or a dict (structured message - like confirmation responses). + like confirmation responses). Wakes any coroutine blocked in + wait_for_input() so consumers react immediately instead of polling. Returns True if delivered, False if the coder is not registered. """ @@ -52,6 +61,7 @@ def push_coder_input(coder_uuid: str, message: str | dict[str, Any]) -> bool: if q is None: return False q.put(message) + wake_input_waiters() return True @@ -61,3 +71,40 @@ def get_primary_coder_id() -> str | None: Returns None if no coders have been registered. """ return _primary_coder_id + + +def set_input_loop(loop: asyncio.AbstractEventLoop) -> None: + """Bind the input wake-up state to a specific event loop. + + Consumers awaiting wait_for_input() run on this loop (the coder worker + loop). If this is never called, wait_for_input() binds to the running + loop on first use. + """ + global _input_loop, _input_wake + _input_loop = loop + _input_wake = asyncio.Event() + + +def wake_input_waiters() -> None: + """Wake coroutines blocked in wait_for_input(). + + Safe to call from any thread; the wake is marshaled onto the input loop + via call_soon_threadsafe. No-op if no consumer has bound a loop yet. + """ + loop = _input_loop + if loop is None or _input_wake is None: + return + loop.call_soon_threadsafe(_input_wake.set) + + +async def wait_for_input() -> None: + """Await the next input push without polling. + + Must be called from the input loop (the coder worker loop). Consumers + sweep the payload queues first, then block here until wake_input_waiters() + fires. Initializes the wake state from the running loop on first use. + """ + if _input_loop is None or _input_wake is None: + set_input_loop(asyncio.get_running_loop()) + _input_wake.clear() + await _input_wake.wait() diff --git a/cecli/hooks/helpers.py b/cecli/hooks/helpers.py index 0d0677c2c11..5731088476d 100644 --- a/cecli/hooks/helpers.py +++ b/cecli/hooks/helpers.py @@ -57,6 +57,10 @@ def get_messages( from cecli.helpers.conversation.service import ConversationService manager = ConversationService.get_manager(coder) + # NOTE: intentionally no flush_queue() here. Hooks (esp. post_tool) run + # mid-turn while tool responses are pending, and tool responses must + # follow the assistant message exactly; flushing here would insert + # queued messages between them. messages = manager.get_messages_dict(tag=tag, reload=reload) if last_n is not None and last_n > 0: diff --git a/cecli/mcp/manager.py b/cecli/mcp/manager.py index bcb4d56e7fe..04a221db431 100644 --- a/cecli/mcp/manager.py +++ b/cecli/mcp/manager.py @@ -118,6 +118,11 @@ async def disconnect_server(server: McpServer) -> tuple[McpServer, bool]: del self._server_tools[server.name] self._log_verbose(f"Disconnected from MCP server: {server.name}") return (server, True) + except asyncio.CancelledError: + # Cancellation is expected during shutdown - anyio cancel scopes + # used by MCP transports don't play well with asyncio teardown. + self._log_verbose(f"Disconnect of MCP server {server.name} was cancelled") + return (server, False) except Exception: self._log_warning(f"Error disconnected from MCP server: {server.name}") return (server, False) @@ -125,7 +130,14 @@ async def disconnect_server(server: McpServer) -> tuple[McpServer, bool]: # Create a copy to avoid modifying during iteration servers_to_disconnect = list(self._connected_servers) tasks = [disconnect_server(server) for server in servers_to_disconnect] - results = await asyncio.gather(*tasks) + + try: + results = await asyncio.gather(*tasks) + except asyncio.CancelledError: + # The whole disconnect was cancelled (e.g. during program shutdown). + # Treat this as a graceful shutdown instead of crashing the exit path. + self._log_verbose("MCP disconnect interrupted by shutdown cancellation") + return for server, success in results: if success: diff --git a/cecli/prompts/agent.yml b/cecli/prompts/agent.yml index b9e6572b385..5c429fd580a 100644 --- a/cecli/prompts/agent.yml +++ b/cecli/prompts/agent.yml @@ -29,9 +29,9 @@ main_system: | File contents are presented with virtual prefix identifiers to help you target edits accurately. These are generated on-the-fly when reading the file. - **Unique Lines (`——`):** Lines that appear only once in the file are prefixed with `——`. To target these lines for edits, you can simply reference the exact literal text of the line, excluding the prefix. - - **Duplicate Lines (e.g., `—“0车加—`):** Lines that appear multiple times are prefixed with an identifier containing an occurrence index and a content hash. You MUST include this exact prefix when targeting these lines to disambiguate which specific instance you want to edit. + - **Duplicate Lines (e.g., `—“0车加—`):** Lines that appear multiple times are prefixed with an opaque identifier. You MUST include this exact identifier when targeting these lines to disambiguate which specific instance you want to edit. - Do not attempt to generate, guess, or calculate these duplicate IDs yourself. Always use the exact line contents and prefixes provided from the most recent file read. + Do not attempt to generate, guess, or calculate these identifiers yourself. Always use the exact line contents and prefixes provided from the most recent file read. **Example File** ``` @@ -66,12 +66,11 @@ main_system: | ## Operational Rules - **Scope**: No unrequested refactors. Avoid full-file rewrites. Only modify what you are asked to. - **Hygiene**: Use `ResourceManager` to evict unneeded files/skills immediately after use. - - **Outputs**: Tool calls trigger turns. Never include tool syntax in final user summaries. + - **Outputs**: Tool calls trigger turns. Yield when finished with the final user summary. - **Sandbox**: Perform all verification and temp logic in `.cecli/temp`. - - **Responses**: Reason out loud through the problem but be brief. + - **Responses**: Be brief in your reasoning. Use bulleted lists of known facts and be terse in your deliberation on how to accomplish the goal. - **Edits:** Include the **entire function or logical block** in edits. Never return partial syntax or broken closures. Do not attempt to replace just the beginning or end of a closure. - - **Indentation**: Preserve all necessary whitespace (spaces, tabs, and newlines) as well as stylistic indentation and line spacings. - - **Finishing Up**: Be detailed in your `Yield` tool summary in describing your task, findings, efforts and results. + - **Finishing Up**: Avoid verifying the same detail multiple times. Be detailed in your `Yield` tool summary in describing your task, findings, efforts and results. Always reply in {language}. diff --git a/cecli/prompts/subagent.yml b/cecli/prompts/subagent.yml index 4d390ba5a5e..b8b37358270 100644 --- a/cecli/prompts/subagent.yml +++ b/cecli/prompts/subagent.yml @@ -14,9 +14,9 @@ main_system: | File contents are presented with virtual prefix identifiers to help you target edits accurately. These are generated on-the-fly when reading the file. - **Unique Lines (`——`):** Lines that appear only once in the file are prefixed with `——`. To target these lines for edits, you can simply reference the exact literal text of the line, excluding the prefix. - - **Duplicate Lines (e.g., `—“0车加—`):** Lines that appear multiple times are prefixed with an identifier containing an occurrence index and a content hash. You MUST include this exact prefix when targeting these lines to disambiguate which specific instance you want to edit. + - **Duplicate Lines (e.g., `—“0车加—`):** Lines that appear multiple times are prefixed with an opaque identifier. You MUST include this exact identifier when targeting these lines to disambiguate which specific instance you want to edit. - Do not attempt to generate, guess, or calculate these duplicate IDs yourself. Always use the exact line contents and prefixes provided from the most recent file read. + Do not attempt to generate, guess, or calculate these identifiers yourself. Always use the exact line contents and prefixes provided from the most recent file read. **Example File** ``` @@ -51,12 +51,11 @@ main_system: | ## Operational Rules - **Scope**: No unrequested refactors. Avoid full-file rewrites. Only modify what you are asked to. - **Hygiene**: Use `ResourceManager` to evict unneeded files/skills immediately after use. - - **Outputs**: Tool calls trigger turns. Never include tool syntax in final user summaries. + - **Outputs**: Tool calls trigger turns. Yield when finished with the final user summary. - **Sandbox**: Perform all verification and temp logic in `.cecli/temp`. - - **Responses**: Reason out loud through the problem but be brief. + - **Responses**: Be brief in your reasoning. Use bulleted lists of known facts and be terse in your deliberation on how to accomplish the goal. - **Edits:** Include the **entire function or logical block** in edits. Never return partial syntax or broken closures. Do not attempt to replace just the beginning or end of a closure. - - **Indentation**: Preserve all necessary whitespace (spaces, tabs, and newlines) as well as stylistic indentation and line spacings. - - **Finishing Up**: Be detailed in your `Yield` tool summary in describing your task, findings, efforts and results. + - **Finishing Up**: Avoid verifying the same detail multiple times. Be detailed in your `Yield` tool summary in describing your task, findings, efforts and results. Always reply in {language}. diff --git a/cecli/sessions.py b/cecli/sessions.py index cea4f718f88..a8e178ec04e 100644 --- a/cecli/sessions.py +++ b/cecli/sessions.py @@ -272,6 +272,9 @@ def _build_session_data(self, session_name) -> Dict: "tools_excludelist": self.coder.agent_config.get("tools_excludelist", []), } + # Flush any queued messages so the saved chat history is complete + ConversationService.get_manager(self.coder).flush_queue() + return { "version": 1, "session_name": session_name, diff --git a/cecli/tools/_yield.py b/cecli/tools/_yield.py index c17b8689f3a..c3577e15acf 100644 --- a/cecli/tools/_yield.py +++ b/cecli/tools/_yield.py @@ -182,7 +182,12 @@ async def execute(cls, coder, **kwargs): summary = kwargs.get("summary", None) # Fire memorizer with yield summary (skip if already a memorizer) - if not waited_for_sub_agents and getattr(coder, "auto_memory", False) and summary: + if ( + not waited_for_sub_agents + and getattr(coder, "auto_memory", False) + and summary + and coder.turn_count >= 5 + ): agent_service = AgentService.get_instance(coder) if agent_service.get_agent_name(coder) != "memorizer": from cecli.helpers.memory.utils import invoke_memorizer diff --git a/cecli/tools/command.py b/cecli/tools/command.py index f1e104cccce..6a9b762e2fc 100644 --- a/cecli/tools/command.py +++ b/cecli/tools/command.py @@ -305,7 +305,6 @@ async def _execute_with_timeout(cls, coder, command_string, timeout, use_pty=Non """ import asyncio import subprocess - import time from cecli.helpers.background_commands import CircularBuffer @@ -381,24 +380,56 @@ async def _execute_with_timeout(cls, coder, command_string, timeout, use_pty=Non master_fd=master_fd, ) - # Now monitor the process with timeout - start_time = time.time() + # Now monitor the process with an event-driven race instead of + # polling: wait for process completion, user interrupt, or timeout. + # Popen.wait() is cross-platform (waitpid on POSIX, WaitForSingleObject + # on Windows) and runs in a worker thread via asyncio.to_thread, so it + # blocks without consuming CPU. + interrupt_task = asyncio.create_task(coder.interrupt_event.wait()) + wait_task = asyncio.create_task(asyncio.to_thread(process.wait)) + timeout_task = asyncio.create_task(asyncio.sleep(timeout)) + + try: + done, _ = await asyncio.wait( + {interrupt_task, wait_task, timeout_task}, + return_when=asyncio.FIRST_COMPLETED, + ) + + if interrupt_task in done: + # User interrupted: terminate the process (Windows uses + # TerminateProcess — a hard kill; POSIX sends SIGTERM). Same + # semantics as the previous polling loop. + try: + process.terminate() + except ProcessLookupError: + # Process already exited + pass - while True: - if coder.interrupt_event.is_set(): - process.terminate() try: - process.wait(timeout=1) - except subprocess.TimeoutExpired: - process.kill() + # wait_task is already reaping the process; wait briefly + # for it to complete instead of starting a second wait. + await asyncio.wait_for(asyncio.shield(wait_task), timeout=1) + except asyncio.TimeoutError: + try: + process.kill() + except ProcessLookupError: + # Process already exited and was reaped by wait_task + pass + + try: + await wait_task + except Exception: + pass + except Exception: + pass + BackgroundCommandManager.stop_background_command(command_key) response.append_result("Command execution interrupted by user.") return response - # Check if process has completed - exit_code = process.poll() - if exit_code is not None: + if wait_task in done: # Process completed + exit_code = wait_task.result() output = buffer.get_all(clear=True) # Format output @@ -450,27 +481,30 @@ async def _execute_with_timeout(cls, coder, command_string, timeout, use_pty=Non ) return response - # Check if timeout has expired - elapsed = time.time() - start_time - if elapsed >= timeout: - # Timeout elapsed, process continues in background - coder.io.tool_output( - f"\u23f1\ufe0f Command exceeded {timeout}s timeout, continuing in background...", - type="tool-result", - ) - - # Get any output captured so far - current_output = buffer.get_all(clear=False) + # Timeout elapsed, process continues in background + coder.io.tool_output( + f"\u23f1\ufe0f Command exceeded {timeout}s timeout, continuing in background...", + type="tool-result", + ) - response.append_result( - f"Command exceeded {timeout}s timeout and is continuing in background.\n" - f"Command key: {command_key}\n" - f"Output captured so far:\n{current_output}\n" - ) - return response + # Get any output captured so far + current_output = buffer.get_all(clear=False) - # Wait a bit before checking again - await asyncio.sleep(1) + response.append_result( + f"Command exceeded {timeout}s timeout and is continuing in background.\n" + f"Command key: {command_key}\n" + f"Output captured so far:\n{current_output}\n" + ) + return response + finally: + interrupt_task.cancel() + timeout_task.cancel() + + if wait_task.done() and not wait_task.cancelled(): + # Retrieve any exception to avoid "task exception was never + # retrieved" warnings. On timeout the process continues in the + # background, so wait_task may legitimately still be pending. + wait_task.exception() @classmethod async def _execute_foreground(cls, coder, command_string): diff --git a/cecli/tools/edit_file.py b/cecli/tools/edit_file.py index 5657a46313c..aa7e6dfd4a4 100644 --- a/cecli/tools/edit_file.py +++ b/cecli/tools/edit_file.py @@ -47,16 +47,20 @@ class Tool(BaseTool): "function": { "name": "EditFile", "description": ( - "Edit text in one or more files using virtual identifiers. " - "You can perform multiple 'replace' or 'delete' operations in a single call. " - "CRITICAL RULES: " - "1. Start and end markers are INCLUSIVE. Both will be modified or deleted. " - f"2. To target unique lines (prefixed with '{UNIQUE_HASH_DELIMITER}'), use their exact literal text as the marker, excluding the prefix. " # noqa - f"3. To target duplicate lines, you MUST include the exact hashed prefix (e.g., '{HASH_DELIMITER}“0车加{HASH_DELIMITER}'). " # noqa - "4. Edits within the same file MUST NOT be adjacent or overlapping. " - "5. For empty files, you MUST use '@000' as the reference. " - "6. Identifiers track global occurrences. Adding, modifying, or deleting a line can instantly " - "change the prefixes of identical lines anywhere else in the file. Re-read to get fresh IDs after editing." # noqa + "Modify text in one or more files by targeting lines with their virtual identifiers " + "(as returned by ReadFile). You can batch multiple operations across files in one call." + "" + "Operations:" + " - 'replace' — swap the targeted range with new text" + " - 'delete' — remove the targeted range" + "" + "Start and end markers are inclusive: both referenced lines are modified or removed. " + f"Reference unique lines (prefixed with '{UNIQUE_HASH_DELIMITER}') by their exact text, and " + f"duplicate lines by their hashed prefix (e.g., '{HASH_DELIMITER}WecX{HASH_DELIMITER}'); use " + "'@000' for empty files. Identifiers track content, so edits can re-prefix identical lines " + "elsewhere — re-read the file after editing for fresh identifiers. Multiple edits to one " + "file are applied bottom-to-top; overlapping or contained ranges are merged or rejected " + "automatically." ), "parameters": { "type": "object", @@ -73,45 +77,41 @@ class Tool(BaseTool): "file_path": { "type": "string", "description": ( - "The absolute or relative path to the file being edited." + "The file to edit, absolute or relative to the project root." ), }, "operation": { "type": "string", "enum": ["replace", "delete"], "description": ( - "Choose 'replace' to swap the ID range with new text, " - "or 'delete' to remove the ID range entirely." + "The kind of edit: 'replace' swaps the targeted range with new text, " + "'delete' removes it entirely." ), }, "text": { "type": "string", "description": ( - "The exact replacement text. If operation is 'delete', " - 'this MUST be an empty string (""). ' - "NEVER include content IDs in this text." + "The replacement text for 'replace'. " + "For 'delete' leave this empty (\"\"). " + "Supplied as-is; do not include identifier prefixes." ), }, "start_line": { "type": "string", "description": ( - "The exact reference for the start of the edit. " - "For duplicate lines with a specific hash, " - "use the 4-character hash wrapped in tildes (e.g., '—WecX—'). " - "For unique lines marked with the generic '——' prefix, " - "provide the exact full text of the line. " - "For empty files, use '@000'." + "The first line of the edit: " + "its exact text if unique, its hashed prefix " + f"(e.g., '{HASH_DELIMITER}WecX{HASH_DELIMITER}') if duplicated, " + "or '@000' for empty files." ), }, "end_line": { "type": "string", "description": ( - "The exact reference for the end of the edit. " - "For duplicate lines with a specific hash, " - "use the 4-character hash wrapped in tildes (e.g., '—WecX—'). " - "For unique lines marked with the generic '——' prefix, " - "provide the exact full text of the line. " - "For empty files, use '@000'." + "The last line of the edit (inclusive): " + "its exact text if unique, its hashed " + f"prefix (e.g., '{HASH_DELIMITER}WecX{HASH_DELIMITER}') if duplicated, " + "or '000@' for the end of the file." ), }, }, @@ -126,7 +126,9 @@ class Tool(BaseTool): }, "change_id": { "type": "string", - "description": "Optional tracking ID for this batch of edits.", + "description": ( + "Optional tracking ID for this batch of edits; returned in the result metadata." + ), }, }, "required": ["edits"], @@ -151,7 +153,7 @@ def execute( from cecli.helpers.conversation import ConversationService, MessageTag if not coder.edit_allowed: - ConversationService.get_manager(coder).add_message( + ConversationService.get_manager(coder).queue_message( message_dict=dict( role="user", content=( @@ -161,10 +163,6 @@ def execute( ), tag=MessageTag.CUR, hash_key=("edit_file", "reminder"), - promotion=ConversationService.get_manager(coder).DEFAULT_TAG_PROMOTION_VALUE, - mark_for_delete=0, - mark_for_demotion=1, - force=True, ) # tool_name = "EditFile" diff --git a/cecli/tools/orchestrate.py b/cecli/tools/orchestrate.py index 363be883859..b224ba1a292 100644 --- a/cecli/tools/orchestrate.py +++ b/cecli/tools/orchestrate.py @@ -19,13 +19,10 @@ class Tool(BaseTool): "function": { "name": "Orchestrate", "description": ( - "Execute Python code in a sandboxed environment where you can call " - "other tools programmatically. Use this instead of making many " - "individual tool calls for batch operations. The environment provides " - "`Agent.get_tool(name)` to get tool proxies, `gather(*tasks)` for " - "parallel execution, and `state` for persistent storage across calls. " - "Use the `values` argument instead of writing string variables inline " - "to prevent string escaping issues." + "Run Python in a sandbox where you can call other tools programmatically. " + "Use for batch or loop-heavy workflows. Provides `Agent` tool proxies, " + "`gather()` for parallelism, and persistent `state`; use `values` to " + "inject variables without escaping issues." ), "parameters": { "type": "object", diff --git a/cecli/tools/read_file.py b/cecli/tools/read_file.py index 4c3a91371cb..ae24a035fd6 100644 --- a/cecli/tools/read_file.py +++ b/cecli/tools/read_file.py @@ -38,24 +38,23 @@ class Tool(BaseTool): "function": { "name": "ReadFile", "description": ( - "Get prefixed content between start and end markers. Accepts an array of `read` objects " - "(file_path, range_start, range_end). Range markers can be text patterns (up to 3 lines), " - "file boundaries (@000, 000@), or exact line numbers (@L10). " - "Contextual end markers (@C{num}, @P{num}, @N{num}) expand symmetrically, previously, or next " - "around a single unique range_start match." - " Use line hints (e.g., 'my_func @L150', '@A{{def foo}}', '@B{{return x}}') to disambiguate. " - "@A{{regex}} keeps only the closest match **after** the regex hit; " - "@B{{regex}} keeps only the closest match **before** the regex hit. " + "Read lines from one or more files. Each returned line carries a virtual identifier " + "you can pass straight to EditFile. Batch reads by passing an array of " + "{file_path, range_start, range_end} objects." "" - "File lines are prefixed with virtual, deterministic identifiers generated on-the-fly: " - "Because identifiers track global occurrences, " - "adding or deleting a line can instantly change the prefix " - "of identical lines anywhere else in the file as well as content after the edit." - "Always re-read the file to get fresh IDs after making edits." + "Markers for range_start / range_end:" + " - exact text patterns (preferred usage) (up to 5 lines; anchor on meaningful names like function signatures)" # noqa + " - '@000' / '000@' for the first / last line" + " - hint suffixes to disambiguate repeated patterns: ' @L' (nearest match), " + " '@A{{regex}}' (closest match after the regex hit), '@B{{regex}}' (closest match before)" + " - when range_start matches one location, range_end accepts '@C{num}' (context both sides), " + " '@P{num}' (lines before the match), '@N{num}' (lines after the match)" "" - "Avoid generic keywords; use meaningful identifiers like function names. Do not use empty strings. " - "Always use ReadFile instead of CLI tools. Ranges >200 lines return a structural preview. " - "Call sequentially with increasingly fine-grained searches to drill down into large files." + "Identifiers are deterministic per line content, so adding or removing lines can re-prefix " + "identical lines elsewhere in the file; re-read after editing to get fresh identifiers." + "" + "Large structured ranges (line-number or boundary reads) return a structural outline " + "instead of full contents; read in smaller targeted ranges for full detail." ), "parameters": { "type": "object", @@ -67,28 +66,26 @@ class Tool(BaseTool): "properties": { "file_path": { "type": "string", - "description": "File path to search in.", + "description": ( + "The file to read, absolute or relative to the project root." + ), }, "range_start": { "type": "string", "description": ( - "The text marking the beginning of the range." - " Use '@000' for the first line on empty files." - " Append ' @L' (e.g., 'my_func @L1506') as a" - " proximity hint to help select among multiple matches." + "The start of the range: an exact text pattern (up to 5 lines), " + "'@000' for the first line. " + "Append ' @L' (e.g., 'my_func @L1506') to pick among multiple matches, " + "or '@A{{regex}}' / '@B{{regex}}' for closest match after/before the regex hit." ), }, "range_end": { "type": "string", "description": ( - "The text marking the end of the range." - " Use '000@' for the last line on empty files." - " When range_start uniquely matches one location, you" - " may use contextual markers: '@C{number}' (e.g., '@C5')" - " for lines on both sides of the match, '@P{number}'" - " for lines BEFORE the match (the match is the range" - " end), or '@N{number}' for lines AFTER the match" - " (the match is the range start)." + "The end of the range: an exact text pattern (up to 5 lines), '000@' for " + "the last line. When range_start " + "matches one location, use '@C{num}' for context on both sides, " + "'@P{num}' for lines before the match, or '@N{num}' for lines after the match." ), }, }, @@ -263,6 +260,7 @@ def execute(cls, coder, read, **kwargs): start_line_idx = -1 end_line_idx = -1 both_structured = False + both_special = False if range_start is not None and range_end is not None: # Step 1: Classify the search type @@ -340,6 +338,7 @@ def execute(cls, coder, read, **kwargs): error_outputs.append(err) continue + both_special = rt["start_is_special"] and rt["end_is_special"] both_structured = rt["both_structured"] mixed_special_search = rt["mixed_special"] @@ -377,7 +376,7 @@ def execute(cls, coder, read, **kwargs): coder, abs_path, start_idx=s_idx, end_idx=e_idx, line_numbers=True ) - if abs_path not in coder.abs_fnames: + if abs_path not in coder.abs_fnames and both_special: # Track special marker usage for auto-editable detection if token_count <= coder.large_file_token_threshold: cls._special_marker_count[abs_path] = ( diff --git a/cecli/tui/__init__.py b/cecli/tui/__init__.py index 7b1fc275188..23daaaac634 100644 --- a/cecli/tui/__init__.py +++ b/cecli/tui/__init__.py @@ -74,6 +74,9 @@ async def launch_tui(coder, output_queue, input_queue, args): Returns: Exit code from TUI """ + # Pin tqdm's class lock before the TUI captures stdout/stderr (see _pin_tqdm_lock). + _pin_tqdm_lock() + worker = None return_code = 0 try: @@ -100,3 +103,22 @@ async def launch_tui(coder, output_queue, input_queue, args): ) return return_code + + +def _pin_tqdm_lock(): + """Pin tqdm's class lock to a plain threading.RLock before the TUI starts. + + The Textual TUI redirects stdout/stderr to capture streams whose fileno() + returns -1. tqdm's first use builds a multiprocessing.RLock whose resource + tracker subprocess then fails with "ValueError: bad value(s) in fds_to_keep". + Scoped to the TUI launch path so non-TUI runs keep tqdm's default lock. + This makes the /help command work as intended. + """ + try: + import threading + + import tqdm.std + + tqdm.std.tqdm.set_lock(threading.RLock()) + except Exception: + pass diff --git a/cecli/tui/app.py b/cecli/tui/app.py index 9182abe0a5c..6a2bba332b5 100644 --- a/cecli/tui/app.py +++ b/cecli/tui/app.py @@ -9,6 +9,7 @@ from pathlib import Path import textual.strip +import xxhash from rich.color import ColorSystem from rich.style import Style from textual import events @@ -922,16 +923,16 @@ def on_input_area_submit(self, message: InputArea.Submit): # Default (primary coder, actively generating sub-agent, # or sub-agent not found in tracking): append to conversation - ConversationService.get_manager(foreground_coder).add_message( + ConversationService.get_manager(foreground_coder).queue_message( message_dict=dict( role="user", content=foreground_coder.wrap_user_input(user_input) ), tag=MessageTag.CUR, - hash_key=("user_message", user_input, str(time.monotonic_ns())), - promotion=ConversationService.get_manager( - foreground_coder - ).DEFAULT_TAG_PROMOTION_VALUE, - mark_for_demotion=1, + hash_key=( + "user_message", + xxhash.xxh3_128_hexdigest(user_input.encode("utf-8", errors="replace")), + str(time.monotonic_ns()), + ), ) else: self.update_key_hints(generating=True) @@ -942,11 +943,10 @@ def on_input_area_submit(self, message: InputArea.Submit): ) # Route to per-coder queue when available if coder_uuid and coder_uuid in queues._per_coder_queues: - queues._per_coder_queues[coder_uuid].put( - {"text": user_input, "coder_uuid": coder_uuid} - ) + queues.push_coder_input(coder_uuid, {"text": user_input, "coder_uuid": coder_uuid}) else: self.input_queue.put({"text": user_input, "coder_uuid": coder_uuid}) + queues.wake_input_waiters() def set_input_value(self, text) -> None: """Find the input widget and set focus to it.""" @@ -1365,11 +1365,12 @@ def on_status_bar_confirm_response(self, message: StatusBar.ConfirmResponse): coder_uuid = self._confirmation_coder_uuid # Route to per-coder queue when available if coder_uuid and coder_uuid in queues._per_coder_queues: - queues._per_coder_queues[coder_uuid].put( - {"confirmed": message.result, "coder_uuid": coder_uuid} + queues.push_coder_input( + coder_uuid, {"confirmed": message.result, "coder_uuid": coder_uuid} ) else: self.input_queue.put({"confirmed": message.result, "coder_uuid": coder_uuid}) + queues.wake_input_waiters() # Release the confirmation lock and process any pending confirmations self._confirmation_lock = False self._process_pending_confirmation() diff --git a/cecli/tui/io.py b/cecli/tui/io.py index b12933c8ed1..1848d39f76a 100644 --- a/cecli/tui/io.py +++ b/cecli/tui/io.py @@ -482,8 +482,9 @@ async def get_input( } ) - # Wait for input from TUI (blocking in async context) - # We need to poll the queue since it's not async + # Wait for input from TUI. The per-coder and shared queues are + # thread-safe payloads; wait_for_input() blocks natively until a push + # wakes us, so no polling is required. while True: if hasattr(self, "file_watcher") and self.file_watcher: if not self.file_watcher.is_running: @@ -494,36 +495,38 @@ async def get_input( cmd = self.file_watcher.process_changes() return cmd - try: - # Non-blocking get with timeout - import queue - - # Check all per-coder queues first (non-blocking) - for _uuid, _q in list(queues._per_coder_queues.items()): - try: - result = _q.get_nowait() - if "text" in result: - user_input = result["text"] - target_uuid = result.get("coder_uuid", _uuid) - self.user_input(user_input) - return user_input, target_uuid - except queue.Empty: - continue + import queue - # Fall back to shared queue (blocking with timeout) - result = self.input_queue.get(timeout=0.1) + # Check all per-coder queues first (non-blocking) + for _uuid, _q in list(queues._per_coder_queues.items()): + try: + result = _q.get_nowait() + except queue.Empty: + continue if "text" in result: user_input = result["text"] - target_uuid = result.get("coder_uuid") - - # Log the input (same as parent) + target_uuid = result.get("coder_uuid", _uuid) self.user_input(user_input) - return user_input, target_uuid + + # Fall back to shared queue (non-blocking) + try: + result = self.input_queue.get_nowait() except queue.Empty: - # No input yet, yield control - await asyncio.sleep(0.1) + result = None + + if result is not None and "text" in result: + user_input = result["text"] + target_uuid = result.get("coder_uuid") + + # Log the input (same as parent) + self.user_input(user_input) + + return user_input, target_uuid + + # Nothing available yet — block until the next push + await queues.wait_for_input() async def confirm_ask( self, @@ -617,42 +620,42 @@ async def confirm_ask( } ) - # Wait for response from TUI + # Wait for response from TUI. Sweep the per-coder queues + # (non-blocking), then block natively until the next push. while True: - try: - import queue - - # Check all per-coder queues first (non-blocking) - for _uuid, _q in list(queues._per_coder_queues.items()): - try: - result = _q.get_nowait() - if "confirmed" in result: - response = result["confirmed"] - - # Handle special responses - if response == "never": - self.never_prompts.add(question_id) - return False - elif response == "tweak": - return "tweak" - elif response == "all": - if group: - group.preference = "all" - if group_response: - self.group_responses[group_response] = True - return True - elif response == "skip": - if group: - group.preference = "skip" - if group_response: - self.group_responses[group_response] = False - return False - else: - return bool(response) - except queue.Empty: - continue - except queue.Empty: - await asyncio.sleep(0.1) + import queue + + for _uuid, _q in list(queues._per_coder_queues.items()): + try: + result = _q.get_nowait() + except queue.Empty: + continue + + if "confirmed" in result: + response = result["confirmed"] + + # Handle special responses + if response == "never": + self.never_prompts.add(question_id) + return False + elif response == "tweak": + return "tweak" + elif response == "all": + if group: + group.preference = "all" + if group_response: + self.group_responses[group_response] = True + return True + elif response == "skip": + if group: + group.preference = "skip" + if group_response: + self.group_responses[group_response] = False + return False + else: + return bool(response) + + await queues.wait_for_input() except asyncio.CancelledError: return False diff --git a/cecli/utils.py b/cecli/utils.py index 20bc2106e15..b1bcc0a6aca 100644 --- a/cecli/utils.py +++ b/cecli/utils.py @@ -320,7 +320,7 @@ def run_install(cmd): text=True, bufsize=1, universal_newlines=True, - encoding=sys.stdout.encoding, + encoding=getattr(sys.stdout, "encoding", None) or "utf-8", errors="replace", ) spinner = Spinner("Installing...") diff --git a/cecli/website/Gemfile b/cecli/website/Gemfile deleted file mode 100644 index bfa6297cfc4..00000000000 --- a/cecli/website/Gemfile +++ /dev/null @@ -1,8 +0,0 @@ -source 'https://rubygems.org' -gem 'jekyll' -gem "just-the-docs", "0.8.2" -gem 'jekyll-redirect-from' -gem 'jekyll-sitemap' -gem "webrick" -gem 'github-pages', group: :jekyll_plugins -gem "html-proofer" diff --git a/cecli/website/_config.yml b/cecli/website/_config.yml deleted file mode 100644 index 5b664e866ae..00000000000 --- a/cecli/website/_config.yml +++ /dev/null @@ -1,66 +0,0 @@ -theme: just-the-docs -url: "https://cecli.dev" - -plugins: - - jekyll-redirect-from - - jekyll-sitemap - - jekyll-feed - -defaults: - - scope: - path: "README.md" - type: "pages" - values: - description: "Oh, to live in a terminal" - -exclude: - - "tmp*" - - "**/tmp*" - - OLD - - "**/OLD/**" - - "OLD/**" - - vendor - - feed.xml - -aux_links: - "GitHub": - - "https://github.com/cecli-dev/cecli" - "Discord": - - "https://discord.gg/AX9ZEA7nJn" - "Support": - - "https://ko-fi.com/cecli" - -nav_external_links: - - title: "GitHub" - url: "https://github.com/cecli-dev/cecli" - - title: "Discord" - url: "https://discord.gg/AX9ZEA7nJn" - - title: "Support" - url: "https://ko-fi.com/cecli" - -repository: dwash96/cecli - -callouts: - tip: - title: Tip - color: green - note: - title: Note - color: yellow - -# Custom CSS for our table of contents -kramdown: - syntax_highlighter_opts: - css_class: highlight - -sass: - sass_dir: _sass - style: compressed - -# Additional CSS -compress_html: - clippings: all - comments: all - endings: all - startings: [] - diff --git a/cecli/website/_includes/install.md b/cecli/website/_includes/install.md index ada8bb91a13..8cc23a3374c 100644 --- a/cecli/website/_includes/install.md +++ b/cecli/website/_includes/install.md @@ -1,4 +1,4 @@ ```bash -python -m pip install cecli-dev +uv tool install cecli-dev ``` diff --git a/cecli/website/_includes/model-warnings.md b/cecli/website/_includes/model-warnings.md index 2510d72acfe..e8f07bc5c89 100644 --- a/cecli/website/_includes/model-warnings.md +++ b/cecli/website/_includes/model-warnings.md @@ -9,7 +9,7 @@ If you specify a model that cecli has never heard of, you will get this warning. This means cecli doesn't know the context window size and token costs for that model. -cecli will use an unlimited context window and assume the model is free, +Cecli will use an unlimited context window and assume the model is free, so this is not usually a significant problem. See the docs on @@ -56,7 +56,7 @@ command prompt for the changes to take effect. Model gpt-5: Unknown which environment variables are required. ``` -cecli is unable verify the environment because it doesn't know +Cecli is unable verify the environment because it doesn't know which variables are required for the model. If required variables are missing, you may get errors when you attempt to chat with the model. diff --git a/cecli/website/_includes/works-best.md b/cecli/website/_includes/works-best.md index 0d54f78495b..0b14378120a 100644 --- a/cecli/website/_includes/works-best.md +++ b/cecli/website/_includes/works-best.md @@ -1 +1 @@ -cecli can [connect to almost any LLM, including local models](https://cecli.chat/docs/llms.html). +Cecli can [connect to almost any LLM, including local models](https://cecli.chat/docs/llms.html). diff --git a/cecli/website/assets/landing.css.map b/cecli/website/assets/landing.css.map new file mode 100644 index 00000000000..39df911a86a --- /dev/null +++ b/cecli/website/assets/landing.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":"","sources":["../_sass/_variables.scss","../_sass/_reset.scss","../_sass/_typography.scss","../_sass/_layout.scss","../_sass/_hero.scss","../_sass/_features.scss","../_sass/_testimonials.scss","../_sass/_info.scss","../_sass/_footer.scss","../_sass/global-overrides.scss"],"names":[],"mappings":"CAGA,WACI,0BACA,iHAIJ,MAEI,mBACA,wBACA,qBACA,gBACA,iBACA,gBACA,mBACA,0BAGA,2BACA,wBACA,4BACA,0BAGA,mBACA,oBACA,kBACA,oBACA,mBACA,kBACA,qBACA,oBACA,iBAGA,mBACA,kBACA,mBACA,gBACA,kBACA,gBACA,iBACA,iBAKJ,yBACI,MACI,4BACA,yBACA,4BACA,2BAKR,yBACI,MAEI,mBACA,oBACA,oBAKR,yBACI,MACI,2BACA,wBACA,4BACA,2BCxER,EACI,SACA,UACA,sBAIJ,KACI,uBAIJ,kBACI,wBACA,gBAGJ,GACI,0BACA,gBACA,gBAGJ,GACI,0BACA,gBAGJ,GACI,yBACA,gBC9BJ,KACI,uIACA,eACA,oCACA,kBACA,8BACA,kCACA,mCACA,kCAIJ,qBACI,2FACA,wCACA,wBACA,gBAGJ,YACI,gCACA,kBACA,eACA,WACA,iBACA,gBACA,gBACA,gBACA,qCACA,WAKJ,yBACI,KACI,eAGJ,YACI,iBAKR,yBACI,KACI,iBAKR,yBACI,KACI,eAGJ,YACI,gBACA,cC3DR,WACI,WACA,iBACA,cACA,eAIJ,OACI,yBACA,qCACA,gBACA,MACA,YAIJ,IACI,aACA,8BACA,mBACA,eAGJ,MACI,iBACA,gBACA,sCACA,4BACA,qBACA,oBAGJ,WACI,aACA,SAGJ,aACI,kBACA,qBACA,gBACA,qBACA,yBACA,qBACA,yBAGJ,mBACI,qBAIJ,KACI,qBACA,kBACA,kBACA,gBACA,qBACA,mBAGJ,aACI,gCACA,WAGJ,mBACI,qCACA,2BAGJ,eACI,yBACA,qBACA,gCAGJ,qBACI,yBACA,2BAIJ,eACI,kBACA,cAGJ,UACI,iBACA,gBACA,mBAGJ,aACI,aACA,SACA,uBAIJ,iBACI,gBACA,aACA,uBACA,mBACA,SACA,eACA,iBACA,iBACA,kBAIJ,cACI,oBACA,YACA,kBACA,gBACA,yBACA,gBACA,cACA,qBACA,yBACA,qCACA,gEACA,qBACA,yBAGJ,oBACI,2BACA,oCAGJ,aACI,aACA,mBACA,eACA,sBACA,WACA,YAGJ,aACI,aACA,mBACA,eACA,gCACA,WACA,YAGJ,0BACI,yBACA,WAGJ,6BACI,yBAGJ,2BACI,yBAGJ,2BACI,yBAGJ,0BACI,yBAKJ,yBACI,IACI,eAGJ,iBACI,uBAGJ,WACI,aAGJ,KACI,kBACA,iBACA,gBACA,kBAGJ,aACI,kBACA,eAGJ,cACI,kBAKR,yBACI,IACI,cAGJ,MACI,iBAGJ,KACI,gBACA,iBAGJ,KACI,iBACA,gBAGJ,aACI,kBACA,iBAGJ,MACI,kBC1OR,MACI,eACA,kBACA,gBAGJ,cACI,WACA,kBACA,MACA,OACA,QACA,SACA,oYACA,WACA,UAGJ,aACI,WACA,kBACA,SACA,UACA,WACA,YACA,uHACA,WACA,UACA,wBACA,oBAGJ,iBACI,kBACA,UAGJ,WACI,aACA,8BACA,SACA,mBAGJ,cACI,gBACA,cACA,eAGJ,YACI,aACA,uBACA,mBACA,kBAGJ,SACI,iBACA,qCACA,kBACA,gBACA,uCACA,gBACA,uBAGJ,QACI,kBACA,cACA,oCACA,cACA,oCACA,gBAGJ,SACI,aACA,SACA,2BACA,gBACA,gBAGJ,aACI,kBACA,iBAGJ,iBACI,gBACA,WACA,cACA,uCACA,kBACA,gBACA,kBACA,SAEA,8BACA,mCAGJ,uBACI,kBACA,MACA,OACA,WACA,YACA,cAKJ,yBACI,MACI,eAGJ,WACI,0BAGJ,cACI,kBACA,QACA,eACA,eACA,iBACA,kBAGJ,YACI,QACA,SAGJ,iBACI,gBAGJ,SACI,iBACA,kBACA,qCACA,WAGJ,QACI,kBACA,iBACA,kBACA,eACA,kBACA,uCAGJ,SACI,mBACA,eACA,mBACA,uBACA,SACA,iBACA,kBACA,YAKR,yBACI,MACI,eAGJ,iBACI,gBAGJ,SACI,QAGJ,SACI,kBCxLR,UACI,eAGJ,eACI,kBACA,qCACA,iBACA,kBACA,gBACA,uCACA,sBAGJ,cACI,aACA,2DACA,SAGJ,cACI,yBACA,kBACA,aACA,qCACA,6DACA,qCACA,cACA,cACA,qBACA,eAGJ,oBACI,2BACA,qCACA,yBAGJ,gBACI,2BACA,gBACA,cAGJ,qBACI,aACA,mBACA,mBACA,mBAGJ,cACI,eACA,WACA,YACA,aACA,mBACA,uBACA,mBACA,+BACA,uBACA,kBACA,cACA,wCACA,qBAGJ,kCACI,sBACA,+BACA,uBAGJ,kCACI,sBACA,+BACA,uBAGJ,eACI,yBACA,kBACA,SACA,kBACA,8BACA,gBACA,uBACA,gBAGJ,sBACI,WACA,kBACA,SACA,OACA,WACA,WACA,gCAKJ,yBACI,eACI,iBAGJ,eACI,iBAGJ,cACI,aAGJ,qBACI,kBACA,mBAGJ,gBACI,gBAGJ,cACI,kBAKR,yBACI,gBACI,oBAKR,yBACI,eACI,iBACA,mBAGJ,eACI,eAGJ,cACI,aAGJ,qBACI,iBACA,oBC1JR,cACI,eAGJ,kBACI,aACA,2DACA,SAGJ,kBACI,kBACA,aACA,qCACA,wCACA,4BACA,mBACA,2BACA,qCAGJ,kBACI,qBACA,kBACA,cACA,kBACA,UACA,eACA,iBACA,oCACA,kBACA,0BAGJ,mDAEI,0BACA,gBACA,eACA,kBAGJ,0BACI,aACA,qBACA,iBACA,sBAGJ,yBACI,YACA,qBACA,gBACA,sBAGJ,wBACI,sCAEJ,oBACI,gBACA,kBACA,iBAGJ,sBACI,qBACA,qBACA,qBAGJ,4BACI,0BAKJ,yBACI,kBACI,gBAGJ,oBACI,iBAKR,yBAEI,kBACI,eACA,gBACA,kBC7FR,cACI,eACA,yBAGJ,cACI,aACA,SACA,iBACA,cAGJ,aACI,OACA,yBACA,kBACA,aACA,qCACA,wCACA,qCAGJ,mBACI,2BACA,qCAGJ,mBACI,iBACA,qBACA,kBACA,kBACA,oBACA,gBACA,uBACA,uCAGJ,0BACI,WACA,kBACA,SACA,OACA,WACA,WACA,gCAGJ,kBACI,cACA,qBACA,kBACA,oCAGJ,WACI,qBACA,UACA,SAGJ,cACI,mBACA,kBACA,kBAGJ,sBACI,YACA,kBACA,OACA,qBACA,iBAGJ,aACI,qBACA,qBACA,mCACA,qBAGJ,mBACI,0BACA,0BAKJ,yBACI,cACI,sBAGJ,aACI,oBAKR,yBACI,mBACI,iBAGJ,aACI,cC1GR,OACI,yBACA,WACA,eACA,kBAGJ,cACI,mBAGJ,gBACI,WACA,qBACA,cACA,qBAGJ,sBACI,qBAGJ,WACI,kBACA,gBCdJ,0BAGI,+BAEI,wBACA,gCACA,yBACA,oBACI,gCAEJ,iBACA,SACA,UAGA,yCACI,6BACA,2BACA,wBACA,2BACA,uBACA,8BAGJ,4CACI,4BACA,oCACA,wCAGJ,6CACI,0BACA,oCAIJ,kDACI,6BACA,8BACA,0BAKA,2DACI,2BAKR,qCACI,0BACA,sBACA,yBACA,2BAMZ,0BACI,+BACI,gCAEA,yCACI,uBAGJ,kDACI,6BACA,8BACA,4BACA,4BACA,8BAUZ,+BACI,yBACA,cACA,gBAEA,yCACI,2BACA,gBACA,gBAEA,4DACI,2BACA,+BACA,iBACA,cAGJ,4DACI,2BAGJ,kDACI,6BAIR,yCACI,oCAEA,+JACI,sBAMZ,oBACI,WACA,YAGJ,0BACI,mBACA,kBAGJ,0BACI,gBACA,kBACA,yBAGJ,gCACI,gBAGJ,2BACI,mBAIJ,EACI,qBACA,6BAIJ,gBACI,sBACA,qCAGJ,sBACI,yBACA,gCAIJ,oCACI,wBAGJ,MACI,yBAGJ,mBACI,yBACA,yBACA,eAQJ,gDACI,+BAGI,wBACA,8BAGJ,UAEI,0BACA,kBACA,iBACA,uBACA,wBACA,2BACA,uBAGJ,MAEI,6BACA,oCAGJ,mBACI,0BACA,6BACA,+BAKR,yBACI,KACI,yBAGJ,UACI,6BACA,sBACA,uBAGJ,MACI,yBACA,uBAKR,aAEI,KACI,yBAGJ,UACI","file":"landing.css"} \ No newline at end of file diff --git a/cecli/website/docmd.config.json b/cecli/website/docmd.config.json new file mode 100644 index 00000000000..5466c3b8946 --- /dev/null +++ b/cecli/website/docmd.config.json @@ -0,0 +1,329 @@ +{ + "title": "cecli", + "url": "https://cecli.dev", + "src": "docs", + "out": "_site/docs", + "base": "/docs/", + "navigation": [ + { + "title": "Getting Started", + "icon": "rocket", + "children": [ + { + "title": "Overview", + "path": "/" + }, + { + "title": "Installation", + "path": "/install/" + }, + { + "title": "Configuration", + "path": "/config/" + }, + { + "title": "Usage", + "path": "/usage/" + }, + { + "title": "Troubleshooting", + "path": "/troubleshooting/" + } + ] + }, + { + "title": "Configuration", + "icon": "settings", + "path": "/config/", + "children": [ + { + "title": "Agent Mode", + "path": "/config/agent-mode/" + }, + { + "title": "Agent Memory", + "path": "/config/persistent-memory/" + }, + { + "title": "API Keys", + "path": "/config/api-keys/" + }, + { + "title": "Agent Client Protocol (ACP)", + "path": "/config/api/" + }, + { + "title": "Config - File", + "path": "/config/conf/" + }, + { + "title": "Config - Env. Vars", + "path": "/config/dotenv/" + }, + { + "title": "Config - CLI Options", + "path": "/config/options/" + }, + { + "title": "Custom Commands", + "path": "/config/custom-commands/" + }, + { + "title": "Custom System Prompts", + "path": "/config/custom-system-prompts/" + }, + { + "title": "Editor configuration", + "path": "/config/editor/" + }, + { + "title": "Hooks", + "path": "/config/hooks/" + }, + { + "title": "Model Context Protocol (MCP)", + "path": "/config/mcp/" + }, + { + "title": "Model Configuration", + "path": "/config/model-configuration/" + }, + { + "title": "Model Configuration Files", + "path": "/config/adv-model-settings/" + }, + { + "title": "Model Providers", + "path": "/config/model-providers/" + }, + { + "title": "Model Aliases", + "path": "/config/model-aliases/" + }, + { + "title": "Reasoning models", + "path": "/config/reasoning/" + }, + { + "title": "Retries", + "path": "/config/retries/" + }, + { + "title": "Security Configuration", + "path": "/config/security/" + }, + { + "title": "Skills System", + "path": "/config/skills/" + }, + { + "title": "Sub-Agents", + "path": "/config/subagents/" + }, + { + "title": "TUI", + "path": "/config/tui/" + }, + { + "title": "Workspaces", + "path": "/config/workspaces/" + } + ] + }, + { + "title": "Connecting to LLMs", + "icon": "cpu", + "path": "/llms/", + "children": [ + { + "title": "Anthropic", + "path": "/llms/anthropic/" + }, + { + "title": "Azure", + "path": "/llms/azure/" + }, + { + "title": "Amazon Bedrock", + "path": "/llms/bedrock/" + }, + { + "title": "Cohere", + "path": "/llms/cohere/" + }, + { + "title": "DeepSeek", + "path": "/llms/deepseek/" + }, + { + "title": "Gemini", + "path": "/llms/gemini/" + }, + { + "title": "GitHub Copilot", + "path": "/llms/github/" + }, + { + "title": "GROQ", + "path": "/llms/groq/" + }, + { + "title": "LM Studio", + "path": "/llms/lm-studio/" + }, + { + "title": "Ollama", + "path": "/llms/ollama/" + }, + { + "title": "OpenAI compatible APIs", + "path": "/llms/openai-compat/" + }, + { + "title": "OpenAI", + "path": "/llms/openai/" + }, + { + "title": "OpenRouter", + "path": "/llms/openrouter/" + }, + { + "title": "Vertex AI", + "path": "/llms/vertex/" + }, + { + "title": "xAI", + "path": "/llms/xai/" + }, + { + "title": "Model warnings", + "path": "/llms/warnings/" + }, + { + "title": "Other LLMs", + "path": "/llms/other/" + } + ] + }, + { + "title": "Usage Guides", + "icon": "book-open", + "path": "/usage/", + "children": [ + { + "title": "Slash Commands", + "path": "/usage/commands/" + }, + { + "title": "Session Management", + "path": "/usage/sessions/" + }, + { + "title": "Convention Files", + "path": "/usage/conventions/" + }, + { + "title": "Images & web pages", + "path": "/usage/images-urls/" + }, + { + "title": "Linting and testing", + "path": "/usage/lint-test/" + }, + { + "title": "Chat modes", + "path": "/usage/modes/" + }, + { + "title": "Notifications", + "path": "/usage/notifications/" + }, + { + "title": "Copy/Paste Mode", + "path": "/usage/copypaste/" + }, + { + "title": "Voice Mode", + "path": "/usage/voice/" + }, + { + "title": "Watch Mode", + "path": "/usage/watch/" + }, + { + "title": "Tips", + "path": "/usage/tips/" + } + ] + }, + { + "title": "Other Topics", + "icon": "layers", + "collapsible": true, + "children": [ + { + "title": "Git Integration", + "path": "/git/" + }, + { + "title": "Repository Map", + "path": "/repomap/" + }, + { + "title": "Scripting Cecli", + "path": "/scripting/" + }, + { + "title": "Supported Languages", + "path": "/languages/" + }, + { + "title": "Edit Formats", + "path": "/more/edit-formats/" + } + ] + }, + { + "title": "Leaderboards", + "icon": "trophy", + "path": "/leaderboards/", + "children": [ + { + "title": "Scores by release date", + "path": "/leaderboards/by-release-date/" + }, + { + "title": "Contributing results", + "path": "/leaderboards/contrib/" + }, + { + "title": "Code editing leaderboard", + "path": "/leaderboards/edit/" + }, + { + "title": "Benchmark notes", + "path": "/leaderboards/notes/" + }, + { + "title": "refactor", + "path": "/leaderboards/refactor/" + } + ] + } + ], + "theme": { + "name": "default", + "appearance": "light" + }, + "layout": { + "optionsMenu": { + "position": "header", + "components": { + "search": true, + "themeSwitch": true, + "sponsor": "https://ko-fi.com/cecli" + } + } + }, + "favicon": "/assets/cecli-temp-logo-favicon.svg" +} \ No newline at end of file diff --git a/cecli/website/docs/benchmarks-0125.md b/cecli/website/docs/benchmarks-0125.md index 4b4f05cc32f..3404f2b4a1c 100644 --- a/cecli/website/docs/benchmarks-0125.md +++ b/cecli/website/docs/benchmarks-0125.md @@ -4,42 +4,28 @@ excerpt: The new `gpt-4-0125-preview` model is quantiatively lazier at coding th highlight_image: /assets/benchmarks-0125.jpg nav_exclude: true --- -{% if page.date %} - -{% endif %} # The January GPT-4 Turbo is lazier than the last version [![benchmark results](/assets/benchmarks-0125.svg)](https://cecli.dev/assets/benchmarks-0125.svg) -[OpenAI just released a new version of GPT-4 Turbo](https://openai.com/blog/new-embedding-models-and-api-updates). -This new model is intended to reduce the "laziness" that has been widely observed with the previous `gpt-4-1106-preview` model: +[OpenAI just released a new version of GPT-4 Turbo](https://openai.com/blog/new-embedding-models-and-api-updates). This new model is intended to reduce the "laziness" that has been widely observed with the previous `gpt-4-1106-preview` model: > Today, we are releasing an updated GPT-4 Turbo preview model, gpt-4-0125-preview. This model completes tasks like code generation more thoroughly than the previous preview model and is intended to reduce cases of “laziness” where the model doesn’t complete a task. -With that in mind, I've been benchmarking the new model using -cecli's existing -[lazy coding benchmark](https://cecli.dev/docs/unified-diffs.html). +With that in mind, I've been benchmarking the new model using cecli's existing [lazy coding benchmark](unified-diffs.html). ## Benchmark results -Overall, -the new `gpt-4-0125-preview` model seems lazier -than the November `gpt-4-1106-preview` model: +Overall, the new `gpt-4-0125-preview` model seems lazier than the November `gpt-4-1106-preview` model: -- It gets worse benchmark scores when using the [unified diffs](https://cecli.dev/docs/unified-diffs.html) code editing format. +- It gets worse benchmark scores when using the [unified diffs](unified-diffs.html) code editing format. - Using cecli's older SEARCH/REPLACE block editing format, the new January model outperforms the older November model. But it still performs worse than both models using unified diffs. ## Related reports -This is one in a series of reports -that use the cecli benchmarking suite to assess and compare the code -editing capabilities of OpenAI's GPT models. -You can review the other reports -for additional information: - -- [GPT code editing benchmarks](https://cecli.dev/docs/benchmarks.html) evaluates the March and June versions of GPT-3.5 and GPT-4. -- [Code editing benchmarks for OpenAI's "1106" models](https://cecli.dev/docs/benchmarks-1106.html). -- [cecli's lazy coding benchmark](https://cecli.dev/docs/unified-diffs.html). - +This is one in a series of reports that use the cecli benchmarking suite to assess and compare the code editing capabilities of OpenAI's GPT models. You can review the other reports for additional information: +- [GPT code editing benchmarks](benchmarks.html) evaluates the March and June versions of GPT-3.5 and GPT-4. +- [Code editing benchmarks for OpenAI's "1106" models](benchmarks-1106.html). +- [cecli's lazy coding benchmark](unified-diffs.html). diff --git a/cecli/website/docs/benchmarks-1106.md b/cecli/website/docs/benchmarks-1106.md index a66892d1351..ddd7594e1be 100644 --- a/cecli/website/docs/benchmarks-1106.md +++ b/cecli/website/docs/benchmarks-1106.md @@ -4,9 +4,6 @@ excerpt: A quantitative comparison of the code editing capabilities of the new G highlight_image: /assets/benchmarks-1106.jpg nav_exclude: true --- -{% if page.date %} - -{% endif %} # Code editing benchmarks for OpenAI's "1106" models @@ -14,35 +11,13 @@ nav_exclude: true [![benchmark results](/assets/benchmarks-speed-1106.svg)](https://cecli.dev/assets/benchmarks-speed-1106.svg) -[OpenAI just released new versions of GPT-3.5 and GPT-4](https://openai.com/blog/new-models-and-developer-products-announced-at-devday), -and there's a lot -of interest about their ability to code compared to the previous versions. -With that in mind, I've been benchmarking the new models. - -[cecli](https://github.com/cecli-dev/cecli) -is an open source command line chat tool that lets you work with GPT to edit -code in your local git repo. -To do this, cecli needs to be able to reliably recognize when GPT wants to edit -your source code, -determine which files it wants to modify -and accurately apply the changes it's trying to make. -Doing a good job on this "code editing" task requires a good LLM, good prompting and -a good tool driving the interactions with the LLM. - -cecli relies on a -[code editing benchmark](https://cecli.dev/docs/benchmarks.html) -to quantitatively evaluate -performance -whenever one of these things changes. -For example, -whenever I change cecli's prompting or the backend which drives LLM conversations, -I run the benchmark to make sure these changes produce improvements (not regressions). - -The benchmark uses cecli to try and complete -[133 Exercism Python coding exercises](https://github.com/exercism/python). -For each exercise, Exercism provides a starting python file with stubs for the needed functions, -a natural language description of the problem to solve -and a test suite to evaluate whether the coder has correctly solved the problem. +[OpenAI just released new versions of GPT-3.5 and GPT-4](https://openai.com/blog/new-models-and-developer-products-announced-at-devday), and there's a lot of interest about their ability to code compared to the previous versions. With that in mind, I've been benchmarking the new models. + +[cecli](https://github.com/cecli-dev/cecli) is an open source command line chat tool that lets you work with GPT to edit code in your local git repo. To do this, cecli needs to be able to reliably recognize when GPT wants to edit your source code, determine which files it wants to modify and accurately apply the changes it's trying to make. Doing a good job on this "code editing" task requires a good LLM, good prompting and a good tool driving the interactions with the LLM. + +Cecli relies on a [code editing benchmark](benchmarks.html) to quantitatively evaluate performance whenever one of these things changes. For example, whenever I change cecli's prompting or the backend which drives LLM conversations, I run the benchmark to make sure these changes produce improvements (not regressions). + +The benchmark uses cecli to try and complete [133 Exercism Python coding exercises](https://github.com/exercism/python). For each exercise, Exercism provides a starting python file with stubs for the needed functions, a natural language description of the problem to solve and a test suite to evaluate whether the coder has correctly solved the problem. The benchmark gives cecli two tries to complete the task: @@ -53,8 +28,7 @@ The benchmark gives cecli two tries to complete the task: ### gpt-4-1106-preview -For now, I have only benchmarked the GPT-4 models using the `diff` edit method. -This is the edit format that cecli uses by default with gpt-4. +For now, I have only benchmarked the GPT-4 models using the `diff` edit method. This is the edit format that cecli uses by default with gpt-4. - The new `gpt-4-1106-preview` model seems **2-2.5X faster** than the June GPT-4 model. - **It seems better at producing correct code on the first try**. It gets @@ -64,8 +38,7 @@ This is the edit format that cecli uses by default with gpt-4. ### gpt-3.5-turbo-1106 -I benchmarked the GPT-3.5 models with both the `whole` and `diff` edit format. -None of the gpt-3.5 models seem able to effectively use the `diff` edit format, including the newest November (1106) model. +I benchmarked the GPT-3.5 models with both the `whole` and `diff` edit format. None of the gpt-3.5 models seem able to effectively use the `diff` edit format, including the newest November (1106) model. The comments below only focus on comparing the `whole` edit format results: @@ -73,20 +46,13 @@ The comments below only focus on comparing the `whole` edit format results: - The success rate after the first try of 42% is comparable to the previous June (0613) model. The new November and previous June models are both worse than the original March (0301) model's 50% result on the first try. - The new model's 56% success rate after the second try seems comparable to the original March model, and somewhat better than the June model's 50% score. - ## Related reports -This is one in a series of reports -that use the cecli benchmarking suite to assess and compare the code -editing capabilities of OpenAI's GPT models. -You can review the other reports -for additional information: +This is one in a series of reports that use the cecli benchmarking suite to assess and compare the code editing capabilities of OpenAI's GPT models. You can review the other reports for additional information: -- [GPT code editing benchmarks](https://cecli.dev/docs/benchmarks.html) evaluates the March and June versions of GPT-3.5 and GPT-4. +- [GPT code editing benchmarks](benchmarks.html) evaluates the March and June versions of GPT-3.5 and GPT-4. - [Code editing speed benchmarks for OpenAI's "1106" models](https://cecli.dev/2023/11/06/benchmarks-speed-1106.html) compares the performance of the new GPT models. - ## Updates -Last updated 11/14/23. -OpenAI has relaxed rate limits so these results are no longer considered preliminary. +Last updated 11/14/23. OpenAI has relaxed rate limits so these results are no longer considered preliminary. diff --git a/cecli/website/docs/benchmarks-speed-1106.md b/cecli/website/docs/benchmarks-speed-1106.md index db91a9e7959..92444320932 100644 --- a/cecli/website/docs/benchmarks-speed-1106.md +++ b/cecli/website/docs/benchmarks-speed-1106.md @@ -5,47 +5,23 @@ canonical_url: https://cecli.dev/2023/11/06/benchmarks-speed-1106.html highlight_image: /assets/benchmarks-speed-1106.jpg nav_exclude: true --- -{% if page.date %} - -{% endif %} # Speed benchmarks of GPT-4 Turbo and gpt-3.5-turbo-1106 - - [![benchmark results](/assets/benchmarks-speed-1106.svg)](https://cecli.dev/assets/benchmarks-speed-1106.svg) -[OpenAI just released new versions of GPT-3.5 and GPT-4](https://openai.com/blog/new-models-and-developer-products-announced-at-devday), -and there's a lot -of interest about their capabilities and performance. -With that in mind, I've been benchmarking the new models. +[OpenAI just released new versions of GPT-3.5 and GPT-4](https://openai.com/blog/new-models-and-developer-products-announced-at-devday), and there's a lot of interest about their capabilities and performance. With that in mind, I've been benchmarking the new models. -[cecli](https://github.com/cecli-dev/cecli) -is an open source command line chat tool that lets you work with GPT to edit -code in your local git repo. -cecli relies on a -[code editing benchmark](https://cecli.dev/docs/benchmarks.html) -to quantitatively evaluate -performance. +[cecli](https://github.com/cecli-dev/cecli) is an open source command line chat tool that lets you work with GPT to edit code in your local git repo. cecli relies on a [code editing benchmark](benchmarks.html) to quantitatively evaluate performance. -This is the latest in a series of reports -that use the cecli benchmarking suite to assess and compare the code -editing capabilities of OpenAI's GPT models. You can review previous -reports to get more background on cecli's benchmark suite: +This is the latest in a series of reports that use the cecli benchmarking suite to assess and compare the code editing capabilities of OpenAI's GPT models. You can review previous reports to get more background on cecli's benchmark suite: -- [GPT code editing benchmarks](https://cecli.dev/docs/benchmarks.html) evaluates the March and June versions of GPT-3.5 and GPT-4. -- [Code editing skill benchmarks for OpenAI's "1106" models](https://cecli.dev/docs/benchmarks-1106.html) compares the olders models to the November (1106) models. +- [GPT code editing benchmarks](benchmarks.html) evaluates the March and June versions of GPT-3.5 and GPT-4. +- [Code editing skill benchmarks for OpenAI's "1106" models](benchmarks-1106.html) compares the olders models to the November (1106) models. ## Speed -This report compares the **speed** of the various GPT models. -cecli's benchmark measures the response time of the OpenAI chat completion -endpoint each time it asks GPT to solve a programming exercise in the benchmark -suite. These results measure only the time spent waiting for OpenAI to -respond to the prompt. -So they are measuring -how fast these models can -generate responses which primarily consist of source code. +This report compares the **speed** of the various GPT models. cecli's benchmark measures the response time of the OpenAI chat completion endpoint each time it asks GPT to solve a programming exercise in the benchmark suite. These results measure only the time spent waiting for OpenAI to respond to the prompt. So they are measuring how fast these models can generate responses which primarily consist of source code. Some observations: @@ -55,5 +31,4 @@ Some observations: ## Updates -Last updated 11/14/23. -OpenAI has relaxed rate limits so these results are no longer considered preliminary. +Last updated 11/14/23. OpenAI has relaxed rate limits so these results are no longer considered preliminary. diff --git a/cecli/website/docs/benchmarks.md b/cecli/website/docs/benchmarks.md index 8226a276266..8044ca4c1e0 100644 --- a/cecli/website/docs/benchmarks.md +++ b/cecli/website/docs/benchmarks.md @@ -4,86 +4,40 @@ excerpt: Benchmarking GPT-3.5 and GPT-4 code editing skill using a new code edit highlight_image: /assets/benchmarks.jpg nav_exclude: true --- -{% if page.date %} - -{% endif %} # GPT code editing benchmarks [![benchmark results](/assets/benchmarks.svg)](https://cecli.dev/assets/benchmarks.svg) -cecli is an open source command line chat tool that lets you work with GPT to edit -code in your local git repo. -To do this, cecli needs to be able to reliably recognize when GPT wants to edit local files, -determine which files it wants to modify and what changes to save. -Such automated -code editing hinges on using the system prompt -to tell GPT how to structure code edits in its responses. - -cecli currently asks GPT to use simple text based "edit formats", but -[OpenAI's new function calling -API](https://openai.com/blog/function-calling-and-other-api-updates) -looks like a promising way to create more structured edit formats. -After implementing a couple of function based edit formats, -I wanted -to measure the potential benefits -of switching cecli to use them by default. - -With this in mind, I developed a -benchmark based on the [Exercism -python](https://github.com/exercism/python) coding exercises. -This -benchmark evaluates how effectively cecli and GPT can translate a -natural language coding request into executable code saved into -files that pass unit tests. -It provides an end-to-end evaluation of not just -GPT's coding ability, but also its capacity to *edit existing code* -and *format those code edits* so that cecli can save the -edits to the local source files. - -I ran the benchmark -on all the ChatGPT models (except `gpt-4-32k`), using a variety of edit formats. -The results were interesting: +Cecli is an open source command line chat tool that lets you work with GPT to edit code in your local git repo. To do this, cecli needs to be able to reliably recognize when GPT wants to edit local files, determine which files it wants to modify and what changes to save. Such automated code editing hinges on using the system prompt to tell GPT how to structure code edits in its responses. + +Cecli currently asks GPT to use simple text based "edit formats", but [OpenAI's new function calling API](https://openai.com/blog/function-calling-and-other-api-updates) looks like a promising way to create more structured edit formats. After implementing a couple of function based edit formats, I wanted to measure the potential benefits of switching cecli to use them by default. + +With this in mind, I developed a benchmark based on the [Exercism python](https://github.com/exercism/python) coding exercises. This benchmark evaluates how effectively cecli and GPT can translate a natural language coding request into executable code saved into files that pass unit tests. It provides an end-to-end evaluation of not just GPT's coding ability, but also its capacity to *edit existing code* and *format those code edits* so that cecli can save the edits to the local source files. + +I ran the benchmark on all the ChatGPT models (except `gpt-4-32k`), using a variety of edit formats. The results were interesting: - **Plain text edit formats worked best.** Asking GPT to return an updated copy of the whole file in a standard markdown fenced code block proved to be the most reliable and effective edit format across all GPT-3.5 and GPT-4 models. The results for this `whole` edit format are shown in solid blue in the graph. - **Function calls performed worse.** Using the new functions API for edits performed worse than the above whole file method, for all the models. GPT-3.5 especially produced inferior code and frequently mangled this output format. This was surprising, as the functions API was introduced to enhance the reliability of structured outputs. The results for these `...-func` edit methods are shown as patterned bars in the graph (both green and blue). - **The new June GPT-3.5 models did a bit worse than the old June model.** The performance of the new June (`0613`) versions of GPT-3.5 appears to be a bit worse than the February (`0301`) version. This is visible if you look at the "first attempt" markers on the first three solid blue bars and also by comparing the first three solid green `diff` bars. - **GPT-4 does better than GPT-3.5,** as expected. -The quantitative benchmark results agree with my intuitions -about prompting GPT for complex tasks like coding. It's beneficial to -minimize the "cognitive overhead" of formatting the response, allowing -GPT to concentrate on the coding task at hand. +The quantitative benchmark results agree with my intuitions about prompting GPT for complex tasks like coding. It's beneficial to minimize the "cognitive overhead" of formatting the response, allowing GPT to concentrate on the coding task at hand. -As a thought experiment, imagine a slack conversation with a editor developer where -you ask them to write the code to add some new feature to your app. -They're going to type the response back to you by hand in the chat. -Should they type out the -code and wrap it in a normal markdown code block? -Or should they type up a properly escaped and -syntactically correct json data structure -that contains the text of the new code? +As a thought experiment, imagine a slack conversation with a editor developer where you ask them to write the code to add some new feature to your app. They're going to type the response back to you by hand in the chat. Should they type out the code and wrap it in a normal markdown code block? Or should they type up a properly escaped and syntactically correct json data structure that contains the text of the new code? Using more complex output formats with GPT seems to cause two issues: - It makes GPT write worse code. Keeping the output format simple seems to allow GPT to devote more attention to the actual coding task. - It reduces GPT's adherence to the output format, making it more challenging for tools like cecli to accurately identify and apply the edits GPT is attempting to make. -I was expecting to start using function call based edits in cecli for both GPT-3.5 and GPT-4. -But given these benchmark results, I won't be adopting the functions API -at this time. -I will certainly plan to benchmark functions again with future versions of the models. +I was expecting to start using function call based edits in cecli for both GPT-3.5 and GPT-4. But given these benchmark results, I won't be adopting the functions API at this time. I will certainly plan to benchmark functions again with future versions of the models. More details on the benchmark, edit formats and results are discussed below. - ## The benchmark -The benchmark uses -[133 practice exercises from the Exercism python repository](https://github.com/exercism/python/tree/main/exercises/practice). -These -exercises were designed to help individuals learn Python and hone -their coding skills. +The benchmark uses [133 practice exercises from the Exercism python repository](https://github.com/exercism/python/tree/main/exercises/practice). These exercises were designed to help individuals learn Python and hone their coding skills. Each exercise includes: @@ -91,14 +45,9 @@ Each exercise includes: - [Stub python code](https://github.com/exercism/python/blob/main/exercises/practice/anagram/anagram.py) in an *implementation file*, specifying the functions or classes that need to be implemented. - [Unit tests](https://github.com/exercism/python/blob/main/exercises/practice/anagram/anagram_test.py) in a separate python file. -The goal is for GPT to read the instructions, implement the provided function/class skeletons -and pass all the unit tests. The benchmark measures what percentage of -the 133 exercises are completed successfully, causing all the associated unit tests to pass. +The goal is for GPT to read the instructions, implement the provided function/class skeletons and pass all the unit tests. The benchmark measures what percentage of the 133 exercises are completed successfully, causing all the associated unit tests to pass. -To start each exercise, cecli sends GPT -the initial contents of the implementation file, -the Exercism instructions -and a final instruction: +To start each exercise, cecli sends GPT the initial contents of the implementation file, the Exercism instructions and a final instruction: ``` Use the above instructions to modify the supplied files: @@ -106,12 +55,7 @@ Keep and implement the existing function or class stubs, they will be called fro Only use standard python libraries, don't suggest installing any packages. ``` -cecli updates the implementation file based on GPT's reply and runs -the unit tests. If all tests pass, the exercise is considered -complete. If some tests fail, cecli sends GPT a second message with -the test error output. It only sends the first 50 lines of test errors -to try and avoid exceeding the context window of the smaller models. cecli -also includes this final instruction: +Cecli updates the implementation file based on GPT's reply and runs the unit tests. If all tests pass, the exercise is considered complete. If some tests fail, cecli sends GPT a second message with the test error output. It only sends the first 50 lines of test errors to try and avoid exceeding the context window of the smaller models. cecli also includes this final instruction: ``` See the testing errors above. @@ -119,59 +63,28 @@ The tests are correct. Fix the code in to resolve the errors. ``` -Requiring GPT to fix its first implementation in response to test failures -is another way in which this benchmark stresses code editing skill. -This second chance is also important because it -gives GPT the opportunity to adjust if the -instructions were imprecise with respect to the -specific requirements of the unit tests. -Many of the exercises have multiple paragraphs of instructions, -and most human coders would likely fail some tests on their -first try. - -The bars in the graph show the percent of exercises that were completed by -each model and edit format combination. The full bar height represents -the final outcome following both coding attempts. -Each bar also has a horizontal mark that shows -the intermediate performance after the first coding attempt, -without the benefit of the second try that includes the test error output. - -It's worth noting that GPT never gets to see the source code of the -unit tests during the benchmark. It only sees the error output from -failed tests. Of course, all of this code was probably part of its -original training data! +Requiring GPT to fix its first implementation in response to test failures is another way in which this benchmark stresses code editing skill. This second chance is also important because it gives GPT the opportunity to adjust if the instructions were imprecise with respect to the specific requirements of the unit tests. Many of the exercises have multiple paragraphs of instructions, and most human coders would likely fail some tests on their first try. + +The bars in the graph show the percent of exercises that were completed by each model and edit format combination. The full bar height represents the final outcome following both coding attempts. Each bar also has a horizontal mark that shows the intermediate performance after the first coding attempt, without the benefit of the second try that includes the test error output. + +It's worth noting that GPT never gets to see the source code of the unit tests during the benchmark. It only sees the error output from failed tests. Of course, all of this code was probably part of its original training data! In summary, passing an exercise means GPT was able to: - Write the required code (possibly after reviewing test error output), - Correctly package all of the code edits into the edit format so that cecli can process and save it to the implementation file. -Conversely, failing an exercise only requires a breakdown in one of -those steps. In practice, GPT fails at different steps in different -exercises. Sometimes it simply writes the wrong code. Other times, it -fails to format the code edits in a way that conforms to the edit -format, resulting in the code not being saved correctly. - -It's worth keeping in mind that changing the edit format often affects -both aspects of GPT's performance. -Complex edit formats often lead GPT to write worse code *and* make it less -successful at formatting the edits correctly. +Conversely, failing an exercise only requires a breakdown in one of those steps. In practice, GPT fails at different steps in different exercises. Sometimes it simply writes the wrong code. Other times, it fails to format the code edits in a way that conforms to the edit format, resulting in the code not being saved correctly. +It's worth keeping in mind that changing the edit format often affects both aspects of GPT's performance. Complex edit formats often lead GPT to write worse code *and* make it less successful at formatting the edits correctly. ## Edit formats -I benchmarked 4 different edit formats, described below. -Each description includes a sample response that GPT might provide to a user who -requests: -"Change the print from hello to goodbye." +I benchmarked 4 different edit formats, described below. Each description includes a sample response that GPT might provide to a user who requests: "Change the print from hello to goodbye." ### whole -The -[whole](https://github.com/cecli-dev/cecli/blob/main/cecli/coders/wholefile_prompts.py) -format asks GPT to return an updated copy of the entire file, including any changes. -The file should be -formatted with normal markdown triple-backtick fences, inlined with the rest of its response text. +The [whole](https://github.com/cecli-dev/cecli/blob/main/cecli/coders/wholefile_prompts.py) format asks GPT to return an updated copy of the entire file, including any changes. The file should be formatted with normal markdown triple-backtick fences, inlined with the rest of its response text. This format is very similar to how ChatGPT returns code snippets during normal chats, except with the addition of a filename right before the opening triple-backticks. @@ -187,12 +100,7 @@ def main(): ### diff -The [diff](https://github.com/cecli-dev/cecli/blob/main/cecli/coders/editblock_prompts.py) -format also asks GPT to return edits as part of the normal response text, -in a simple diff format. -Each edit is a fenced code block that -specifies the filename and a chunk of ORIGINAL and UPDATED code. -GPT provides some original lines from the file and then a new updated set of lines. +The [diff](https://github.com/cecli-dev/cecli/blob/main/cecli/coders/editblock_prompts.py) format also asks GPT to return edits as part of the normal response text, in a simple diff format. Each edit is a fenced code block that specifies the filename and a chunk of ORIGINAL and UPDATED code. GPT provides some original lines from the file and then a new updated set of lines. ```` Here are the changes you requested to demo.py: @@ -209,9 +117,7 @@ demo.py ### whole-func -The [whole-func](https://github.com/cecli-dev/cecli/blob/main/cecli/coders/wholefile_func_coder.py) -format requests updated copies of whole files to be returned using the function call API. - +The [whole-func](https://github.com/cecli-dev/cecli/blob/main/cecli/coders/wholefile_func_coder.py) format requests updated copies of whole files to be returned using the function call API. ``` { @@ -226,10 +132,7 @@ format requests updated copies of whole files to be returned using the function ### diff-func -The -[diff-func](https://github.com/cecli-dev/cecli/blob/main/cecli/coders/editblock_func_coder.py) -format requests a list of -original/updated style edits to be returned using the function call API. +The [diff-func](https://github.com/cecli-dev/cecli/blob/main/cecli/coders/editblock_func_coder.py) format requests a list of original/updated style edits to be returned using the function call API. ``` { @@ -252,44 +155,23 @@ original/updated style edits to be returned using the function call API. ### The `0613` models seem worse? -The GPT-3.5 benchmark results have me fairly convinced that the new -`gpt-3.5-turbo-0613` and `gpt-3.5-16k-0613` models -are a bit worse at code editing than -the older `gpt-3.5-turbo-0301` model. +The GPT-3.5 benchmark results have me fairly convinced that the new `gpt-3.5-turbo-0613` and `gpt-3.5-16k-0613` models are a bit worse at code editing than the older `gpt-3.5-turbo-0301` model. -This is visible in the "first attempt" -portion of each result, before GPT gets a second chance to edit the code. -Look at the horizontal white line in the middle of the first three blue bars. -Performance with the `whole` edit format was 46% for the -February model and only 39% for the June models. +This is visible in the "first attempt" portion of each result, before GPT gets a second chance to edit the code. Look at the horizontal white line in the middle of the first three blue bars. Performance with the `whole` edit format was 46% for the February model and only 39% for the June models. -But also note how much the solid green `diff` bars -degrade between the February and June GPT-3.5 models. -They drop from 30% down to about 19%. +But also note how much the solid green `diff` bars degrade between the February and June GPT-3.5 models. They drop from 30% down to about 19%. -I saw other signs of this degraded performance -in earlier versions of the -benchmark as well. +I saw other signs of this degraded performance in earlier versions of the benchmark as well. ### Pathological use of `diff` -When GPT-3.5 is able to correctly generate the `diff` edit format, -it often uses it in a pathological manner. It places the *entire* -original source file in the ORIGINAL block and the entire updated file -in the UPDATED block. This is strictly worse than just using the -`whole` edit format, as GPT is sending two full copies of the file. +When GPT-3.5 is able to correctly generate the `diff` edit format, it often uses it in a pathological manner. It places the *entire* original source file in the ORIGINAL block and the entire updated file in the UPDATED block. This is strictly worse than just using the `whole` edit format, as GPT is sending two full copies of the file. ### Hallucinated function calls -When GPT-3.5 uses the functions API -it is prone to ignoring the JSON Schema that specifies valid functions. -It often returns a completely novel and semantically -invalid `function_call` fragment with `"name": "python"`. +When GPT-3.5 uses the functions API it is prone to ignoring the JSON Schema that specifies valid functions. It often returns a completely novel and semantically invalid `function_call` fragment with `"name": "python"`. -The `arguments` attribute is supposed to be a set of key/value pairs -with the arguments to the function specified in the `name` field. -Instead, GPT-3.5 frequently just stuffs an entire python -file into that field. +The `arguments` attribute is supposed to be a set of key/value pairs with the arguments to the function specified in the `name` field. Instead, GPT-3.5 frequently just stuffs an entire python file into that field. ``` "function_call": { @@ -298,71 +180,32 @@ file into that field. }, ``` -It seems like it might be getting confused by fine-tuning that was -done for the ChatGPT code interpreter plugin? +It seems like it might be getting confused by fine-tuning that was done for the ChatGPT code interpreter plugin? + +## Randomness +The benchmark attempts to be deterministic, always sending identical requests for each exercise on repeated runs. As part of this effort, when sending test error output to GPT, it removes the wall-clock timing information that is normally included by the `unittest` module. +The benchmark harness also logs SHA hashes of all the OpenAI API requests and replies. This makes it possible to detect randomness or nondeterminism in the benchmarking process. +It turns out that the OpenAI chat APIs are not deterministic, even at `temperature=0`. The same identical request will produce multiple distinct responses, usually less than 5-10 variations. This suggests that OpenAI may be load balancing their API across a number of slightly different instances of the model? -## Randomness +For certain exercises, some of these variable responses pass the unit tests while other variants do not. Results for exercises like this, which are "on the bubble", are therefore a bit random, depending on which variant OpenAI returns. + +Given that, it would be ideal to run all 133 exercises many times for each model/edit-format combination and report an average performance. This would average away the effect of the API variance. It would also significantly increase the cost of this sort of benchmarking. So I didn't do that. + +Benchmarking against 133 exercises already provides some robustness, since we are measuring the performance across many exercises. + +But to get a sense of how much the API variance impacts the benchmark outcomes, I ran all 133 exercises 10 times each against `gpt-3.5-turbo-0613` with the `whole` edit format. You'll see one set of error bars in the graph, which show the range of results from those 10 runs. -The benchmark attempts to be deterministic, always sending identical -requests for each exercise on repeated runs. -As part of this effort, -when sending test error output to GPT, -it removes the wall-clock timing information that -is normally included by the `unittest` module. - -The benchmark harness also logs SHA hashes of -all the OpenAI API requests and replies. -This makes it possible to -detect randomness or nondeterminism -in the benchmarking process. - -It turns out that the OpenAI chat APIs are not deterministic, even at -`temperature=0`. The same identical request will produce multiple -distinct responses, usually less than 5-10 variations. This suggests -that OpenAI may be load balancing their API across a number of -slightly different instances of the model? - -For certain exercises, some of these variable responses pass the unit tests while -other variants do not. Results for exercises like this, which are -"on the bubble", -are therefore a bit random, depending on which variant OpenAI returns. - -Given that, it would be ideal to run all 133 exercises many times for each -model/edit-format combination and report an average performance. -This would average away the effect of the API variance. -It would also significantly increase the cost of this sort of benchmarking. -So I didn't do that. - -Benchmarking against 133 exercises already provides some robustness, since -we are measuring the performance across many exercises. - -But to get a sense of how much the API variance impacts the benchmark outcomes, -I ran all 133 exercises 10 times each -against `gpt-3.5-turbo-0613` with the `whole` edit format. -You'll see one set of error bars in the graph, which show -the range of results from those 10 runs. - -The OpenAI API randomness doesn't seem to -cause a large variance in the overall benchmark results. +The OpenAI API randomness doesn't seem to cause a large variance in the overall benchmark results. ## Conclusions -Based on these benchmark results, cecli will continue to use -the `whole` edit format for GPT-3.5, and `diff` for GPT-4. +Based on these benchmark results, cecli will continue to use the `whole` edit format for GPT-3.5, and `diff` for GPT-4. -GPT-4 gets comparable results with the `whole` and `diff` edit formats, -but using `whole` significantly increases costs and latency compared to `diff`. +GPT-4 gets comparable results with the `whole` and `diff` edit formats, but using `whole` significantly increases costs and latency compared to `diff`. -The latency of streaming back the entire updated copy of each edited file -is a real challenge with the `whole` format. -The GPT-3.5 models are quite responsive, and can -stream back entire files at reasonable speed. -cecli displays a progress bar and -live diffs of the files as they stream in, -which helps pass the time. +The latency of streaming back the entire updated copy of each edited file is a real challenge with the `whole` format. The GPT-3.5 models are quite responsive, and can stream back entire files at reasonable speed. cecli displays a progress bar and live diffs of the files as they stream in, which helps pass the time. -The GPT-4 models are much slower, and waiting for even small files -to be completely "retyped" on each request is probably unacceptable. +The GPT-4 models are much slower, and waiting for even small files to be completely "retyped" on each request is probably unacceptable. diff --git a/cecli/website/docs/cecli-temp-logo-favicon.svg b/cecli/website/docs/cecli-temp-logo-favicon.svg new file mode 100644 index 00000000000..eda5f73f8a6 --- /dev/null +++ b/cecli/website/docs/cecli-temp-logo-favicon.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + CE_ + + diff --git a/cecli/website/docs/config.md b/cecli/website/docs/config.md index 4efb5e8f7f3..2ddd45a79a9 100644 --- a/cecli/website/docs/config.md +++ b/cecli/website/docs/config.md @@ -6,73 +6,53 @@ description: Information on all of cecli's settings and how to use them. # Configuration -cecli has many options which can be set with -command line switches. -Most options can also be set in an `.cecli.conf.yml` file -which can be placed in your home directory or at the root of -your git repo. -Or by setting environment variables like `CECLI_xxx` -either in your shell or a `.env` file. +Cecli has many options which can be set with command line switches. Most options can also be set in an `.cecli.conf.yml` file which can be placed in your home directory or at the root of your git repo. Or by setting environment variables like `CECLI_xxx` either in your shell or a `.env` file. Here are 4 equivalent ways of setting an option. With a command line switch: ``` -$ cecli --dark-mode +$ cecli --tui ``` Using a `.cecli.conf.yml` file: ```yaml -dark-mode: true +tui: true ``` By setting an environment variable: ``` -export CECLI_DARK_MODE=true +export CECLI_TUI=true ``` Using an `.env` file: ``` -CECLI_DARK_MODE=true +CECLI_TUI=true ``` - ## Default `~/.cecli/` Locations -cecli also checks several default locations inside `~/.cecli/` for -configuration, environment variables, and agent resources. -These are always included with lower precedence than project-level equivalents, -so a setting in a project `.cecli.conf.yml` or `.env` file will override the -`~/.cecli/` default. +Cecli also checks several default locations inside `~/.cecli/` for configuration, environment variables, and agent resources. These are always included with lower precedence than project-level equivalents, so a setting in a project `.cecli.conf.yml` or `.env` file will override the `~/.cecli/` default. ### `~/.cecli/conf.yml` -A YAML configuration file read after all other config file sources, -making it the lowest-precedence config option. Useful for setting -machine-wide defaults that individual projects can override. -See the [configuration section](/docs/config/conf.html) above for supported options. +A YAML configuration file read after all other config file sources, making it the lowest-precedence config option. Useful for setting machine-wide defaults that individual projects can override. See the [configuration section](config/conf.html) above for supported options. ### `~/.cecli/.env` -An environment file loaded before any other `.env` file, so project-level -`.env` files can override its values. A convenient place to store -API keys or other environment variables used across multiple projects. +An environment file loaded before any other `.env` file, so project-level `.env` files can override its values. A convenient place to store API keys or other environment variables used across multiple projects. ### `~/.cecli/skills/` -A directory containing skill packages (each a sub-directory with a -`SKILL.md` file). Skills here are discoverable alongside those in any -user-configured skills paths. +A directory containing skill packages (each a sub-directory with a `SKILL.md` file). Skills here are discoverable alongside those in any user-configured skills paths. ### `~/.cecli/subagents/` -A directory containing sub-agent definition files (`.md` files with -YAML front matter). Sub-agents here are registered alongside those in -any user-configured sub-agent paths. - +A directory containing sub-agent definition files (`.md` files with YAML front matter). Sub-agents here are registered alongside those in any user-configured sub-agent paths. -{% include keys.md %} +> **Tip:** +> See the [API key configuration docs](config/api-keys.html) for information on how to configure and store your API keys. diff --git a/cecli/website/docs/config/adv-model-settings.md b/cecli/website/docs/config/adv-model-settings.md index e2d4c6c5997..cbf15d211d5 100644 --- a/cecli/website/docs/config/adv-model-settings.md +++ b/cecli/website/docs/config/adv-model-settings.md @@ -4,31 +4,22 @@ nav_order: 950 description: Configuring advanced settings for LLMs. --- -# Advanced model settings +# Model Configuration Files ## Context window size and token costs -In most cases, you can safely ignore cecli's warning about unknown context -window size and model costs. +In most cases, you can safely ignore cecli's warning about unknown context window size and model costs. -{: .note } -cecli never *enforces* token limits, it only *reports* token limit errors -from the API provider. -You probably don't need to -configure cecli with the proper token limits -for unusual models. +> **Note:** cecli never *enforces* token limits, it only *reports* token limit errors from the API provider. You probably don't need to configure cecli with the proper token limits for unusual models. -But, you can register context window limits and costs for models that aren't known -to cecli. Create a `.cecli.model.metadata.json` file in one of these locations: +But, you can register context window limits and costs for models that aren't known to cecli. Create a `.cecli.model.metadata.json` file in one of these locations: - Your home directory. - The root if your git repo. - The current directory where you launch cecli. - Or specify a specific file with the `--model-metadata-file ` switch. - -If the files above exist, they will be loaded in that order. -Files loaded last will take priority. +If the files above exist, they will be loaded in that order. Files loaded last will take priority. The json file should be a dictionary with an entry for each model, as follows: @@ -46,28 +37,17 @@ The json file should be a dictionary with an entry for each model, as follows: } ``` -{: .tip } -Use a fully qualified model name with a `provider/` at the front -in the `.cecli.model.metadata.json` file. -For example, use `deepseek/deepseek-chat`, not just `deepseek-chat`. -That prefix should match the `litellm_provider` field. +> **Tip:** Use a fully qualified model name with a `provider/` at the front in the `.cecli.model.metadata.json` file. For example, use `deepseek/deepseek-chat`, not just `deepseek-chat`. That prefix should match the `litellm_provider` field. ### Contribute model metadata -cecli relies on -[litellm's model_prices_and_context_window.json file](https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json) -for model metadata. +Cecli relies on [litellm's model_prices_and_context_window.json file](https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json) for model metadata. Consider submitting a PR to that file to add missing models. ## Model settings -cecli has a number of settings that control how it works with -different models. -These model settings are pre-configured for most popular models. -But it can sometimes be helpful to override them or add settings for -a model that cecli doesn't know about. - +Cecli has a number of settings that control how it works with different models. These model settings are pre-configured for most popular models. But it can sometimes be helpful to override them or add settings for a model that cecli doesn't know about. ### Configuration file locations @@ -78,17 +58,13 @@ You can override or add settings for any model by creating a `.cecli.model.setti - The current directory where you launch cecli. - Or specify a specific file with the `--model-settings-file ` switch. -If the files above exist, they will be loaded in that order. -Files loaded last will take priority. +If the files above exist, they will be loaded in that order. Files loaded last will take priority. The YAML file should be a list of dictionary objects for each model. - ### Passing extra params to litellm.completion -The `extra_params` attribute of model settings is used to pass arbitrary -extra parameters to the `litellm.completion()` call when sending data -to the given model. +The `extra_params` attribute of model settings is used to pass arbitrary extra parameters to the `litellm.completion()` call when sending data to the given model. For example: @@ -100,9 +76,7 @@ For example: max_tokens: 8192 ``` -You can use the special model name `cecli/extra_params` to define -`extra_params` that will be passed to `litellm.completion()` for all models. -Only the `extra_params` dict is used from this special model name. +You can use the special model name `cecli/extra_params` to define `extra_params` that will be passed to `litellm.completion()` for all models. Only the `extra_params` dict is used from this special model name. For example: @@ -114,27 +88,16 @@ For example: max_tokens: 8192 ``` -These settings will be merged with any model-specific settings, with the -`cecli/extra_params` settings taking precedence for any direct conflicts. +These settings will be merged with any model-specific settings, with the `cecli/extra_params` settings taking precedence for any direct conflicts. ### Default model settings -Below are all the pre-configured model settings to give a sense for the settings which are supported. +Below is an example settings entry to give a sense for how the configuration works. -You can also look at the `ModelSettings` class in -[models.py](https://github.com/cecli-dev/cecli/blob/main/cecli/models.py) -file for more details about all of the model setting that cecli supports. +You can also look at the `ModelSettings` class in [models.py](https://github.com/cecli-dev/cecli/blob/main/cecli/models.py) file for more details about all of the model setting that cecli supports. -The first entry shows all the settings, with their default values. -For a real model, -you just need to include whichever fields that you want to override the defaults. +The first entry shows all the settings, with their default values. For a real model, you just need to include whichever fields that you want to override the defaults. - ```yaml - name: (default values) edit_format: whole @@ -157,2342 +120,4 @@ cog.out("```\n") remove_reasoning: null system_prompt_prefix: null accepts_settings: null - -- name: anthropic.claude-opus-4-20250514-v1:0 - edit_format: diff - weak_model_name: anthropic.claude-3-5-haiku-20241022-v1:0 - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 32000 - cache_control: true - editor_model_name: anthropic.claude-sonnet-4-20250514-v1:0 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: anthropic.claude-sonnet-4-20250514-v1:0 - edit_format: diff - weak_model_name: anthropic.claude-3-5-haiku-20241022-v1:0 - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 64000 - cache_control: true - editor_model_name: anthropic.claude-sonnet-4-20250514-v1:0 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: anthropic/claude-3-5-haiku-20241022 - edit_format: diff - weak_model_name: anthropic/claude-3-5-haiku-20241022 - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25 - cache_control: true - -- name: anthropic/claude-3-5-sonnet-20240620 - edit_format: diff - weak_model_name: anthropic/claude-3-5-haiku-20241022 - use_repo_map: true - examples_as_sys_msg: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25 - max_tokens: 8192 - cache_control: true - editor_model_name: anthropic/claude-3-5-sonnet-20240620 - editor_edit_format: editor-diff - -- name: anthropic/claude-3-5-sonnet-20241022 - edit_format: diff - weak_model_name: anthropic/claude-3-5-haiku-20241022 - use_repo_map: true - examples_as_sys_msg: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25 - max_tokens: 8192 - cache_control: true - editor_model_name: anthropic/claude-3-5-sonnet-20241022 - editor_edit_format: editor-diff - -- name: anthropic/claude-3-5-sonnet-latest - edit_format: diff - weak_model_name: anthropic/claude-3-5-haiku-20241022 - use_repo_map: true - examples_as_sys_msg: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25 - max_tokens: 8192 - cache_control: true - editor_model_name: anthropic/claude-3-5-sonnet-20241022 - editor_edit_format: editor-diff - -- name: anthropic/claude-3-7-sonnet-20250219 - edit_format: diff - weak_model_name: anthropic/claude-3-5-haiku-20241022 - use_repo_map: true - overeager: true - examples_as_sys_msg: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 64000 - cache_control: true - editor_model_name: anthropic/claude-3-7-sonnet-20250219 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: anthropic/claude-3-7-sonnet-latest - edit_format: diff - weak_model_name: anthropic/claude-3-5-haiku-20241022 - use_repo_map: true - overeager: true - examples_as_sys_msg: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 64000 - cache_control: true - editor_model_name: anthropic/claude-3-7-sonnet-latest - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: anthropic/claude-3-haiku-20240307 - weak_model_name: anthropic/claude-3-haiku-20240307 - examples_as_sys_msg: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25 - cache_control: true - -- name: anthropic/claude-opus-4-20250514 - edit_format: diff - weak_model_name: anthropic/claude-3-5-haiku-20241022 - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 32000 - cache_control: true - editor_model_name: anthropic/claude-sonnet-4-20250514 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: anthropic/claude-sonnet-4-20250514 - edit_format: diff - weak_model_name: anthropic/claude-3-5-haiku-20241022 - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 64000 - cache_control: true - editor_model_name: anthropic/claude-sonnet-4-20250514 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: azure/gpt-4.1 - edit_format: diff - weak_model_name: azure/gpt-4.1-mini - use_repo_map: true - reminder: sys - editor_model_name: azure/gpt-4.1-mini - -- name: azure/gpt-4.1-mini - edit_format: diff - use_repo_map: true - reminder: sys - -- name: azure/gpt-5 - edit_format: diff - weak_model_name: azure/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: azure/gpt-5-2025-08-07 - edit_format: diff - weak_model_name: azure/gpt-5-nano-2025-08-07 - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: azure/gpt-5-chat - edit_format: diff - weak_model_name: azure/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: azure/gpt-5-chat-latest - edit_format: diff - weak_model_name: azure/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: azure/gpt-5-mini - edit_format: diff - weak_model_name: azure/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: azure/gpt-5-mini-2025-08-07 - edit_format: diff - weak_model_name: azure/gpt-5-nano-2025-08-07 - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: azure/gpt-5-nano - edit_format: diff - weak_model_name: azure/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: azure/gpt-5-nano-2025-08-07 - edit_format: diff - weak_model_name: azure/gpt-5-nano-2025-08-07 - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: azure/gpt-5-pro - edit_format: diff - weak_model_name: azure/gpt-5-mini - use_repo_map: true - examples_as_sys_msg: true - use_temperature: false - streaming: false - editor_model_name: azure/gpt-5 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: azure/gpt-5.1 - edit_format: diff - weak_model_name: azure/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: azure/gpt-5.1-2025-11-13 - edit_format: diff - weak_model_name: azure/gpt-5-nano-2025-08-07 - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: azure/gpt-5.1-chat - edit_format: diff - weak_model_name: azure/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: azure/gpt-5.1-chat-latest - edit_format: diff - weak_model_name: azure/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: azure/o1 - edit_format: diff - weak_model_name: azure/gpt-4o-mini - use_repo_map: true - use_temperature: false - streaming: false - editor_model_name: azure/gpt-4o - editor_edit_format: editor-diff - accepts_settings: - - reasoning_effort - -- name: azure/o1-mini - weak_model_name: azure/gpt-4o-mini - use_repo_map: true - use_system_prompt: false - use_temperature: false - editor_model_name: azure/gpt-4o - editor_edit_format: editor-diff - -- name: azure/o1-preview - edit_format: diff - weak_model_name: azure/gpt-4o-mini - use_repo_map: true - use_system_prompt: false - use_temperature: false - editor_model_name: azure/gpt-4o - editor_edit_format: editor-diff - -- name: azure/o3 - edit_format: diff - weak_model_name: azure/gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - streaming: false - editor_model_name: azure/gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: azure/o3-mini - edit_format: diff - weak_model_name: azure/gpt-4o-mini - use_repo_map: true - use_temperature: false - editor_model_name: azure/gpt-4o - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: azure/o3-pro - edit_format: diff - weak_model_name: azure/gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - streaming: false - editor_model_name: azure/gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: azure/o4-mini - edit_format: diff - weak_model_name: azure/gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - use_temperature: false - editor_model_name: azure/gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: azure/o4-mini - edit_format: diff - weak_model_name: azure/gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - use_temperature: false - editor_model_name: azure/gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: azure/o4-mini - edit_format: diff - weak_model_name: azure/gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - use_temperature: false - editor_model_name: azure/gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: azure/o4-mini - edit_format: diff - weak_model_name: azure/gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - use_temperature: false - editor_model_name: azure/gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: azure/o4-mini - edit_format: diff - weak_model_name: azure/gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - use_temperature: false - editor_model_name: azure/gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: bedrock/anthropic.claude-3-5-haiku-20241022-v1:0 - edit_format: diff - weak_model_name: bedrock/anthropic.claude-3-5-haiku-20241022-v1:0 - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25 - cache_control: true - -- name: bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0 - edit_format: diff - weak_model_name: bedrock/anthropic.claude-3-5-haiku-20241022-v1:0 - use_repo_map: true - examples_as_sys_msg: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25 - max_tokens: 8192 - cache_control: true - editor_model_name: bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0 - editor_edit_format: editor-diff - -- name: bedrock/anthropic.claude-3-7-sonnet-20250219-v1:0 - edit_format: diff - weak_model_name: bedrock/anthropic.claude-3-5-haiku-20241022-v1:0 - use_repo_map: true - overeager: true - examples_as_sys_msg: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 64000 - cache_control: true - editor_model_name: bedrock/anthropic.claude-3-7-sonnet-20250219-v1:0 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: bedrock/anthropic.claude-sonnet-4-20250514-v1:0 - edit_format: diff - weak_model_name: bedrock/anthropic.claude-3-5-haiku-20241022-v1:0 - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 64000 - cache_control: true - editor_model_name: bedrock/anthropic.claude-sonnet-4-20250514-v1:0 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: bedrock/global.anthropic.claude-sonnet-4-5-20250929-v1:0 - edit_format: diff - weak_model_name: bedrock/anthropic.claude-3-5-haiku-20241022-v1:0 - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 64000 - cache_control: true - editor_model_name: bedrock/global.anthropic.claude-sonnet-4-5-20250929-v1:0 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: bedrock/us.anthropic.claude-3-7-sonnet-20250219-v1:0 - edit_format: diff - weak_model_name: bedrock/us.anthropic.claude-3-5-haiku-20241022-v1:0 - use_repo_map: true - overeager: true - examples_as_sys_msg: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 64000 - cache_control: true - editor_model_name: bedrock/us.anthropic.claude-3-7-sonnet-20250219-v1:0 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0 - edit_format: diff - weak_model_name: bedrock/us.anthropic.claude-3-5-haiku-20241022-v1:0 - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 64000 - cache_control: true - editor_model_name: bedrock/us.anthropic.claude-sonnet-4-20250514-v1:0 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: bedrock_converse/anthropic.claude-3-7-sonnet-20250219-v1:0 - edit_format: diff - weak_model_name: bedrock_converse/anthropic.claude-3-5-haiku-20241022-v1:0 - use_repo_map: true - overeager: true - examples_as_sys_msg: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 64000 - cache_control: true - editor_model_name: bedrock_converse/anthropic.claude-3-7-sonnet-20250219-v1:0 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: bedrock_converse/anthropic.claude-opus-4-20250514-v1:0 - edit_format: diff - weak_model_name: bedrock_converse/anthropic.claude-3-5-haiku-20241022-v1:0 - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 32000 - cache_control: true - editor_model_name: bedrock_converse/anthropic.claude-sonnet-4-20250514-v1:0 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: bedrock_converse/anthropic.claude-sonnet-4-20250514-v1:0 - edit_format: diff - weak_model_name: bedrock_converse/anthropic.claude-3-5-haiku-20241022-v1:0 - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 64000 - cache_control: true - editor_model_name: bedrock_converse/anthropic.claude-sonnet-4-20250514-v1:0 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: bedrock_converse/eu.anthropic.claude-opus-4-20250514-v1:0 - edit_format: diff - weak_model_name: bedrock_converse/eu.anthropic.claude-3-5-haiku-20241022-v1:0 - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 32000 - cache_control: true - editor_model_name: bedrock_converse/eu.anthropic.claude-sonnet-4-20250514-v1:0 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: bedrock_converse/eu.anthropic.claude-sonnet-4-20250514-v1:0 - edit_format: diff - weak_model_name: bedrock_converse/eu.anthropic.claude-3-5-haiku-20241022-v1:0 - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 64000 - cache_control: true - editor_model_name: bedrock_converse/eu.anthropic.claude-sonnet-4-20250514-v1:0 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: bedrock_converse/us.anthropic.claude-3-7-sonnet-20250219-v1:0 - edit_format: diff - weak_model_name: bedrock_converse/us.anthropic.claude-3-5-haiku-20241022-v1:0 - use_repo_map: true - overeager: true - examples_as_sys_msg: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 64000 - cache_control: true - editor_model_name: bedrock_converse/us.anthropic.claude-3-7-sonnet-20250219-v1:0 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: bedrock_converse/us.anthropic.claude-opus-4-20250514-v1:0 - edit_format: diff - weak_model_name: bedrock_converse/us.anthropic.claude-3-5-haiku-20241022-v1:0 - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 32000 - cache_control: true - editor_model_name: bedrock_converse/us.anthropic.claude-sonnet-4-20250514-v1:0 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: bedrock_converse/us.anthropic.claude-sonnet-4-20250514-v1:0 - edit_format: diff - weak_model_name: bedrock_converse/us.anthropic.claude-3-5-haiku-20241022-v1:0 - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 64000 - cache_control: true - editor_model_name: bedrock_converse/us.anthropic.claude-sonnet-4-20250514-v1:0 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: claude-3-5-haiku-20241022 - edit_format: diff - weak_model_name: claude-3-5-haiku-20241022 - use_repo_map: true - examples_as_sys_msg: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25 - cache_control: true - -- name: claude-3-5-sonnet-20240620 - edit_format: diff - weak_model_name: claude-3-5-haiku-20241022 - use_repo_map: true - examples_as_sys_msg: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25 - max_tokens: 8192 - cache_control: true - editor_model_name: claude-3-5-sonnet-20240620 - editor_edit_format: editor-diff - -- name: claude-3-5-sonnet-20241022 - edit_format: diff - weak_model_name: claude-3-5-haiku-20241022 - use_repo_map: true - examples_as_sys_msg: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25 - max_tokens: 8192 - cache_control: true - editor_model_name: claude-3-5-sonnet-20241022 - editor_edit_format: editor-diff - -- name: claude-3-7-sonnet-20250219 - edit_format: diff - weak_model_name: claude-3-5-haiku-20241022 - use_repo_map: true - examples_as_sys_msg: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 64000 - cache_control: true - editor_model_name: claude-3-7-sonnet-20250219 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: claude-3-7-sonnet-latest - edit_format: diff - weak_model_name: claude-3-5-haiku-20241022 - use_repo_map: true - overeager: true - examples_as_sys_msg: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 64000 - cache_control: true - editor_model_name: claude-3-7-sonnet-latest - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: claude-3-haiku-20240307 - weak_model_name: claude-3-haiku-20240307 - examples_as_sys_msg: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25 - cache_control: true - -- name: claude-3-opus-20240229 - edit_format: diff - weak_model_name: claude-3-5-haiku-20241022 - use_repo_map: true - -- name: claude-3-sonnet-20240229 - weak_model_name: claude-3-5-haiku-20241022 - -- name: claude-opus-4-20250514 - edit_format: diff - weak_model_name: claude-3-5-haiku-20241022 - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 32000 - cache_control: true - editor_model_name: claude-sonnet-4-20250514 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: claude-sonnet-4-20250514 - edit_format: diff - weak_model_name: claude-3-5-haiku-20241022 - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 64000 - cache_control: true - editor_model_name: claude-sonnet-4-20250514 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: cohere_chat/command-a-03-2025 - examples_as_sys_msg: true - -- name: command-r-08-2024 - weak_model_name: command-r-08-2024 - use_repo_map: true - -- name: command-r-plus - weak_model_name: command-r-plus - use_repo_map: true - -- name: command-r-plus-08-2024 - weak_model_name: command-r-plus-08-2024 - use_repo_map: true - -- name: deepseek-chat - edit_format: diff - use_repo_map: true - reminder: sys - examples_as_sys_msg: true - extra_params: - max_tokens: 8192 - -- name: deepseek-coder - edit_format: diff - use_repo_map: true - reminder: sys - examples_as_sys_msg: true - extra_params: - max_tokens: 8192 - caches_by_default: true - -- name: deepseek/deepseek-chat - edit_format: diff - use_repo_map: true - reminder: sys - examples_as_sys_msg: true - extra_params: - max_tokens: 8192 - caches_by_default: true - -- name: deepseek/deepseek-coder - edit_format: diff - use_repo_map: true - reminder: sys - examples_as_sys_msg: true - extra_params: - max_tokens: 8192 - caches_by_default: true - -- name: deepseek/deepseek-reasoner - edit_format: diff - weak_model_name: deepseek/deepseek-chat - use_repo_map: true - examples_as_sys_msg: true - extra_params: - max_tokens: 64000 - caches_by_default: true - use_temperature: false - editor_model_name: deepseek/deepseek-chat - editor_edit_format: editor-diff - -- name: eu.anthropic.claude-opus-4-20250514-v1:0 - edit_format: diff - weak_model_name: eu.anthropic.claude-3-5-haiku-20241022-v1:0 - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 32000 - cache_control: true - editor_model_name: eu.anthropic.claude-sonnet-4-20250514-v1:0 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: eu.anthropic.claude-sonnet-4-20250514-v1:0 - edit_format: diff - weak_model_name: eu.anthropic.claude-3-5-haiku-20241022-v1:0 - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 64000 - cache_control: true - editor_model_name: eu.anthropic.claude-sonnet-4-20250514-v1:0 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: fireworks_ai/accounts/fireworks/models/deepseek-r1 - edit_format: diff - weak_model_name: fireworks_ai/accounts/fireworks/models/deepseek-v3 - use_repo_map: true - extra_params: - max_tokens: 160000 - use_temperature: false - editor_model_name: fireworks_ai/accounts/fireworks/models/deepseek-v3 - editor_edit_format: editor-diff - reasoning_tag: think - -- name: fireworks_ai/accounts/fireworks/models/deepseek-v3 - edit_format: diff - use_repo_map: true - reminder: sys - examples_as_sys_msg: true - extra_params: - max_tokens: 128000 - -- name: fireworks_ai/accounts/fireworks/models/deepseek-v3-0324 - edit_format: diff - use_repo_map: true - reminder: sys - examples_as_sys_msg: true - extra_params: - max_tokens: 160000 - -- name: fireworks_ai/accounts/fireworks/models/qwq-32b - edit_format: diff - weak_model_name: fireworks_ai/accounts/fireworks/models/qwen2p5-coder-32b-instruct - use_repo_map: true - examples_as_sys_msg: true - extra_params: - max_tokens: 32000 - top_p: 0.95 - use_temperature: 0.6 - editor_model_name: fireworks_ai/accounts/fireworks/models/qwen2p5-coder-32b-instruct - editor_edit_format: editor-diff - reasoning_tag: think - -- name: gemini-2.5-flash-preview-04-17 - edit_format: diff - use_repo_map: true - accepts_settings: - - reasoning_effort - - thinking_tokens - -- name: gemini/gemini-1.5-flash-002 - -- name: gemini/gemini-1.5-pro - edit_format: diff-fenced - use_repo_map: true - -- name: gemini/gemini-1.5-pro-002 - edit_format: diff - use_repo_map: true - -- name: gemini/gemini-1.5-pro-latest - edit_format: diff-fenced - use_repo_map: true - -- name: gemini/gemini-2.0-flash - edit_format: diff - use_repo_map: true - -- name: gemini/gemini-2.0-flash-exp - edit_format: diff - use_repo_map: true - -- name: gemini/gemini-2.5-flash - edit_format: diff-fenced - use_repo_map: true - overeager: true - use_temperature: false - accepts_settings: - - thinking_tokens - -- name: gemini/gemini-2.5-flash-lite-preview-06-17 - edit_format: diff-fenced - use_repo_map: true - overeager: true - use_temperature: false - accepts_settings: - - thinking_tokens - -- name: gemini/gemini-2.5-flash-preview-04-17 - edit_format: diff - use_repo_map: true - accepts_settings: - - reasoning_effort - - thinking_tokens - -- name: gemini/gemini-2.5-pro - edit_format: diff-fenced - weak_model_name: gemini/gemini-2.5-flash - use_repo_map: true - overeager: true - use_temperature: false - accepts_settings: - - thinking_tokens - -- name: gemini/gemini-2.5-pro-exp-03-25 - edit_format: diff-fenced - weak_model_name: gemini/gemini-2.5-flash-preview-04-17 - use_repo_map: true - overeager: true - -- name: gemini/gemini-2.5-pro-preview-03-25 - edit_format: diff-fenced - weak_model_name: gemini/gemini-2.0-flash - use_repo_map: true - overeager: true - -- name: gemini/gemini-2.5-pro-preview-05-06 - edit_format: diff-fenced - weak_model_name: gemini/gemini-2.5-flash-preview-04-17 - use_repo_map: true - overeager: true - -- name: gemini/gemini-2.5-pro-preview-06-05 - edit_format: diff-fenced - weak_model_name: gemini/gemini-2.5-flash-preview-04-17 - use_repo_map: true - overeager: true - accepts_settings: - - thinking_tokens - -- name: gemini/gemini-3-pro-preview - edit_format: diff-fenced - weak_model_name: gemini/gemini-2.5-flash - use_repo_map: true - overeager: true - use_temperature: false - accepts_settings: - - thinking_tokens - -- name: gemini/gemini-exp-1206 - edit_format: diff - use_repo_map: true - -- name: gemini/gemma-3-27b-it - use_system_prompt: false - -- name: gpt-3.5-turbo - weak_model_name: gpt-4o-mini - reminder: sys - -- name: gpt-3.5-turbo-0125 - weak_model_name: gpt-4o-mini - reminder: sys - -- name: gpt-3.5-turbo-0613 - weak_model_name: gpt-4o-mini - reminder: sys - -- name: gpt-3.5-turbo-1106 - weak_model_name: gpt-4o-mini - reminder: sys - -- name: gpt-3.5-turbo-16k-0613 - weak_model_name: gpt-4o-mini - reminder: sys - -- name: gpt-4-0125-preview - edit_format: udiff - weak_model_name: gpt-4o-mini - use_repo_map: true - lazy: true - reminder: sys - examples_as_sys_msg: true - -- name: gpt-4-0314 - edit_format: diff - weak_model_name: gpt-4o-mini - use_repo_map: true - reminder: sys - examples_as_sys_msg: true - -- name: gpt-4-0613 - edit_format: diff - weak_model_name: gpt-4o-mini - use_repo_map: true - reminder: sys - -- name: gpt-4-1106-preview - edit_format: udiff - weak_model_name: gpt-4o-mini - use_repo_map: true - lazy: true - reminder: sys - -- name: gpt-4-32k-0613 - edit_format: diff - weak_model_name: gpt-4o-mini - use_repo_map: true - reminder: sys - -- name: gpt-4-turbo - edit_format: udiff - weak_model_name: gpt-4o-mini - use_repo_map: true - lazy: true - reminder: sys - -- name: gpt-4-turbo-2024-04-09 - edit_format: udiff - weak_model_name: gpt-4o-mini - use_repo_map: true - lazy: true - reminder: sys - -- name: gpt-4-vision-preview - edit_format: diff - weak_model_name: gpt-4o-mini - use_repo_map: true - reminder: sys - -- name: gpt-4.1 - edit_format: diff - weak_model_name: gpt-4.1-mini - use_repo_map: true - reminder: sys - editor_model_name: gpt-4.1-mini - -- name: gpt-4.1-mini - edit_format: diff - use_repo_map: true - reminder: sys - -- name: gpt-4.5-preview - edit_format: diff - weak_model_name: gpt-4o-mini - use_repo_map: true - lazy: true - reminder: sys - examples_as_sys_msg: true - editor_model_name: gpt-4o - editor_edit_format: editor-diff - -- name: gpt-4o - edit_format: diff - weak_model_name: gpt-4o-mini - use_repo_map: true - lazy: true - reminder: sys - examples_as_sys_msg: true - editor_edit_format: editor-diff - -- name: gpt-4o-2024-08-06 - edit_format: diff - weak_model_name: gpt-4o-mini - use_repo_map: true - lazy: true - reminder: sys - examples_as_sys_msg: true - -- name: gpt-4o-2024-11-20 - edit_format: diff - weak_model_name: gpt-4o-mini - use_repo_map: true - lazy: true - reminder: sys - examples_as_sys_msg: true - -- name: gpt-4o-mini - weak_model_name: gpt-4o-mini - lazy: true - reminder: sys - -- name: gpt-5 - edit_format: diff - weak_model_name: gpt-5-nano - use_repo_map: true - overeager: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: gpt-5-2025-08-07 - edit_format: diff - weak_model_name: gpt-5-nano-2025-08-07 - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: gpt-5-chat - edit_format: diff - weak_model_name: gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: gpt-5-chat-latest - edit_format: diff - weak_model_name: gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: gpt-5-codex - edit_format: diff - weak_model_name: gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: gpt-5-mini - edit_format: diff - weak_model_name: gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: gpt-5-mini-2025-08-07 - edit_format: diff - weak_model_name: gpt-5-nano-2025-08-07 - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: gpt-5-nano - edit_format: diff - weak_model_name: gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: gpt-5-nano-2025-08-07 - edit_format: diff - weak_model_name: gpt-5-nano-2025-08-07 - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: gpt-5-pro - edit_format: diff - weak_model_name: gpt-5-mini - use_repo_map: true - examples_as_sys_msg: true - use_temperature: false - streaming: false - editor_model_name: gpt-5 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: gpt-5.1 - edit_format: diff - weak_model_name: gpt-5-nano - use_repo_map: true - overeager: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: gpt-5.1-2025-11-13 - edit_format: diff - weak_model_name: gpt-5-nano-2025-08-07 - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: gpt-5.1-chat - edit_format: diff - weak_model_name: gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: gpt-5.1-chat-latest - edit_format: diff - weak_model_name: gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: gpt-5.1-codex - edit_format: diff - weak_model_name: gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: groq/llama3-70b-8192 - edit_format: diff - weak_model_name: groq/llama3-8b-8192 - examples_as_sys_msg: true - -- name: groq/qwen-qwq-32b - edit_format: diff - weak_model_name: groq/qwen-2.5-coder-32b - use_repo_map: true - extra_params: - max_tokens: 128000 - top_p: 0.95 - use_temperature: 0.6 - editor_model_name: groq/qwen-2.5-coder-32b - editor_edit_format: editor-diff - reasoning_tag: think - -- name: o1 - edit_format: diff - weak_model_name: gpt-4o-mini - use_repo_map: true - use_temperature: false - streaming: false - editor_model_name: gpt-4o - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: o1-mini - weak_model_name: gpt-4o-mini - use_repo_map: true - use_system_prompt: false - use_temperature: false - editor_model_name: gpt-4o - editor_edit_format: editor-diff - -- name: o1-preview - edit_format: architect - weak_model_name: gpt-4o-mini - use_repo_map: true - use_system_prompt: false - use_temperature: false - editor_model_name: gpt-4o - editor_edit_format: editor-diff - -- name: o3 - edit_format: diff - weak_model_name: gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - streaming: false - editor_model_name: gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: o3-mini - edit_format: diff - weak_model_name: gpt-4o-mini - use_repo_map: true - use_temperature: false - editor_model_name: gpt-4o - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: o3-pro - edit_format: diff - weak_model_name: gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - streaming: false - editor_model_name: gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: o4-mini - edit_format: diff - weak_model_name: gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - use_temperature: false - editor_model_name: gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: openai/gpt-4.1 - edit_format: diff - weak_model_name: openai/gpt-4.1-mini - use_repo_map: true - reminder: sys - editor_model_name: openai/gpt-4.1-mini - -- name: openai/gpt-4.1-mini - edit_format: diff - use_repo_map: true - reminder: sys - -- name: openai/gpt-4.5-preview - edit_format: diff - weak_model_name: gpt-4o-mini - use_repo_map: true - lazy: true - reminder: sys - examples_as_sys_msg: true - editor_model_name: openai/gpt-4o - editor_edit_format: editor-diff - -- name: openai/gpt-4o - edit_format: diff - weak_model_name: gpt-4o-mini - use_repo_map: true - lazy: true - reminder: sys - examples_as_sys_msg: true - editor_edit_format: editor-diff - -- name: openai/gpt-4o-2024-08-06 - edit_format: diff - weak_model_name: gpt-4o-mini - use_repo_map: true - lazy: true - reminder: sys - examples_as_sys_msg: true - -- name: openai/gpt-4o-2024-11-20 - edit_format: diff - weak_model_name: gpt-4o-mini - use_repo_map: true - lazy: true - reminder: sys - examples_as_sys_msg: true - -- name: openai/gpt-4o-mini - weak_model_name: openai/gpt-4o-mini - lazy: true - reminder: sys - -- name: openai/gpt-5 - edit_format: diff - weak_model_name: openai/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openai/gpt-5-2025-08-07 - edit_format: diff - weak_model_name: openai/gpt-5-nano-2025-08-07 - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openai/gpt-5-chat - edit_format: diff - weak_model_name: openai/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openai/gpt-5-chat-latest - edit_format: diff - weak_model_name: openai/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openai/gpt-5-mini - edit_format: diff - weak_model_name: openai/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openai/gpt-5-mini-2025-08-07 - edit_format: diff - weak_model_name: openai/gpt-5-nano-2025-08-07 - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openai/gpt-5-nano - edit_format: diff - weak_model_name: openai/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openai/gpt-5-nano-2025-08-07 - edit_format: diff - weak_model_name: openai/gpt-5-nano-2025-08-07 - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openai/gpt-5-pro - edit_format: diff - weak_model_name: openai/gpt-5-mini - use_repo_map: true - examples_as_sys_msg: true - use_temperature: false - streaming: false - editor_model_name: openai/gpt-5 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: openai/gpt-5.1 - edit_format: diff - weak_model_name: openai/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openai/gpt-5.1-2025-11-13 - edit_format: diff - weak_model_name: openai/gpt-5-nano-2025-08-07 - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openai/gpt-5.1-chat - edit_format: diff - weak_model_name: openai/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openai/gpt-5.1-chat-latest - edit_format: diff - weak_model_name: openai/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openai/o1 - edit_format: diff - weak_model_name: openai/gpt-4o-mini - use_repo_map: true - use_temperature: false - streaming: false - editor_model_name: openai/gpt-4o - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: openai/o1-mini - weak_model_name: openai/gpt-4o-mini - use_repo_map: true - use_system_prompt: false - use_temperature: false - editor_model_name: openai/gpt-4o - editor_edit_format: editor-diff - -- name: openai/o1-preview - edit_format: diff - weak_model_name: openai/gpt-4o-mini - use_repo_map: true - use_system_prompt: false - use_temperature: false - editor_model_name: openai/gpt-4o - editor_edit_format: editor-diff - -- name: openai/o3 - edit_format: diff - weak_model_name: openai/gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - streaming: false - editor_model_name: openai/gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: openai/o3-mini - edit_format: diff - weak_model_name: gpt-4o-mini - use_repo_map: true - use_temperature: false - editor_model_name: gpt-4o - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: openai/o3-pro - edit_format: diff - weak_model_name: openai/gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - streaming: false - editor_model_name: openai/gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: openai/o4-mini - edit_format: diff - weak_model_name: openai/gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - use_temperature: false - editor_model_name: openai/gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: openai/o4-mini - edit_format: diff - weak_model_name: openai/gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - use_temperature: false - editor_model_name: openai/gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: openai/o4-mini - edit_format: diff - weak_model_name: openai/gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - use_temperature: false - editor_model_name: openai/gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: openai/o4-mini - edit_format: diff - weak_model_name: openai/gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - use_temperature: false - editor_model_name: openai/gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: openai/o4-mini - edit_format: diff - weak_model_name: openai/gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - use_temperature: false - editor_model_name: openai/gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: openrouter/anthropic/claude-3-opus - edit_format: diff - weak_model_name: openrouter/anthropic/claude-3-5-haiku - use_repo_map: true - -- name: openrouter/anthropic/claude-3.5-sonnet - edit_format: diff - weak_model_name: openrouter/anthropic/claude-3-5-haiku - use_repo_map: true - examples_as_sys_msg: true - extra_params: - max_tokens: 8192 - cache_control: true - editor_model_name: openrouter/anthropic/claude-3.5-sonnet - editor_edit_format: editor-diff - -- name: openrouter/anthropic/claude-3.5-sonnet:beta - edit_format: diff - weak_model_name: openrouter/anthropic/claude-3-5-haiku:beta - use_repo_map: true - examples_as_sys_msg: true - extra_params: - max_tokens: 8192 - cache_control: true - editor_model_name: openrouter/anthropic/claude-3.5-sonnet:beta - editor_edit_format: editor-diff - -- name: openrouter/anthropic/claude-3.7-sonnet - edit_format: diff - weak_model_name: openrouter/anthropic/claude-3-5-haiku - use_repo_map: true - overeager: true - examples_as_sys_msg: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 64000 - cache_control: true - editor_model_name: openrouter/anthropic/claude-3.7-sonnet - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: openrouter/anthropic/claude-3.7-sonnet:beta - edit_format: diff - weak_model_name: openrouter/anthropic/claude-3-5-haiku - use_repo_map: true - overeager: true - examples_as_sys_msg: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 64000 - cache_control: true - editor_model_name: openrouter/anthropic/claude-3.7-sonnet - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: openrouter/anthropic/claude-opus-4 - edit_format: diff - weak_model_name: openrouter/anthropic/claude-3-5-haiku - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 32000 - cache_control: true - editor_model_name: openrouter/anthropic/claude-sonnet-4 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: openrouter/anthropic/claude-sonnet-4 - edit_format: diff - weak_model_name: openrouter/anthropic/claude-3-5-haiku - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 64000 - cache_control: true - editor_model_name: openrouter/anthropic/claude-sonnet-4 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: openrouter/cohere/command-a-03-2025 - examples_as_sys_msg: true - -- name: openrouter/deepseek/deepseek-chat - edit_format: diff - use_repo_map: true - reminder: sys - examples_as_sys_msg: true - -- name: openrouter/deepseek/deepseek-chat-v3-0324 - edit_format: diff - use_repo_map: true - reminder: sys - examples_as_sys_msg: true - extra_params: - max_tokens: 65536 - caches_by_default: true - -- name: openrouter/deepseek/deepseek-chat-v3-0324:free - edit_format: diff - weak_model_name: openrouter/deepseek/deepseek-chat-v3-0324:free - use_repo_map: true - examples_as_sys_msg: true - caches_by_default: true - use_temperature: false - editor_model_name: openrouter/deepseek/deepseek-r1:free - editor_edit_format: editor-diff - -- name: openrouter/deepseek/deepseek-chat:free - edit_format: diff - weak_model_name: openrouter/deepseek/deepseek-chat:free - use_repo_map: true - examples_as_sys_msg: true - extra_params: - max_tokens: 8192 - caches_by_default: true - use_temperature: false - editor_model_name: openrouter/deepseek/deepseek-chat:free - editor_edit_format: editor-diff - -- name: openrouter/deepseek/deepseek-coder - edit_format: diff - use_repo_map: true - reminder: sys - examples_as_sys_msg: true - -- name: openrouter/deepseek/deepseek-r1 - edit_format: diff - weak_model_name: openrouter/deepseek/deepseek-chat - use_repo_map: true - examples_as_sys_msg: true - extra_params: - max_tokens: 8192 - include_reasoning: true - caches_by_default: true - editor_model_name: openrouter/deepseek/deepseek-chat - editor_edit_format: editor-diff - -- name: openrouter/deepseek/deepseek-r1-distill-llama-70b - edit_format: diff - weak_model_name: openrouter/deepseek/deepseek-chat - use_repo_map: true - examples_as_sys_msg: true - extra_params: - max_tokens: 8192 - caches_by_default: true - use_temperature: false - editor_model_name: openrouter/deepseek/deepseek-chat - editor_edit_format: editor-diff - -- name: openrouter/deepseek/deepseek-r1:free - edit_format: diff - weak_model_name: openrouter/deepseek/deepseek-r1:free - use_repo_map: true - examples_as_sys_msg: true - extra_params: - max_tokens: 8192 - caches_by_default: true - -- name: openrouter/google/gemini-2.5-pro - edit_format: diff-fenced - weak_model_name: openrouter/google/gemini-2.5-flash - use_repo_map: true - overeager: true - accepts_settings: - - thinking_tokens - -- name: openrouter/google/gemini-2.5-pro-exp-03-25 - edit_format: diff-fenced - weak_model_name: openrouter/google/gemini-2.0-flash-exp:free - use_repo_map: true - overeager: true - -- name: openrouter/google/gemini-2.5-pro-preview-03-25 - edit_format: diff-fenced - weak_model_name: openrouter/google/gemini-2.0-flash-001 - use_repo_map: true - overeager: true - -- name: openrouter/google/gemini-2.5-pro-preview-05-06 - edit_format: diff-fenced - weak_model_name: openrouter/google/gemini-2.0-flash-001 - use_repo_map: true - overeager: true - -- name: openrouter/google/gemini-2.5-pro-preview-06-05 - edit_format: diff-fenced - weak_model_name: openrouter/google/gemini-2.0-flash-001 - use_repo_map: true - overeager: true - accepts_settings: - - thinking_tokens - -- name: openrouter/google/gemini-3-pro-preview - edit_format: diff-fenced - weak_model_name: openrouter/google/gemini-2.5-flash - use_repo_map: true - overeager: true - accepts_settings: - - thinking_tokens - -- name: openrouter/google/gemma-3-27b-it - use_system_prompt: false - -- name: openrouter/google/gemma-3-27b-it:free - use_system_prompt: false - -- name: openrouter/meta-llama/llama-3-70b-instruct - edit_format: diff - weak_model_name: openrouter/meta-llama/llama-3-70b-instruct - examples_as_sys_msg: true - -- name: openrouter/moonshotai/kimi-k2 - edit_format: diff - use_repo_map: true - examples_as_sys_msg: true - extra_params: - temperature: 0.6 - -- name: openrouter/openai/gpt-4.1 - edit_format: diff - weak_model_name: openrouter/openai/gpt-4.1-mini - use_repo_map: true - reminder: sys - editor_model_name: openrouter/openai/gpt-4.1-mini - -- name: openrouter/openai/gpt-4.1-mini - edit_format: diff - use_repo_map: true - reminder: sys - -- name: openrouter/openai/gpt-4o - edit_format: diff - weak_model_name: openrouter/openai/gpt-4o-mini - use_repo_map: true - lazy: true - reminder: sys - examples_as_sys_msg: true - editor_edit_format: editor-diff - -- name: openrouter/openai/gpt-5 - edit_format: diff - weak_model_name: openrouter/openai/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openrouter/openai/gpt-5-2025-08-07 - edit_format: diff - weak_model_name: openrouter/openai/gpt-5-nano-2025-08-07 - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openrouter/openai/gpt-5-chat - edit_format: diff - weak_model_name: openrouter/openai/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openrouter/openai/gpt-5-chat-latest - edit_format: diff - weak_model_name: openrouter/openai/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openrouter/openai/gpt-5-mini - edit_format: diff - weak_model_name: openrouter/openai/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openrouter/openai/gpt-5-mini-2025-08-07 - edit_format: diff - weak_model_name: openrouter/openai/gpt-5-nano-2025-08-07 - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openrouter/openai/gpt-5-nano - edit_format: diff - weak_model_name: openrouter/openai/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openrouter/openai/gpt-5-nano-2025-08-07 - edit_format: diff - weak_model_name: openrouter/openai/gpt-5-nano-2025-08-07 - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openrouter/openai/gpt-5-pro - edit_format: diff - weak_model_name: openrouter/openai/gpt-5-mini - use_repo_map: true - examples_as_sys_msg: true - use_temperature: false - streaming: false - editor_model_name: openrouter/openai/gpt-5 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: openrouter/openai/gpt-5.1 - edit_format: diff - weak_model_name: openrouter/openai/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openrouter/openai/gpt-5.1-2025-11-13 - edit_format: diff - weak_model_name: openrouter/openai/gpt-5-nano-2025-08-07 - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openrouter/openai/gpt-5.1-chat - edit_format: diff - weak_model_name: openrouter/openai/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openrouter/openai/gpt-5.1-chat-latest - edit_format: diff - weak_model_name: openrouter/openai/gpt-5-nano - use_repo_map: true - use_temperature: false - accepts_settings: - - reasoning_effort - -- name: openrouter/openai/o1 - edit_format: diff - weak_model_name: openrouter/openai/gpt-4o-mini - use_repo_map: true - use_temperature: false - streaming: false - editor_model_name: openrouter/openai/gpt-4o - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: openrouter/openai/o1-mini - weak_model_name: openrouter/openai/gpt-4o-mini - use_repo_map: true - use_system_prompt: false - use_temperature: false - streaming: false - editor_model_name: openrouter/openai/gpt-4o - editor_edit_format: editor-diff - -- name: openrouter/openai/o1-preview - edit_format: diff - weak_model_name: openrouter/openai/gpt-4o-mini - use_repo_map: true - use_system_prompt: false - use_temperature: false - streaming: false - editor_model_name: openrouter/openai/gpt-4o - editor_edit_format: editor-diff - -- name: openrouter/openai/o3 - edit_format: diff - weak_model_name: openrouter/openai/gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - streaming: false - editor_model_name: openrouter/openai/gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: openrouter/openai/o3-mini - edit_format: diff - weak_model_name: openrouter/openai/gpt-4o-mini - use_repo_map: true - use_temperature: false - editor_model_name: openrouter/openai/gpt-4o - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: openrouter/openai/o3-mini-high - edit_format: diff - weak_model_name: openrouter/openai/gpt-4o-mini - use_repo_map: true - use_temperature: false - editor_model_name: openrouter/openai/gpt-4o - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: openrouter/openai/o3-pro - edit_format: diff - weak_model_name: openrouter/openai/gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - streaming: false - editor_model_name: openrouter/openai/gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: openrouter/openai/o4-mini - edit_format: diff - weak_model_name: openrouter/openai/gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - use_temperature: false - editor_model_name: openrouter/openai/gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: openrouter/openai/o4-mini - edit_format: diff - weak_model_name: openrouter/openai/gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - use_temperature: false - editor_model_name: openrouter/openai/gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: openrouter/openai/o4-mini - edit_format: diff - weak_model_name: openrouter/openai/gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - use_temperature: false - editor_model_name: openrouter/openai/gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: openrouter/openai/o4-mini - edit_format: diff - weak_model_name: openrouter/openai/gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - use_temperature: false - editor_model_name: openrouter/openai/gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: openrouter/openai/o4-mini - edit_format: diff - weak_model_name: openrouter/openai/gpt-4.1-mini - use_repo_map: true - examples_as_sys_msg: true - use_temperature: false - editor_model_name: openrouter/openai/gpt-4.1 - editor_edit_format: editor-diff - system_prompt_prefix: 'Formatting re-enabled. ' - accepts_settings: - - reasoning_effort - -- name: openrouter/openrouter/optimus-alpha - edit_format: diff - use_repo_map: true - examples_as_sys_msg: true - -- name: openrouter/openrouter/quasar-alpha - edit_format: diff - use_repo_map: true - examples_as_sys_msg: true - -- name: openrouter/qwen/qwen-2.5-coder-32b-instruct - edit_format: diff - weak_model_name: openrouter/qwen/qwen-2.5-coder-32b-instruct - use_repo_map: true - editor_model_name: openrouter/qwen/qwen-2.5-coder-32b-instruct - editor_edit_format: editor-diff - -- name: openrouter/x-ai/grok-3-beta - edit_format: diff - use_repo_map: true - -- name: openrouter/x-ai/grok-3-fast-beta - edit_format: diff - use_repo_map: true - -- name: openrouter/x-ai/grok-3-mini-beta - use_repo_map: true - accepts_settings: - - reasoning_effort - -- name: openrouter/x-ai/grok-3-mini-fast-beta - use_repo_map: true - accepts_settings: - - reasoning_effort - -- name: openrouter/x-ai/grok-4 - edit_format: diff - use_repo_map: true - accepts_settings: - - reasoning_effort - -- name: us.anthropic.claude-opus-4-20250514-v1:0 - edit_format: diff - weak_model_name: us.anthropic.claude-3-5-haiku-20241022-v1:0 - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 32000 - cache_control: true - editor_model_name: us.anthropic.claude-sonnet-4-20250514-v1:0 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: us.anthropic.claude-sonnet-4-20250514-v1:0 - edit_format: diff - weak_model_name: us.anthropic.claude-3-5-haiku-20241022-v1:0 - use_repo_map: true - extra_params: - extra_headers: - anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25,output-128k-2025-02-19 - max_tokens: 64000 - cache_control: true - editor_model_name: us.anthropic.claude-sonnet-4-20250514-v1:0 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: vertex_ai/claude-3-5-haiku@20241022 - edit_format: diff - weak_model_name: vertex_ai/claude-3-5-haiku@20241022 - use_repo_map: true - extra_params: - max_tokens: 4096 - -- name: vertex_ai/claude-3-5-sonnet-v2@20241022 - edit_format: diff - weak_model_name: vertex_ai/claude-3-5-haiku@20241022 - use_repo_map: true - examples_as_sys_msg: true - extra_params: - max_tokens: 8192 - editor_model_name: vertex_ai/claude-3-5-sonnet-v2@20241022 - editor_edit_format: editor-diff - -- name: vertex_ai/claude-3-5-sonnet@20240620 - edit_format: diff - weak_model_name: vertex_ai/claude-3-5-haiku@20241022 - use_repo_map: true - examples_as_sys_msg: true - extra_params: - max_tokens: 8192 - editor_model_name: vertex_ai/claude-3-5-sonnet@20240620 - editor_edit_format: editor-diff - -- name: vertex_ai/claude-3-7-sonnet@20250219 - edit_format: diff - weak_model_name: vertex_ai/claude-3-5-haiku@20241022 - use_repo_map: true - overeager: true - examples_as_sys_msg: true - extra_params: - max_tokens: 64000 - editor_model_name: vertex_ai/claude-3-7-sonnet@20250219 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: vertex_ai/claude-3-7-sonnet@20250219 - edit_format: diff - weak_model_name: vertex_ai/claude-3-5-haiku@20241022 - use_repo_map: true - overeager: true - examples_as_sys_msg: true - extra_params: - max_tokens: 64000 - editor_model_name: vertex_ai/claude-3-7-sonnet@20250219 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: vertex_ai/claude-3-opus@20240229 - edit_format: diff - weak_model_name: vertex_ai/claude-3-5-haiku@20241022 - use_repo_map: true - -- name: vertex_ai/claude-3-sonnet@20240229 - weak_model_name: vertex_ai/claude-3-5-haiku@20241022 - -- name: vertex_ai/claude-opus-4@20250514 - edit_format: diff - weak_model_name: vertex_ai/claude-3-5-haiku@20241022 - use_repo_map: true - extra_params: - max_tokens: 32000 - editor_model_name: vertex_ai/claude-sonnet-4@20250514 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: vertex_ai/claude-opus-4@20250514 - edit_format: diff - weak_model_name: vertex_ai/claude-3-5-haiku@20241022 - use_repo_map: true - extra_params: - max_tokens: 32000 - editor_model_name: vertex_ai/claude-sonnet-4@20250514 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: vertex_ai/claude-sonnet-4@20250514 - edit_format: diff - weak_model_name: vertex_ai/claude-3-5-haiku@20241022 - use_repo_map: true - extra_params: - max_tokens: 64000 - editor_model_name: vertex_ai/claude-sonnet-4@20250514 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: vertex_ai/claude-sonnet-4@20250514 - edit_format: diff - weak_model_name: vertex_ai/claude-3-5-haiku@20241022 - use_repo_map: true - extra_params: - max_tokens: 64000 - editor_model_name: vertex_ai/claude-sonnet-4@20250514 - editor_edit_format: editor-diff - accepts_settings: - - thinking_tokens - -- name: vertex_ai/gemini-2.5-flash - edit_format: diff-fenced - use_repo_map: true - overeager: true - accepts_settings: - - thinking_tokens - -- name: vertex_ai/gemini-2.5-flash-preview-04-17 - edit_format: diff - use_repo_map: true - accepts_settings: - - reasoning_effort - - thinking_tokens - -- name: vertex_ai/gemini-2.5-flash-preview-05-20 - edit_format: diff - use_repo_map: true - accepts_settings: - - reasoning_effort - - thinking_tokens - -- name: vertex_ai/gemini-2.5-pro - edit_format: diff-fenced - weak_model_name: vertex_ai/gemini-2.5-flash - use_repo_map: true - overeager: true - editor_model_name: vertex_ai/gemini-2.5-flash - accepts_settings: - - thinking_tokens - -- name: vertex_ai/gemini-2.5-pro-exp-03-25 - edit_format: diff-fenced - weak_model_name: vertex_ai/gemini-2.5-flash-preview-04-17 - use_repo_map: true - overeager: true - editor_model_name: vertex_ai/gemini-2.5-flash-preview-04-17 - -- name: vertex_ai/gemini-2.5-pro-preview-03-25 - edit_format: diff-fenced - weak_model_name: vertex_ai/gemini-2.5-flash-preview-04-17 - use_repo_map: true - overeager: true - editor_model_name: vertex_ai/gemini-2.5-flash-preview-04-17 - -- name: vertex_ai/gemini-2.5-pro-preview-05-06 - edit_format: diff-fenced - weak_model_name: vertex_ai/gemini-2.5-flash-preview-04-17 - use_repo_map: true - overeager: true - editor_model_name: vertex_ai/gemini-2.5-flash-preview-04-17 - -- name: vertex_ai/gemini-2.5-pro-preview-06-05 - edit_format: diff-fenced - weak_model_name: vertex_ai/gemini-2.5-flash-preview-04-17 - use_repo_map: true - overeager: true - editor_model_name: vertex_ai/gemini-2.5-flash-preview-04-17 - accepts_settings: - - thinking_tokens - -- name: vertex_ai/gemini-3-pro-preview - edit_format: diff-fenced - weak_model_name: vertex_ai/gemini-2.5-flash - use_repo_map: true - overeager: true - editor_model_name: vertex_ai/gemini-2.5-flash - accepts_settings: - - thinking_tokens - -- name: xai/grok-3-beta - edit_format: diff - use_repo_map: true - -- name: xai/grok-3-fast-beta - edit_format: diff - use_repo_map: true - -- name: xai/grok-3-mini-beta - use_repo_map: true - accepts_settings: - - reasoning_effort - -- name: xai/grok-3-mini-fast-beta - use_repo_map: true - accepts_settings: - - reasoning_effort - -- name: xai/grok-4 - edit_format: diff - use_repo_map: true - accepts_settings: - - reasoning_effort ``` - - - diff --git a/cecli/website/docs/config/agent-mode.md b/cecli/website/docs/config/agent-mode.md index eec538e6ceb..29251e3ff91 100644 --- a/cecli/website/docs/config/agent-mode.md +++ b/cecli/website/docs/config/agent-mode.md @@ -144,7 +144,7 @@ Arguments: {} ### Agent Configuration Agent Mode can be configured using the `--agent-config` command line argument, which accepts a JSON string for fine-grained control over tool availability and behavior. -Agent Mode can also be configured directly in your configuration file. See the [Complete Configuration Example](#complete-configuration-example) below for a full reference. +Agent Mode can also be configured directly in your configuration file. See the [Complete Configuration Example](#agent-mode-how-agent-mode-works-agent-configuration-complete-configuration-example) below for a full reference. #### Configuration Options @@ -168,12 +168,11 @@ Agent Mode can also be configured directly in your configuration file. See the [ - **`orchestration`**: A nested configuration object for the Orchestrate tool's Python sandbox. When absent or empty, the sandbox runs with default restrictions. See [Orchestration - Configuration](#orchestration-configuration) below for details. + Configuration](#agent-mode-how-agent-mode-works-agent-configuration-orchestration-configuration) below for details. #### Orchestration Configuration -The `Orchestrate` tool runs user code in a secure Python sandbox with the following -restrictions: +The `Orchestrate` tool runs user code in a secure Python sandbox with the following restrictions: - **No imports** — only pre-imported modules (`re`, `math`, `itertools`, `collections`, `datetime`, `traceback`, `json`, `pathlib`) are available - **No private/dunder access** — attributes starting with `_` are blocked diff --git a/cecli/website/docs/config/api-keys.md b/cecli/website/docs/config/api-keys.md index 5759bc96ca3..23b30ca36c9 100644 --- a/cecli/website/docs/config/api-keys.md +++ b/cecli/website/docs/config/api-keys.md @@ -6,7 +6,7 @@ description: Setting API keys for API providers. # API Keys -cecli lets you specify API keys in a few ways: +Cecli lets you specify API keys in a few ways: - On the command line - As environment variables @@ -17,23 +17,16 @@ cecli lets you specify API keys in a few ways: ## OpenAI and Anthropic -cecli has special support for providing -OpenAI and Anthropic API keys -via dedicated switches and configuration options. -Settings keys for other providers works a bit differently, see below. +Cecli has special support for providing OpenAI and Anthropic API keys via dedicated switches and configuration options. Settings keys for other providers works a bit differently, see below. #### Command line -You can set OpenAI and Anthropic API keys via -[command line switches](/docs/config/options.html#api-keys-and-settings) -`--openai-api-key` and `--anthropic-api-key`. +You can set OpenAI and Anthropic API keys via [command line switches](options.html#options-reference-api-keys-and-settings) `--openai-api-key` and `--anthropic-api-key`. #### Environment variables or .env file -You can also store them in environment variables or a -[.env file](/docs/config/dotenv.html), which also works -for every API provider: +You can also store them in environment variables or a [.env file](dotenv.html), which also works for every API provider: ``` OPENAI_API_KEY= @@ -41,8 +34,7 @@ ANTHROPIC_API_KEY= ``` #### YAML config file -You can also set those API keys via special entries in the -[YAML config file](/docs/config/cecli_conf.html), like this: +You can also set those API keys via special entries in the [YAML config file](conf.html), like this: ```yaml openai-api-key: @@ -57,16 +49,12 @@ anthropic-api-key: All other LLM providers can use one of these other methods to set their API keys. #### Command line -{: .no_toc } Use `--api-key provider=` which has the effect of setting the environment variable `PROVIDER_API_KEY=`. So `--api-key gemini=xxx` would set `GEMINI_API_KEY=xxx`. #### Environment variables or .env file -{: .no_toc } -You can set API keys in environment variables. -The [.env file](/docs/config/dotenv.html) -is a great place to store your API keys and other provider API environment variables: +You can set API keys in environment variables. The [.env file](dotenv.html) is a great place to store your API keys and other provider API environment variables: ```bash GEMINI_API_KEY=foo @@ -77,9 +65,7 @@ DEEPSEEK_API_KEY=baz #### YAML config file -You can also set API keys in the -[`.cecli.conf.yml` file](/docs/config/cecli_conf.html) -via the `api-key` entry: +You can also set API keys in the [`.cecli.conf.yml` file](conf.html) via the `api-key` entry: ``` api-key: @@ -87,4 +73,3 @@ api-key: - openrouter=bar # Sets env var OPENROUTER_API_KEY=bar - deepseek=baz # Sets env var DEEPSEEK_API_KEY=baz ``` - diff --git a/cecli/website/docs/config/api.md b/cecli/website/docs/config/api.md index 7d40c056348..42b4b309f06 100644 --- a/cecli/website/docs/config/api.md +++ b/cecli/website/docs/config/api.md @@ -5,27 +5,19 @@ description: Pseudo-ACP (Agent Client Protocol) WebSocket API for connecting ext --- # Agent Client Protocol (ACP) -{: .no_toc } -cecli includes an optional WebSocket server that broadcasts real-time events -and accepts input from external clients. This enables custom UIs, dashboards, -and integrations to observe and interact with cecli sessions programmatically. +Cecli includes an optional WebSocket server that broadcasts real-time events and accepts input from external clients. This enables custom UIs, dashboards, and integrations to observe and interact with cecli sessions programmatically. -The server implements a **pseudo-ACP (Agent Client Protocol)** JSON-RPC 2.0 -interface. All events (tool calls, streaming, state changes, usage, etc.) -are broadcast as `session/update` notifications matching the ACP v2 spec. +The server implements a **pseudo-ACP (Agent Client Protocol)** JSON-RPC 2.0 interface. All events (tool calls, streaming, state changes, usage, etc.) are broadcast as `session/update` notifications matching the ACP v2 spec. > **Reference:** [ACP v2 — Tool Invocation & Status Reporting]( > https://agentclientprotocol.com/protocol/v2/prompt-lifecycle#5-tool-invocation-and-status-reporting > ) -> The cecli implementation is pseudo-ACP: it follows the general shape of -> ACP session/update notifications but may not cover every edge case of -> the formal specification. +> The cecli implementation is pseudo-ACP: it follows the general shape of ACP session/update notifications but may not cover every edge case of the formal specification. ## Activation -The server is controlled by the `--server-config` flag, which accepts a JSON -or YAML string with the following fields: +The server is controlled by the `--server-config` flag, which accepts a JSON or YAML string with the following fields: ``` cecli --server-config '{"host": "127.0.0.1", "port": 23254}' @@ -59,29 +51,35 @@ websocat ws://127.0.0.1:23254 ## Server → Client Notifications (ACP JSON-RPC) -Core agent lifecycle events are broadcast as **JSON-RPC 2.0 notifications** -with method `session/update`. The envelope looks like: +Core agent lifecycle events are broadcast as **JSON-RPC 2.0 notifications** with method `session/update`. The envelope looks like: ```json -{"jsonrpc": "2.0", "method": "session/update", "params": { - "sessionId": "", - "update": { ... } -}} +{ + "jsonrpc": "2.0", + "method": "session/update", + "params": { + "sessionId": "", + "update": { ... } + } +} ``` -The `update` object contains a `sessionUpdate` discriminator field that -identifies the specific update type: +The `update` object contains a `sessionUpdate` discriminator field that identifies the specific update type: ### State Updates ```json -{"jsonrpc": "2.0", "method": "session/update", "params": { - "sessionId": "", - "update": { - "sessionUpdate": "state_update", - "state": "running" +{ + "jsonrpc": "2.0", + "method": "session/update", + "params": { + "sessionId": "", + "update": { + "sessionUpdate": "state_update", + "state": "running" + } } -}} +} ``` | `state` value | Trigger | @@ -94,48 +92,64 @@ identifies the specific update type: **Thought chunks** (reasoning / thinking content): ```json -{"jsonrpc": "2.0", "method": "session/update", "params": { - "sessionId": "", - "update": { - "sessionUpdate": "agent_thought_chunk", - "messageId": "", - "content": {"type": "text", "text": "..."} +{ + "jsonrpc": "2.0", + "method": "session/update", + "params": { + "sessionId": "", + "update": { + "sessionUpdate": "agent_thought_chunk", + "messageId": "", + "content": { + "type": "text", + "text": "..." + } + } } -}} +} ``` **Message chunks** (final assistant response text): ```json -{"jsonrpc": "2.0", "method": "session/update", "params": { - "sessionId": "", - "update": { - "sessionUpdate": "agent_message_chunk", - "messageId": "", - "content": {"type": "text", "text": "..."} +{ + "jsonrpc": "2.0", + "method": "session/update", + "params": { + "sessionId": "", + "update": { + "sessionUpdate": "agent_message_chunk", + "messageId": "", + "content": { + "type": "text", + "text": "..." + } + } } -}} +} ``` -The bridge classifies each `stream_chunk` signal as "thought", "message", -or "mixed" by detecting `---------` (REASONING_START) / `----` (REASONING_END) -markers in the text. +The bridge classifies each `stream_chunk` signal as "thought", "message", or "mixed" by detecting `---------` (REASONING_START) / `----` (REASONING_END) markers in the text. ### Tool Call Updates **Tool call started** (status `"in_progress"`): ```json -{"jsonrpc": "2.0", "method": "session/update", "params": { - "sessionId": "", - "update": { - "sessionUpdate": "tool_call_update", - "toolCallId": "", - "status": "in_progress", - "title": "ReadFile(api.md)", - "kind": "read" +{ + "jsonrpc": "2.0", + "method": "session/update", + "params": { + "sessionId": "", + "update": { + "sessionUpdate": "tool_call_update", + "toolCallId": "", + "status": "in_progress", + "title": "ReadFile(api.md)", + "kind": "read" + } } -}} +} ``` | `kind` value | Detected from | @@ -148,14 +162,21 @@ markers in the text. **Tool call content streaming** (one or more chunks): ```json -{"jsonrpc": "2.0", "method": "session/update", "params": { - "sessionId": "", - "update": { - "sessionUpdate": "tool_call_content_chunk", - "toolCallId": "", - "content": {"type": "text", "text": "..."} +{ + "jsonrpc": "2.0", + "method": "session/update", + "params": { + "sessionId": "", + "update": { + "sessionUpdate": "tool_call_content_chunk", + "toolCallId": "", + "content": { + "type": "text", + "text": "..." + } + } } -}} +} ``` > **Note:** The ACP bridge currently sends `content_chunk` updates for every @@ -167,8 +188,7 @@ markers in the text. ## Client → Server Messages (ACP JSON-RPC) -Clients send **JSON-RPC 2.0 requests** for session lifecycle operations. -Each request expects a JSON-RPC response from the server. +Clients send **JSON-RPC 2.0 requests** for session lifecycle operations. Each request expects a JSON-RPC response from the server. ### Initialize @@ -181,16 +201,22 @@ Before using the session, clients should send an `initialize` request: Response: ```json -{"jsonrpc": "2.0", "id": 1, "result": { - "protocolVersion": 2, - "capabilities": {"session": {}}, - "info": { - "name": "cecli", - "title": "CECLI Coding Agent", - "version": "2.0.0" - }, - "authMethods": [] -}} +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "protocolVersion": 2, + "capabilities": { + "session": {} + }, + "info": { + "name": "cecli", + "title": "CECLI Coding Agent", + "version": "2.0.0" + }, + "authMethods": [] + } +} ``` ### Session Lifecycle @@ -216,21 +242,40 @@ Response: Response: ```json -{"jsonrpc": "2.0", "id": 3, "result": { - "sessions": [ - {"sessionId": "", "cwd": "/path", "status": "active", "_meta": {}} - ], - "_meta": {} -}} +{ + "jsonrpc": "2.0", + "id": 3, + "result": { + "sessions": [ + { + "sessionId": "", + "cwd": "/path", + "status": "active", + "_meta": {} + } + ], + "_meta": {} + } +} ``` **Send a prompt (chat message):** ```json -{"jsonrpc": "2.0", "id": 4, "method": "session/prompt", "params": { - "sessionId": "", - "prompt": [{"type": "text", "text": "your message"}] -}} +{ + "jsonrpc": "2.0", + "id": 4, + "method": "session/prompt", + "params": { + "sessionId": "", + "prompt": [ + { + "type": "text", + "text": "your message" + } + ] + } +} ``` Response (immediate acknowledgment): @@ -246,9 +291,14 @@ The server then: **Cancel a session:** ```json -{"jsonrpc": "2.0", "id": 5, "method": "session/cancel", "params": { - "sessionId": "" -}} +{ + "jsonrpc": "2.0", + "id": 5, + "method": "session/cancel", + "params": { + "sessionId": "" + } +} ``` Returns a `state_update(idle, stopReason=cancelled)` notification. @@ -256,9 +306,14 @@ Returns a `state_update(idle, stopReason=cancelled)` notification. **Close a session:** ```json -{"jsonrpc": "2.0", "id": 6, "method": "session/close", "params": { - "sessionId": "" -}} +{ + "jsonrpc": "2.0", + "id": 6, + "method": "session/close", + "params": { + "sessionId": "" + } +} ``` Response: `{"jsonrpc": "2.0", "id": 6, "result": {}}` @@ -267,8 +322,7 @@ Response: `{"jsonrpc": "2.0", "id": 6, "result": {}}` ## Example -Using a simple Python script to listen for JSON-RPC notifications and send -prompts: +Using a simple Python script to listen for JSON-RPC notifications and send prompts: ```python import asyncio @@ -308,4 +362,4 @@ async def listen(): print(f"\n[STATE] {update['state']}") asyncio.run(listen()) -``` \ No newline at end of file +``` diff --git a/cecli/website/docs/config/conf.md b/cecli/website/docs/config/conf.md index 14c69820d03..e254d5019a2 100644 --- a/cecli/website/docs/config/conf.md +++ b/cecli/website/docs/config/conf.md @@ -6,8 +6,7 @@ description: How to configure cecli with a YAML config file. # YAML config file -Most of cecli's options can be set in an `.cecli.conf.yml` file. -cecli will look for a this file in these locations: +Most of cecli's options can be set in an `.cecli.conf.yml` file. cecli will look for a this file in these locations: - Your home directory. - The root of your git repo. @@ -17,7 +16,8 @@ If the files above exist, they will be loaded in that order. Files loaded last w You can also specify the `--config ` parameter, which will only load the one config file. -{% include keys.md %} +> **Tip:** +> See the [API key configuration docs](api-keys.html) for information on how to configure and store your API keys. ## A note on lists @@ -151,7 +151,6 @@ skills-includelist: # Result: ["skill-a", "skill-b", "skill-c"] (skill-b not duplicated) ``` - ``` read: - CONVENTIONS.md @@ -167,19 +166,8 @@ read: [CONVENTIONS.md, anotherfile.txt, thirdfile.py] ## Sample YAML config file -Below is a sample of the YAML config file, which you -can also -[download from GitHub](https://github.com/cecli-dev/cecli/blob/main/cecli/website/assets/sample.cecli.conf.yml). - - +Below is a sample of the YAML config file, which you can also [download from GitHub](https://github.com/cecli-dev/cecli/blob/main/cecli/website/assets/sample.cecli.conf.yml). + ``` ########################################################## # Sample .cecli.conf.yml @@ -639,4 +627,3 @@ cog.outl("```") #shell-completions: xxx ``` - diff --git a/cecli/website/docs/config/dotenv.md b/cecli/website/docs/config/dotenv.md index f987d477701..05eba0961ea 100644 --- a/cecli/website/docs/config/dotenv.md +++ b/cecli/website/docs/config/dotenv.md @@ -6,12 +6,9 @@ description: Using a .env file to store LLM API keys for cecli. # Config with .env -You can use a `.env` file to store API keys and other settings for the -models you use with cecli. -You can also set many general cecli options -in the `.env` file. +You can use a `.env` file to store API keys and other settings for the models you use with cecli. You can also set many general cecli options in the `.env` file. -cecli will look for a `.env` file in these locations: +Cecli will look for a `.env` file in these locations: - Your home directory. - The root of your git repo. @@ -20,23 +17,13 @@ cecli will look for a `.env` file in these locations: If the files above exist, they will be loaded in that order. Files loaded last will take priority. -{% include keys.md %} +> **Tip:** +> See the [API key configuration docs](api-keys.html) for information on how to configure and store your API keys. ## Sample .env file -Below is a sample `.env` file, which you -can also -[download from GitHub](https://github.com/cecli-dev/cecli/blob/main/cecli/website/assets/sample.env). - - +Below is a sample `.env` file, which you can also [download from GitHub](https://github.com/cecli-dev/cecli/blob/main/cecli/website/assets/sample.env). + ``` ########################################################## # Sample cecli .env file. @@ -487,4 +474,3 @@ cog.outl("```") ## Use o1-preview model for the main chat (deprecated, use --model) #CECLI_O1_PREVIEW=false ``` - diff --git a/cecli/website/docs/config/editor.md b/cecli/website/docs/config/editor.md index 5eeb915bf86..0c682b876ce 100644 --- a/cecli/website/docs/config/editor.md +++ b/cecli/website/docs/config/editor.md @@ -6,17 +6,15 @@ description: How to configure a custom editor for cecli's /editor command # Editor configuration -cecli allows you to configure your preferred text editor for use with the `/editor` command. The editor must be capable of running in "blocking mode", meaning the command line will wait until you close the editor before proceeding. +Cecli allows you to configure your preferred text editor for use with the `/editor` command. The editor must be capable of running in "blocking mode", meaning the command line will wait until you close the editor before proceeding. ## Using `--editor` -You can specify the text editor with the `--editor` switch or using -`editor:` in cecli's -[YAML config file](https://cecli.dev/docs/config/cecli_conf.html). +You can specify the text editor with the `--editor` switch or using `editor:` in cecli's [YAML config file](conf.html). ## Environment variables -cecli checks the following environment variables in order to determine which editor to use: +Cecli checks the following environment variables in order to determine which editor to use: 1. `CECLI_EDITOR` 2. `VISUAL` diff --git a/cecli/website/docs/config/hooks.md b/cecli/website/docs/config/hooks.md index 1ac4a32e931..9396ce722c0 100644 --- a/cecli/website/docs/config/hooks.md +++ b/cecli/website/docs/config/hooks.md @@ -121,10 +121,7 @@ hooks: ## Hook Helpers -The ``HookHelpers`` class provides a higher-level API for writing Python hooks. -All helpers are accessed through a single import — ``from cecli.hooks import HookHelpers`` — -giving you convenient access to conversation history, model calls, and sub-agent -invocation from within any hook's ``execute()`` method. +The ``HookHelpers`` class provides a higher-level API for writing Python hooks. All helpers are accessed through a single import — ``from cecli.hooks import HookHelpers`` — giving you convenient access to conversation history, model calls, and sub-agent invocation from within any hook's ``execute()`` method. ```python from cecli.hooks import BaseHook, HookHelpers @@ -152,8 +149,7 @@ class MyHook(BaseHook): ### get_messages(coder, last_n=None, tag=None, reload=False) -Retrieve messages from the agent's conversation history as a list of message -dicts (``{"role": …, "content": …}``). +Retrieve messages from the agent's conversation history as a list of message dicts (``{"role": …, "content": …}``). | Parameter | Description | |-----------|-------------| @@ -164,8 +160,7 @@ dicts (``{"role": …, "content": …}``). ### append_message(coder, message_dict, tag="cur", **kwargs) -Append a message to the agent's conversation history. The message will be -visible to the LLM on the next turn. Returns the ``BaseMessage`` instance. +Append a message to the agent's conversation history. The message will be visible to the LLM on the next turn. Returns the ``BaseMessage`` instance. | Parameter | Description | |-----------|-------------| @@ -176,8 +171,7 @@ visible to the LLM on the next turn. Returns the ``BaseMessage`` instance. ### call(coder, messages=None, prompt=None, system=None, model_name=None, max_tokens=None, **kwargs) -Make a language model generation call (async). You can either pass a pre-built -``messages`` list, or use ``prompt`` with an optional ``system`` preamble. +Make a language model generation call (async). You can either pass a pre-built ``messages`` list, or use ``prompt`` with an optional ``system`` preamble. | Parameter | Description | |-----------|-------------| @@ -191,8 +185,7 @@ Make a language model generation call (async). You can either pass a pre-built ### call_subagent(coder, name, prompt, **kwargs) -Invoke a registered sub-agent by name (async, blocking by default). Returns -the sub-agent's summary string, or ``None`` on failure. +Invoke a registered sub-agent by name (async, blocking by default). Returns the sub-agent's summary string, or ``None`` on failure. | Parameter | Description | |-----------|-------------| diff --git a/cecli/website/docs/config/mcp.md b/cecli/website/docs/config/mcp.md index 5de4e1dd493..9bd5e516673 100644 --- a/cecli/website/docs/config/mcp.md +++ b/cecli/website/docs/config/mcp.md @@ -10,9 +10,7 @@ Model Context Protocol (MCP) servers extend cecli's capabilities by providing ad ## Configuring MCP Servers -cecli supports configuring MCP servers using the MCP Server Configuration schema. Please -see the [Model Context Protocol documentation](https://modelcontextprotocol.io/introduction) -for more information. +Cecli supports configuring MCP servers using the MCP Server Configuration schema. Please see the [Model Context Protocol documentation](https://modelcontextprotocol.io/introduction) for more information. ### Keepalive Mechanism @@ -34,7 +32,7 @@ mcp-servers: You have two ways of sharing your MCP server configuration with cecli. -{: .note } + > Today, CECLI/Cecli supports connecting to MCP servers using stdio, http, and sse transports. @@ -77,9 +75,7 @@ mcp-servers-file: /path/to/mcp.json These options are configurable in any of cecli's config file formats. -Also, you are able to say if you would like an mcp enabled/disabled in the config itself via `"enabled"` key -By default MCP servers are enabled, so you MUST explicitly disable them in the config if you dont wish -for them to be included when cecli starts up +Also, you are able to say if you would like an mcp enabled/disabled in the config itself via `"enabled"` key By default MCP servers are enabled, so you MUST explicitly disable them in the config if you dont wish for them to be included when cecli starts up ### Flags @@ -149,8 +145,7 @@ Here are some commonly used MCP servers that can enhance cecli's capabilities: ### Chrome DevTools -Chrome DevTools MCP provides browser automation and debugging capabilities through Chrome's DevTools Protocol, enabling web page interaction, network monitoring, and performance analysis. It connects to a running Chrome instance and offers tools for web development testing and automation. Note: the configuration below requires you to start chrome with remote debugging enabled before -starting the coding agent. +Chrome DevTools MCP provides browser automation and debugging capabilities through Chrome's DevTools Protocol, enabling web page interaction, network monitoring, and performance analysis. It connects to a running Chrome instance and offers tools for web development testing and automation. Note: the configuration below requires you to start chrome with remote debugging enabled before starting the coding agent. ```yaml mcp-servers: @@ -250,4 +245,4 @@ mcp-servers: # url: https://api.you.com/mcp # headers: # Authorization: "Bearer " -``` \ No newline at end of file +``` diff --git a/cecli/website/docs/config/model-aliases.md b/cecli/website/docs/config/model-aliases.md index a4e137b3209..c2bdd1db7a5 100644 --- a/cecli/website/docs/config/model-aliases.md +++ b/cecli/website/docs/config/model-aliases.md @@ -13,21 +13,20 @@ Model aliases allow you to create shorthand names for models you frequently use. You can define aliases when launching cecli using the `--alias` option: ```bash -cecli --alias "fast:gpt-5-mini" --alias "smart:o3-mini" +cecli --alias "fast:gpt-5-mini" --alias "smart:anthropic/claude-opus-5" ``` Multiple aliases can be defined by using the `--alias` option multiple times. Each alias definition should be in the format `alias:model-name`. ## Configuration File -Of course, -you can also define aliases in your [`.cecli.conf.yml` file](https://cecli.dev/docs/config/cecli_conf.html): +Of course, you can also define aliases in your [`.cecli.conf.yml` file](conf.html): ```yaml alias: - "fast:gpt-5-mini" - - "smart:o3-mini" - - "hacker:claude-3-sonnet-20240229" + - "smart:anthropic/claude-opus-5" + - "hacker:moonshotai/kimi-k3" ``` ## Using Aliases @@ -36,66 +35,31 @@ Once defined, you can use the alias instead of the full model name from the comm ```bash cecli --model fast # Uses gpt-5-mini -cecli --model smart # Uses o3-mini +cecli --model smart # Uses anthropic/claude-opus-5 ``` Or with the `/model` command in-chat: ``` -cecli v0.75.3 -Main model: anthropic/claude-3-7-sonnet-20250219 with diff edit format, prompt cache, infinite output -Weak model: claude-3-5-sonnet-20241022 +cecli v1.0.0 +Main model: moonshotai/kimi-k3 with diff edit format, prompt cache, infinite output +Weak model: gpt-5.6-luna Git repo: .git with 406 files Repo-map: using 4096 tokens, files refresh ───────────────────────────────────────────────────────────────────────────────────────────────────── > /model fast -cecli v0.75.3 +cecli v1.0.0 Main model: gpt-5-mini with diff edit format ───────────────────────────────────────────────────────────────────────────────────────────────────── diff> /model smart -cecli v0.75.3 -Main model: o3-mini with diff edit format +cecli v1.0.0 +Main model: anthropic/claude-opus-5 with diff edit format ───────────────────────────────────────────────────────────────────────────────────────────────────── > ``` -## Built-in Aliases - -cecli includes some built-in aliases for convenience: - - -- `3`: gpt-3.5-turbo -- `35-turbo`: gpt-3.5-turbo -- `35turbo`: gpt-3.5-turbo -- `4`: gpt-4-0613 -- `4-turbo`: gpt-4-1106-preview -- `4o`: gpt-4o -- `5`: gpt-5 -- `deepseek`: deepseek/deepseek-chat -- `flash`: gemini/gemini-2.5-flash -- `flash-lite`: gemini/gemini-2.5-flash-lite -- `gemini`: gemini/gemini-3-pro-preview -- `gemini-2.5-pro`: gemini/gemini-2.5-pro -- `gemini-3-pro-preview`: gemini/gemini-3-pro-preview -- `gemini-exp`: gemini/gemini-2.5-pro-exp-03-25 -- `grok3`: xai/grok-3-beta -- `haiku`: claude-3-5-haiku-20241022 -- `optimus`: openrouter/openrouter/optimus-alpha -- `opus`: claude-opus-4-20250514 -- `quasar`: openrouter/openrouter/quasar-alpha -- `r1`: deepseek/deepseek-reasoner -- `sonnet`: anthropic/claude-sonnet-4-20250514 - - - ## Priority If the same alias is defined in multiple places, the priority is: diff --git a/cecli/website/docs/config/model-configuration.md b/cecli/website/docs/config/model-configuration.md index 301b199c6af..641d8822923 100644 --- a/cecli/website/docs/config/model-configuration.md +++ b/cecli/website/docs/config/model-configuration.md @@ -6,7 +6,7 @@ description: Configure model overrides, alias-based suffixes, and structured ove ## Model Configuration & Overrides -CECLI allows you to customize and override LLM configurations to fine-tune their behavior, API parameters, and metadata. You can organize these overrides into three logical configuration groups, and apply them either as **defaults** (by model name) or via **suffixes** (e.g., `gpt-5:high`). +Cecli allows you to customize and override LLM configurations to fine-tune their behavior, API parameters, and metadata. You can organize these overrides into three logical configuration groups, and apply them either as **defaults** (by model name) or via **suffixes** (e.g., `gpt-5:high`). --- @@ -15,15 +15,18 @@ CECLI allows you to customize and override LLM configurations to fine-tune their For advanced configurations, you can organize override parameters into three logical groups: `api`, `llm`, and `agent`. ### 1. `api` Values under `api` are merged directly into the model's API request parameters (`headers`). This is useful for configuring provider-specific API options, temperature, or custom headers. For the full list of supported parameters, see the [LiteLLM completion input documentation](https://docs.litellm.ai/docs/completion/input). -- **Common parameters**: `temperature`, `top_p`, `max_tokens`, `parallel_tool_calls`, `extra_body` (e.g., `thinking: true` or `reasoning_effort: "high"`). + +**Common parameters**: `temperature`, `top_p`, `max_tokens`, `parallel_tool_calls`, `extra_body` (e.g., `thinking: true` or `reasoning_effort: "high"`). ### 2. `llm` Values under `llm` are merged into the model's info dictionary (`self.info`). This allows you to override or augment model metadata and capabilities. For a comprehensive list of available model metadata fields, see the [LiteLLM model prices and context window reference](https://github.com/BerriAI/litellm/blob/litellm_internal_staging/model_prices_and_context_window.json). -- **Common parameters**: `supports_vision`, `supports_function_calling`, token limits, or pricing information. + +**Common parameters**: `supports_vision`, `supports_function_calling`, token limits, or pricing information. ### 3. `agent` Values under `agent` modify CECLI's internal `ModelSettings` fields. This controls how CECLI interacts with the model and manages the workspace. For all supported fields, the `ModelSettings` class in [models.py](https://github.com/cecli-dev/cecli/blob/main/cecli/models.py) contains the most comprehensive list. -- **Common parameters**: `edit_format`, `use_repo_map`, `cache_control`, `caches_by_default`. + +**Common parameters**: `edit_format`, `use_repo_map`, `cache_control`, `caches_by_default`. --- @@ -128,5 +131,4 @@ When resolving model configurations, CECLI applies overrides in the following or ### Alias Resolution If you use a model alias (e.g., `fast` as an alias for `gpt-5-mini`), the alias is resolved to the base model name **before** any suffixes or overrides are applied. -For example: -- `cecli --model fast:high` resolves `fast` to `gpt-5-mini`, then applies the `high` suffix overrides defined for `gpt-5-mini`. +For example, `cecli --model fast:high` resolves `fast` to `gpt-5-mini`, then applies the `high` suffix overrides defined for `gpt-5-mini`. diff --git a/cecli/website/docs/config/model-providers.md b/cecli/website/docs/config/model-providers.md index 9fd85477d0f..24723af0359 100644 --- a/cecli/website/docs/config/model-providers.md +++ b/cecli/website/docs/config/model-providers.md @@ -142,7 +142,7 @@ This will prefix model names with `hf:` (e.g., `hf:meta-llama/Llama-2-7b`). ## Built-in Providers -cecli ships with several built-in providers defined in `providers.json`. These are automatically available without any configuration: +Cecli ships with several built-in providers defined in `providers.json`. These are automatically available without any configuration: | Provider | Slug | API Base | |----------|------|----------| diff --git a/cecli/website/docs/config/options.md b/cecli/website/docs/config/options.md index 8ffee14d05b..def01d1c0f2 100644 --- a/cecli/website/docs/config/options.md +++ b/cecli/website/docs/config/options.md @@ -5,22 +5,15 @@ description: Details about all of cecli's settings. --- # Options reference -{: .no_toc } -You can use `cecli --help` to see all the available options, -or review them below. +You can use `cecli --help` to see all the available options, or review them below. -- TOC -{:toc} -{% include keys.md %} +> **Tip:** +> See the [API key configuration docs](api-keys.html) for information on how to configure and store your API keys. ## Usage summary - ``` usage: cecli [-h] [--model] [--openai-api-key] [--anthropic-api-key] [--openai-api-base] [--openai-api-type] @@ -99,546 +92,366 @@ usage: cecli [-h] [--model] [--openai-api-key] [--anthropic-api-key] ## options: ### `--help` -show this help message and exit -Aliases: +show this help message and exit Aliases: - `-h` - `--help` ## Main model: ### `--model MODEL` -Specify the model to use for the main chat -Environment variable: `CECLI_MODEL` +Specify the model to use for the main chat Environment variable: `CECLI_MODEL` ## API Keys and settings: ### `--openai-api-key VALUE` -Specify the OpenAI API key -Environment variable: `CECLI_OPENAI_API_KEY` +Specify the OpenAI API key Environment variable: `CECLI_OPENAI_API_KEY` ### `--anthropic-api-key VALUE` -Specify the Anthropic API key -Environment variable: `CECLI_ANTHROPIC_API_KEY` +Specify the Anthropic API key Environment variable: `CECLI_ANTHROPIC_API_KEY` ### `--openai-api-base VALUE` -Specify the api base url -Environment variable: `CECLI_OPENAI_API_BASE` +Specify the api base url Environment variable: `CECLI_OPENAI_API_BASE` ### `--openai-api-type VALUE` -(deprecated, use --set-env OPENAI_API_TYPE=) -Environment variable: `CECLI_OPENAI_API_TYPE` +(deprecated, use --set-env OPENAI_API_TYPE=) Environment variable: `CECLI_OPENAI_API_TYPE` ### `--openai-api-version VALUE` -(deprecated, use --set-env OPENAI_API_VERSION=) -Environment variable: `CECLI_OPENAI_API_VERSION` +(deprecated, use --set-env OPENAI_API_VERSION=) Environment variable: `CECLI_OPENAI_API_VERSION` ### `--openai-api-deployment-id VALUE` -(deprecated, use --set-env OPENAI_API_DEPLOYMENT_ID=) -Environment variable: `CECLI_OPENAI_API_DEPLOYMENT_ID` +(deprecated, use --set-env OPENAI_API_DEPLOYMENT_ID=) Environment variable: `CECLI_OPENAI_API_DEPLOYMENT_ID` ### `--openai-organization-id VALUE` -(deprecated, use --set-env OPENAI_ORGANIZATION=) -Environment variable: `CECLI_OPENAI_ORGANIZATION_ID` +(deprecated, use --set-env OPENAI_ORGANIZATION=) Environment variable: `CECLI_OPENAI_ORGANIZATION_ID` ### `--set-env ENV_VAR_NAME=value` -Set an environment variable (to control API settings, can be used multiple times) -Default: [] -Environment variable: `CECLI_SET_ENV` +Set an environment variable (to control API settings, can be used multiple times) Default: [] Environment variable: `CECLI_SET_ENV` ### `--api-key PROVIDER=KEY` -Set an API key for a provider (eg: --api-key provider= sets PROVIDER_API_KEY=) -Default: [] -Environment variable: `CECLI_API_KEY` +Set an API key for a provider (eg: --api-key provider= sets PROVIDER_API_KEY=) Default: [] Environment variable: `CECLI_API_KEY` ## Model settings: ### `--list-models MODEL` -List known models which match the (partial) MODEL name -Environment variable: `CECLI_LIST_MODELS` -Aliases: +List known models which match the (partial) MODEL name Environment variable: `CECLI_LIST_MODELS` Aliases: - `--list-models MODEL` - `--models MODEL` ### `--model-settings-file MODEL_SETTINGS_FILE` -Specify a file with cecli model settings for unknown models -Default: .cecli.model.settings.yml -Environment variable: `CECLI_MODEL_SETTINGS_FILE` +Specify a file with cecli model settings for unknown models Default: .cecli.model.settings.yml Environment variable: `CECLI_MODEL_SETTINGS_FILE` ### `--model-metadata-file MODEL_METADATA_FILE` -Specify a file with context window and costs for unknown models -Default: .cecli.model.metadata.json -Environment variable: `CECLI_MODEL_METADATA_FILE` +Specify a file with context window and costs for unknown models Default: .cecli.model.metadata.json Environment variable: `CECLI_MODEL_METADATA_FILE` ### `--alias ALIAS:MODEL` -Add a model alias (can be used multiple times) -Environment variable: `CECLI_ALIAS` +Add a model alias (can be used multiple times) Environment variable: `CECLI_ALIAS` ### `--reasoning-effort VALUE` -Set the reasoning_effort API parameter (default: not set) -Environment variable: `CECLI_REASONING_EFFORT` +Set the reasoning_effort API parameter (default: not set) Environment variable: `CECLI_REASONING_EFFORT` ### `--thinking-tokens VALUE` -Set the thinking token budget for models that support it. Use 0 to disable. (default: not set) -Environment variable: `CECLI_THINKING_TOKENS` +Set the thinking token budget for models that support it. Use 0 to disable. (default: not set) Environment variable: `CECLI_THINKING_TOKENS` ### `--verify-ssl` -Verify the SSL cert when connecting to models (default: True) -Default: True -Environment variable: `CECLI_VERIFY_SSL` -Aliases: +Verify the SSL cert when connecting to models (default: True) Default: True Environment variable: `CECLI_VERIFY_SSL` Aliases: - `--verify-ssl` - `--no-verify-ssl` ### `--timeout VALUE` -Timeout in seconds for API calls (default: None) -Environment variable: `CECLI_TIMEOUT` +Timeout in seconds for API calls (default: None) Environment variable: `CECLI_TIMEOUT` ### `--edit-format EDIT_FORMAT` -Specify what edit format the LLM should use (default depends on model) -Environment variable: `CECLI_EDIT_FORMAT` -Aliases: +Specify what edit format the LLM should use (default depends on model) Environment variable: `CECLI_EDIT_FORMAT` Aliases: - `--edit-format EDIT_FORMAT` - `--chat-mode EDIT_FORMAT` ### `--architect` -Use architect edit format for the main chat -Environment variable: `CECLI_ARCHITECT` +Use architect edit format for the main chat Environment variable: `CECLI_ARCHITECT` ### `--auto-accept-architect` -Enable/disable automatic acceptance of architect changes (default: True) -Default: True -Environment variable: `CECLI_AUTO_ACCEPT_ARCHITECT` -Aliases: +Enable/disable automatic acceptance of architect changes (default: True) Default: True Environment variable: `CECLI_AUTO_ACCEPT_ARCHITECT` Aliases: - `--auto-accept-architect` - `--no-auto-accept-architect` ### `--weak-model WEAK_MODEL` -Specify the model to use for commit messages and chat history summarization (default depends on --model) -Environment variable: `CECLI_WEAK_MODEL` +Specify the model to use for commit messages and chat history summarization (default depends on --model) Environment variable: `CECLI_WEAK_MODEL` ### `--editor-model EDITOR_MODEL` -Specify the model to use for editor tasks (default depends on --model) -Environment variable: `CECLI_EDITOR_MODEL` +Specify the model to use for editor tasks (default depends on --model) Environment variable: `CECLI_EDITOR_MODEL` ### `--editor-edit-format EDITOR_EDIT_FORMAT` -Specify the edit format for the editor model (default: depends on editor model) -Environment variable: `CECLI_EDITOR_EDIT_FORMAT` +Specify the edit format for the editor model (default: depends on editor model) Environment variable: `CECLI_EDITOR_EDIT_FORMAT` ### `--show-model-warnings` -Only work with models that have meta-data available (default: True) -Default: True -Environment variable: `CECLI_SHOW_MODEL_WARNINGS` -Aliases: +Only work with models that have meta-data available (default: True) Default: True Environment variable: `CECLI_SHOW_MODEL_WARNINGS` Aliases: - `--show-model-warnings` - `--no-show-model-warnings` ### `--check-model-accepts-settings` -Check if model accepts settings like reasoning_effort/thinking_tokens (default: True) -Default: True -Environment variable: `CECLI_CHECK_MODEL_ACCEPTS_SETTINGS` -Aliases: +Check if model accepts settings like reasoning_effort/thinking_tokens (default: True) Default: True Environment variable: `CECLI_CHECK_MODEL_ACCEPTS_SETTINGS` Aliases: - `--check-model-accepts-settings` - `--no-check-model-accepts-settings` ### `--max-chat-history-tokens VALUE` -Soft limit on tokens for chat history, after which summarization begins. If unspecified, defaults to the model's max_chat_history_tokens. -Environment variable: `CECLI_MAX_CHAT_HISTORY_TOKENS` +Soft limit on tokens for chat history, after which summarization begins. If unspecified, defaults to the model's max_chat_history_tokens. Environment variable: `CECLI_MAX_CHAT_HISTORY_TOKENS` ## Context Compaction: ### `--enable-context-compaction` -Enable automatic compaction of chat history to conserve tokens (default: False) -Default: False -Environment variable: `CECLI_ENABLE_CONTEXT_COMPACTION` -Aliases: +Enable automatic compaction of chat history to conserve tokens (default: False) Default: False Environment variable: `CECLI_ENABLE_CONTEXT_COMPACTION` Aliases: - `--enable-context-compaction` - `--no-enable-context-compaction` ### `--context-compaction-max-tokens VALUE` -The maximum number of tokens in the conversation before context compaction is triggered. (default: 80% of model's context window) -Environment variable: `CECLI_CONTEXT_COMPACTION_MAX_TOKENS` +The maximum number of tokens in the conversation before context compaction is triggered. (default: 80% of model's context window) Environment variable: `CECLI_CONTEXT_COMPACTION_MAX_TOKENS` ### `--context-compaction-summary-tokens VALUE` -The target maximum number of tokens for the generated summary. (default: 4096) -Default: 4096 -Environment variable: `CECLI_CONTEXT_COMPACTION_SUMMARY_TOKENS` +The target maximum number of tokens for the generated summary. (default: 4096) Default: 4096 Environment variable: `CECLI_CONTEXT_COMPACTION_SUMMARY_TOKENS` ### `--max-compaction-retries VALUE` -Maximum number of automatic compaction and retry attempts when a context window error occurs (default: 3, range: 1-10). -In agent mode, this is capped at 2 retries for safety. -Default: 3 -Environment variable: `CECLI_MAX_COMPACTION_RETRIES` +Maximum number of automatic compaction and retry attempts when a context window error occurs (default: 3, range: 1-10). In agent mode, this is capped at 2 retries for safety. Default: 3 Environment variable: `CECLI_MAX_COMPACTION_RETRIES` ## Cache settings: ### `--cache-prompts` -Enable caching of prompts (default: False) -Default: False -Environment variable: `CECLI_CACHE_PROMPTS` -Aliases: +Enable caching of prompts (default: False) Default: False Environment variable: `CECLI_CACHE_PROMPTS` Aliases: - `--cache-prompts` - `--no-cache-prompts` ### `--cache-keepalive-pings VALUE` -Number of times to ping at 5min intervals to keep prompt cache warm (default: 0) -Default: 0 -Environment variable: `CECLI_CACHE_KEEPALIVE_PINGS` +Number of times to ping at 5min intervals to keep prompt cache warm (default: 0) Default: 0 Environment variable: `CECLI_CACHE_KEEPALIVE_PINGS` ## Repomap settings: ### `--map-tokens VALUE` -Suggested number of tokens to use for repo map, use 0 to disable -Environment variable: `CECLI_MAP_TOKENS` +Suggested number of tokens to use for repo map, use 0 to disable Environment variable: `CECLI_MAP_TOKENS` ### `--map-refresh VALUE` -Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto) -Default: auto -Environment variable: `CECLI_MAP_REFRESH` +Control how often the repo map is refreshed. Options: auto, always, files, manual (default: auto) Default: auto Environment variable: `CECLI_MAP_REFRESH` ### `--map-multiplier-no-files VALUE` -Multiplier for map tokens when no files are specified (default: 2) -Default: 2 -Environment variable: `CECLI_MAP_MULTIPLIER_NO_FILES` +Multiplier for map tokens when no files are specified (default: 2) Default: 2 Environment variable: `CECLI_MAP_MULTIPLIER_NO_FILES` ### `--map-max-line-length VALUE` -Maximum line length for the repo map code. Prevents sending crazy long lines of minified JS files etc. (default: 100) -Default: 100 -Environment variable: `CECLI_MAP_MAX_LINE_LENGTH` +Maximum line length for the repo map code. Prevents sending crazy long lines of minified JS files etc. (default: 100) Default: 100 Environment variable: `CECLI_MAP_MAX_LINE_LENGTH` ## History Files: ### `--input-history-file INPUT_HISTORY_FILE` -Specify the chat input history file (default: .cecli.input.history) -Default: .cecli.input.history -Environment variable: `CECLI_INPUT_HISTORY_FILE` +Specify the chat input history file (default: .cecli.input.history) Default: .cecli.input.history Environment variable: `CECLI_INPUT_HISTORY_FILE` ### `--chat-history-file CHAT_HISTORY_FILE` -Specify the chat history file (default: .cecli.dev.history.md) -Default: .cecli.dev.history.md -Environment variable: `CECLI_CHAT_HISTORY_FILE` +Specify the chat history file (default: .cecli.dev.history.md) Default: .cecli.dev.history.md Environment variable: `CECLI_CHAT_HISTORY_FILE` ### `--restore-chat-history` -Restore the previous chat history messages (default: False) -Default: False -Environment variable: `CECLI_RESTORE_CHAT_HISTORY` -Aliases: +Restore the previous chat history messages (default: False) Default: False Environment variable: `CECLI_RESTORE_CHAT_HISTORY` Aliases: - `--restore-chat-history` - `--no-restore-chat-history` ### `--llm-history-file LLM_HISTORY_FILE` -Log the conversation with the LLM to this file (for example, .cecli.llm.history) -Environment variable: `CECLI_LLM_HISTORY_FILE` +Log the conversation with the LLM to this file (for example, .cecli.llm.history) Environment variable: `CECLI_LLM_HISTORY_FILE` ## Output settings: ### `--dark-mode` -Use colors suitable for a dark terminal background (default: False) -Default: False -Environment variable: `CECLI_DARK_MODE` +Use colors suitable for a dark terminal background (default: False) Default: False Environment variable: `CECLI_DARK_MODE` ### `--light-mode` -Use colors suitable for a light terminal background (default: False) -Default: False -Environment variable: `CECLI_LIGHT_MODE` +Use colors suitable for a light terminal background (default: False) Default: False Environment variable: `CECLI_LIGHT_MODE` ### `--pretty` -Enable/disable pretty, colorized output (default: True) -Default: True -Environment variable: `CECLI_PRETTY` -Aliases: +Enable/disable pretty, colorized output (default: True) Default: True Environment variable: `CECLI_PRETTY` Aliases: - `--pretty` - `--no-pretty` ### `--stream` -Enable/disable streaming responses (default: True) -Default: True -Environment variable: `CECLI_STREAM` -Aliases: +Enable/disable streaming responses (default: True) Default: True Environment variable: `CECLI_STREAM` Aliases: - `--stream` - `--no-stream` ### `--spinner` -Enable/disable the spinner while waiting for LLM responses (default: True) -Default: True -Environment variable: `CECLI_SPINNER` -Aliases: +Enable/disable the spinner while waiting for LLM responses (default: True) Default: True Environment variable: `CECLI_SPINNER` Aliases: - `--spinner` - `--no-spinner` ### `--user-input-color VALUE` -Set the color for user input (default: #00cc00) -Default: #00cc00 -Environment variable: `CECLI_USER_INPUT_COLOR` +Set the color for user input (default: #00cc00) Default: #00cc00 Environment variable: `CECLI_USER_INPUT_COLOR` ### `--tool-output-color VALUE` -Set the color for tool output (default: None) -Environment variable: `CECLI_TOOL_OUTPUT_COLOR` +Set the color for tool output (default: None) Environment variable: `CECLI_TOOL_OUTPUT_COLOR` ### `--tool-error-color VALUE` -Set the color for tool error messages (default: #FF2222) -Default: #FF2222 -Environment variable: `CECLI_TOOL_ERROR_COLOR` +Set the color for tool error messages (default: #FF2222) Default: #FF2222 Environment variable: `CECLI_TOOL_ERROR_COLOR` ### `--tool-warning-color VALUE` -Set the color for tool warning messages (default: #FFA500) -Default: #FFA500 -Environment variable: `CECLI_TOOL_WARNING_COLOR` +Set the color for tool warning messages (default: #FFA500) Default: #FFA500 Environment variable: `CECLI_TOOL_WARNING_COLOR` ### `--assistant-output-color VALUE` -Set the color for assistant output (default: #0088ff) -Default: #0088ff -Environment variable: `CECLI_ASSISTANT_OUTPUT_COLOR` +Set the color for assistant output (default: #0088ff) Default: #0088ff Environment variable: `CECLI_ASSISTANT_OUTPUT_COLOR` ### `--completion-menu-color COLOR` -Set the color for the completion menu (default: terminal's default text color) -Environment variable: `CECLI_COMPLETION_MENU_COLOR` +Set the color for the completion menu (default: terminal's default text color) Environment variable: `CECLI_COMPLETION_MENU_COLOR` ### `--completion-menu-bg-color COLOR` -Set the background color for the completion menu (default: terminal's default background color) -Environment variable: `CECLI_COMPLETION_MENU_BG_COLOR` +Set the background color for the completion menu (default: terminal's default background color) Environment variable: `CECLI_COMPLETION_MENU_BG_COLOR` ### `--completion-menu-current-color COLOR` -Set the color for the current item in the completion menu (default: terminal's default background color) -Environment variable: `CECLI_COMPLETION_MENU_CURRENT_COLOR` +Set the color for the current item in the completion menu (default: terminal's default background color) Environment variable: `CECLI_COMPLETION_MENU_CURRENT_COLOR` ### `--completion-menu-current-bg-color COLOR` -Set the background color for the current item in the completion menu (default: terminal's default text color) -Environment variable: `CECLI_COMPLETION_MENU_CURRENT_BG_COLOR` +Set the background color for the current item in the completion menu (default: terminal's default text color) Environment variable: `CECLI_COMPLETION_MENU_CURRENT_BG_COLOR` ### `--code-theme VALUE` -Set the markdown code theme (default: default, other options include monokai, solarized-dark, solarized-light, or a Pygments builtin style, see https://pygments.org/styles for available themes) -Default: default -Environment variable: `CECLI_CODE_THEME` +Set the markdown code theme (default: default, other options include monokai, solarized-dark, solarized-light, or a Pygments builtin style, see https://pygments.org/styles for available themes) Default: default Environment variable: `CECLI_CODE_THEME` ### `--show-diffs` -Show diffs when committing changes (default: False) -Default: False -Environment variable: `CECLI_SHOW_DIFFS` +Show diffs when committing changes (default: False) Default: False Environment variable: `CECLI_SHOW_DIFFS` ## Git settings: ### `--git` -Enable/disable looking for a git repo (default: True) -Default: True -Environment variable: `CECLI_GIT` -Aliases: +Enable/disable looking for a git repo (default: True) Default: True Environment variable: `CECLI_GIT` Aliases: - `--git` - `--no-git` ### `--gitignore` -Enable/disable adding .cecli* to .gitignore (default: True) -Default: True -Environment variable: `CECLI_GITIGNORE` -Aliases: +Enable/disable adding .cecli* to .gitignore (default: True) Default: True Environment variable: `CECLI_GITIGNORE` Aliases: - `--gitignore` - `--no-gitignore` ### `--add-gitignore-files` -Enable/disable the addition of files listed in .gitignore to cecli's editing scope. -Default: False -Environment variable: `CECLI_ADD_GITIGNORE_FILES` -Aliases: +Enable/disable the addition of files listed in .gitignore to cecli's editing scope. Default: False Environment variable: `CECLI_ADD_GITIGNORE_FILES` Aliases: - `--add-gitignore-files` - `--no-add-gitignore-files` ### `--cecli-ignore CECLI_IGNORE` -Specify the cecli ignore file (default: .cecli.ignore in git root) -Default: .cecli.ignore -Environment variable: `CECLI_IGNORE` +Specify the cecli ignore file (default: .cecli.ignore in git root) Default: .cecli.ignore Environment variable: `CECLI_IGNORE` ### `--subtree-only` -Only consider files in the current subtree of the git repository -Default: False -Environment variable: `CECLI_SUBTREE_ONLY` +Only consider files in the current subtree of the git repository Default: False Environment variable: `CECLI_SUBTREE_ONLY` ### `--auto-commits` -Enable/disable auto commit of LLM changes (default: True) -Default: True -Environment variable: `CECLI_AUTO_COMMITS` -Aliases: +Enable/disable auto commit of LLM changes (default: True) Default: True Environment variable: `CECLI_AUTO_COMMITS` Aliases: - `--auto-commits` - `--no-auto-commits` ### `--dirty-commits` -Enable/disable commits when repo is found dirty (default: True) -Default: True -Environment variable: `CECLI_DIRTY_COMMITS` -Aliases: +Enable/disable commits when repo is found dirty (default: True) Default: True Environment variable: `CECLI_DIRTY_COMMITS` Aliases: - `--dirty-commits` - `--no-dirty-commits` ### `--attribute-author` -Attribute cecli code changes in the git author name (default: True). If explicitly set to True, overrides --attribute-co-authored-by precedence. -Environment variable: `CECLI_ATTRIBUTE_AUTHOR` -Aliases: +Attribute cecli code changes in the git author name (default: True). If explicitly set to True, overrides --attribute-co-authored-by precedence. Environment variable: `CECLI_ATTRIBUTE_AUTHOR` Aliases: - `--attribute-author` - `--no-attribute-author` ### `--attribute-committer` -Attribute cecli commits in the git committer name (default: True). If explicitly set to True, overrides --attribute-co-authored-by precedence for cecli edits. -Environment variable: `CECLI_ATTRIBUTE_COMMITTER` -Aliases: +Attribute cecli commits in the git committer name (default: True). If explicitly set to True, overrides --attribute-co-authored-by precedence for cecli edits. Environment variable: `CECLI_ATTRIBUTE_COMMITTER` Aliases: - `--attribute-committer` - `--no-attribute-committer` ### `--attribute-commit-message-author` -Prefix commit messages with 'cecli: ' if cecli authored the changes (default: False) -Default: False -Environment variable: `CECLI_ATTRIBUTE_COMMIT_MESSAGE_AUTHOR` -Aliases: +Prefix commit messages with 'cecli: ' if cecli authored the changes (default: False) Default: False Environment variable: `CECLI_ATTRIBUTE_COMMIT_MESSAGE_AUTHOR` Aliases: - `--attribute-commit-message-author` - `--no-attribute-commit-message-author` ### `--attribute-commit-message-committer` -Prefix all commit messages with 'cecli: ' (default: False) -Default: False -Environment variable: `CECLI_ATTRIBUTE_COMMIT_MESSAGE_COMMITTER` -Aliases: +Prefix all commit messages with 'cecli: ' (default: False) Default: False Environment variable: `CECLI_ATTRIBUTE_COMMIT_MESSAGE_COMMITTER` Aliases: - `--attribute-commit-message-committer` - `--no-attribute-commit-message-committer` ### `--attribute-co-authored-by` -Attribute cecli edits using the Co-authored-by trailer in the commit message (default: True). If True, this takes precedence over default --attribute-author and --attribute-committer behavior unless they are explicitly set to True. -Default: True -Environment variable: `CECLI_ATTRIBUTE_CO_AUTHORED_BY` -Aliases: +Attribute cecli edits using the Co-authored-by trailer in the commit message (default: True). If True, this takes precedence over default --attribute-author and --attribute-committer behavior unless they are explicitly set to True. Default: True Environment variable: `CECLI_ATTRIBUTE_CO_AUTHORED_BY` Aliases: - `--attribute-co-authored-by` - `--no-attribute-co-authored-by` ### `--git-commit-verify` -Enable/disable git pre-commit hooks with --no-verify (default: False) -Default: False -Environment variable: `CECLI_GIT_COMMIT_VERIFY` -Aliases: +Enable/disable git pre-commit hooks with --no-verify (default: False) Default: False Environment variable: `CECLI_GIT_COMMIT_VERIFY` Aliases: - `--git-commit-verify` - `--no-git-commit-verify` ### `--commit` -Commit all pending changes with a suitable commit message, then exit -Default: False -Environment variable: `CECLI_COMMIT` +Commit all pending changes with a suitable commit message, then exit Default: False Environment variable: `CECLI_COMMIT` ### `--commit-prompt PROMPT` -Specify a custom prompt for generating commit messages -Environment variable: `CECLI_COMMIT_PROMPT` +Specify a custom prompt for generating commit messages Environment variable: `CECLI_COMMIT_PROMPT` ### `--dry-run` -Perform a dry run without modifying files (default: False) -Default: False -Environment variable: `CECLI_DRY_RUN` -Aliases: +Perform a dry run without modifying files (default: False) Default: False Environment variable: `CECLI_DRY_RUN` Aliases: - `--dry-run` - `--no-dry-run` ### `--skip-sanity-check-repo` -Skip the sanity check for the git repository (default: False) -Default: False -Environment variable: `CECLI_SKIP_SANITY_CHECK_REPO` +Skip the sanity check for the git repository (default: False) Default: False Environment variable: `CECLI_SKIP_SANITY_CHECK_REPO` ### `--watch-files` -Enable/disable watching files for ai coding comments (default: False) -Default: False -Environment variable: `CECLI_WATCH_FILES` -Aliases: +Enable/disable watching files for ai coding comments (default: False) Default: False Environment variable: `CECLI_WATCH_FILES` Aliases: - `--watch-files` - `--no-watch-files` ## Fixing and committing: ### `--lint` -Lint and fix provided files, or dirty files if none provided -Default: False -Environment variable: `CECLI_LINT` +Lint and fix provided files, or dirty files if none provided Default: False Environment variable: `CECLI_LINT` ### `--lint-cmd` -Specify lint commands to run for different languages, eg: "python: flake8 --select=..." (can be used multiple times) -Default: [] -Environment variable: `CECLI_LINT_CMD` +Specify lint commands to run for different languages, eg: "python: flake8 --select=..." (can be used multiple times) Default: [] Environment variable: `CECLI_LINT_CMD` ### `--auto-lint` -Enable/disable automatic linting after changes (default: True) -Default: True -Environment variable: `CECLI_AUTO_LINT` -Aliases: +Enable/disable automatic linting after changes (default: True) Default: True Environment variable: `CECLI_AUTO_LINT` Aliases: - `--auto-lint` - `--no-auto-lint` ### `--test-cmd VALUE` -Specify command to run tests -Default: [] -Environment variable: `CECLI_TEST_CMD` +Specify command to run tests Default: [] Environment variable: `CECLI_TEST_CMD` ### `--auto-test` -Enable/disable automatic testing after changes (default: False) -Default: False -Environment variable: `CECLI_AUTO_TEST` -Aliases: +Enable/disable automatic testing after changes (default: False) Default: False Environment variable: `CECLI_AUTO_TEST` Aliases: - `--auto-test` - `--no-auto-test` ### `--test` -Run tests, fix problems found and then exit -Default: False -Environment variable: `CECLI_TEST` +Run tests, fix problems found and then exit Default: False Environment variable: `CECLI_TEST` ## Analytics: ### `--analytics` -Enable/disable analytics for current session (default: random) -Environment variable: `CECLI_ANALYTICS` -Aliases: +Enable/disable analytics for current session (default: random) Environment variable: `CECLI_ANALYTICS` Aliases: - `--analytics` - `--no-analytics` ### `--analytics-log ANALYTICS_LOG_FILE` -Specify a file to log analytics events -Environment variable: `CECLI_ANALYTICS_LOG` +Specify a file to log analytics events Environment variable: `CECLI_ANALYTICS_LOG` ### `--analytics-disable` -Permanently disable analytics -Default: False -Environment variable: `CECLI_ANALYTICS_DISABLE` +Permanently disable analytics Default: False Environment variable: `CECLI_ANALYTICS_DISABLE` ### `--analytics-posthog-host ANALYTICS_POSTHOG_HOST` -Send analytics to custom PostHog instance -Environment variable: `CECLI_ANALYTICS_POSTHOG_HOST` +Send analytics to custom PostHog instance Environment variable: `CECLI_ANALYTICS_POSTHOG_HOST` ### `--analytics-posthog-project-api-key ANALYTICS_POSTHOG_PROJECT_API_KEY` -Send analytics to custom PostHog project -Environment variable: `CECLI_ANALYTICS_POSTHOG_PROJECT_API_KEY` +Send analytics to custom PostHog project Environment variable: `CECLI_ANALYTICS_POSTHOG_PROJECT_API_KEY` ## Upgrading: ### `--just-check-update` -Check for updates and return status in the exit code -Default: False -Environment variable: `CECLI_JUST_CHECK_UPDATE` +Check for updates and return status in the exit code Default: False Environment variable: `CECLI_JUST_CHECK_UPDATE` ### `--check-update` -Check for new cecli versions on launch -Default: True -Environment variable: `CECLI_CHECK_UPDATE` -Aliases: +Check for new cecli versions on launch Default: True Environment variable: `CECLI_CHECK_UPDATE` Aliases: - `--check-update` - `--no-check-update` ### `--show-release-notes` -Show release notes on first run of new version (default: None, ask user) -Environment variable: `CECLI_SHOW_RELEASE_NOTES` -Aliases: +Show release notes on first run of new version (default: None, ask user) Environment variable: `CECLI_SHOW_RELEASE_NOTES` Aliases: - `--show-release-notes` - `--no-show-release-notes` ### `--install-main-branch` -Install the latest version from the main branch -Default: False -Environment variable: `CECLI_INSTALL_MAIN_BRANCH` +Install the latest version from the main branch Default: False Environment variable: `CECLI_INSTALL_MAIN_BRANCH` ### `--upgrade` -Upgrade cecli to the latest version from PyPI -Default: False -Environment variable: `CECLI_UPGRADE` -Aliases: +Upgrade cecli to the latest version from PyPI Default: False Environment variable: `CECLI_UPGRADE` Aliases: - `--upgrade` - `--update` @@ -648,183 +461,122 @@ Show the version number and exit ## Modes: ### `--message COMMAND` -Specify a single message to send the LLM, process reply then exit (disables chat mode) -Environment variable: `CECLI_MESSAGE` -Aliases: +Specify a single message to send the LLM, process reply then exit (disables chat mode) Environment variable: `CECLI_MESSAGE` Aliases: - `--message COMMAND` - `--msg COMMAND` - `-m COMMAND` ### `--message-file MESSAGE_FILE` -Specify a file containing the message to send the LLM, process reply, then exit (disables chat mode) -Environment variable: `CECLI_MESSAGE_FILE` -Aliases: +Specify a file containing the message to send the LLM, process reply, then exit (disables chat mode) Environment variable: `CECLI_MESSAGE_FILE` Aliases: - `--message-file MESSAGE_FILE` - `-f MESSAGE_FILE` ### `--copy-paste` -Enable automatic copy/paste of chat between cecli and web UI (default: False) -Default: False -Environment variable: `CECLI_COPY_PASTE` -Aliases: +Enable automatic copy/paste of chat between cecli and web UI (default: False) Default: False Environment variable: `CECLI_COPY_PASTE` Aliases: - `--copy-paste` - `--no-copy-paste` ### `--apply FILE` -Apply the changes from the given file instead of running the chat (debug) -Environment variable: `CECLI_APPLY` +Apply the changes from the given file instead of running the chat (debug) Environment variable: `CECLI_APPLY` ### `--apply-clipboard-edits` -Apply clipboard contents as edits using the main model's editor format -Default: False -Environment variable: `CECLI_APPLY_CLIPBOARD_EDITS` +Apply clipboard contents as edits using the main model's editor format Default: False Environment variable: `CECLI_APPLY_CLIPBOARD_EDITS` ### `--exit` -Do all startup activities then exit before accepting user input (debug) -Default: False -Environment variable: `CECLI_EXIT` +Do all startup activities then exit before accepting user input (debug) Default: False Environment variable: `CECLI_EXIT` ### `--show-repo-map` -Print the repo map and exit (debug) -Default: False -Environment variable: `CECLI_SHOW_REPO_MAP` +Print the repo map and exit (debug) Default: False Environment variable: `CECLI_SHOW_REPO_MAP` ### `--show-prompts` -Print the system prompts and exit (debug) -Default: False -Environment variable: `CECLI_SHOW_PROMPTS` +Print the system prompts and exit (debug) Default: False Environment variable: `CECLI_SHOW_PROMPTS` ## Voice settings: ### `--voice-format VOICE_FORMAT` -Audio format for voice recording (default: wav). webm and mp3 require ffmpeg -Default: wav -Environment variable: `CECLI_VOICE_FORMAT` +Audio format for voice recording (default: wav). webm and mp3 require ffmpeg Default: wav Environment variable: `CECLI_VOICE_FORMAT` ### `--voice-language VOICE_LANGUAGE` -Specify the language for voice using ISO 639-1 code (default: auto) -Default: en -Environment variable: `CECLI_VOICE_LANGUAGE` +Specify the language for voice using ISO 639-1 code (default: auto) Default: en Environment variable: `CECLI_VOICE_LANGUAGE` ### `--voice-input-device VOICE_INPUT_DEVICE` -Specify the input device name for voice recording -Environment variable: `CECLI_VOICE_INPUT_DEVICE` +Specify the input device name for voice recording Environment variable: `CECLI_VOICE_INPUT_DEVICE` ## Other settings: ### `--disable-playwright` -Never prompt for or attempt to install Playwright for web scraping (default: False). -Default: False -Environment variable: `CECLI_DISABLE_PLAYWRIGHT` +Never prompt for or attempt to install Playwright for web scraping (default: False). Default: False Environment variable: `CECLI_DISABLE_PLAYWRIGHT` ### `--file FILE` -specify a file to edit (can be used multiple times) -Environment variable: `CECLI_FILE` +specify a file to edit (can be used multiple times) Environment variable: `CECLI_FILE` ### `--read FILE` -specify a read-only file (can be used multiple times) -Environment variable: `CECLI_READ` +specify a read-only file (can be used multiple times) Environment variable: `CECLI_READ` ### `--vim` -Use VI editing mode in the terminal (default: False) -Default: False -Environment variable: `CECLI_VIM` +Use VI editing mode in the terminal (default: False) Default: False Environment variable: `CECLI_VIM` ### `--chat-language CHAT_LANGUAGE` -Specify the language to use in the chat (default: None, uses system settings) -Environment variable: `CECLI_CHAT_LANGUAGE` +Specify the language to use in the chat (default: None, uses system settings) Environment variable: `CECLI_CHAT_LANGUAGE` ### `--commit-language COMMIT_LANGUAGE` -Specify the language to use in the commit message (default: None, user language) -Environment variable: `CECLI_COMMIT_LANGUAGE` +Specify the language to use in the commit message (default: None, user language) Environment variable: `CECLI_COMMIT_LANGUAGE` ### `--yes-always` -Always say yes to every confirmation -Environment variable: `CECLI_YES_ALWAYS` +Always say yes to every confirmation Environment variable: `CECLI_YES_ALWAYS` ### `--verbose` -Enable verbose output -Default: False -Environment variable: `CECLI_VERBOSE` -Aliases: +Enable verbose output Default: False Environment variable: `CECLI_VERBOSE` Aliases: - `-v` - `--verbose` ### `--load LOAD_FILE` -Load and execute /commands from a file on launch -Environment variable: `CECLI_LOAD` +Load and execute /commands from a file on launch Environment variable: `CECLI_LOAD` ### `--encoding VALUE` -Specify the encoding for input and output (default: utf-8) -Default: utf-8 -Environment variable: `CECLI_ENCODING` +Specify the encoding for input and output (default: utf-8) Default: utf-8 Environment variable: `CECLI_ENCODING` ### `--line-endings VALUE` -Line endings to use when writing files (default: platform) -Default: platform -Environment variable: `CECLI_LINE_ENDINGS` +Line endings to use when writing files (default: platform) Default: platform Environment variable: `CECLI_LINE_ENDINGS` ### `--config CONFIG_FILE` -Specify the config file (default: search for .cecli.conf.yml in git root, cwd or home directory) -Aliases: +Specify the config file (default: search for .cecli.conf.yml in git root, cwd or home directory) Aliases: - `-c CONFIG_FILE` - `--config CONFIG_FILE` ### `--env-file ENV_FILE` -Specify the .env file to load (default: .env in git root) -Default: .env -Environment variable: `CECLI_ENV_FILE` +Specify the .env file to load (default: .env in git root) Default: .env Environment variable: `CECLI_ENV_FILE` ### `--suggest-shell-commands` -Enable/disable suggesting shell commands (default: True) -Default: True -Environment variable: `CECLI_SUGGEST_SHELL_COMMANDS` -Aliases: +Enable/disable suggesting shell commands (default: True) Default: True Environment variable: `CECLI_SUGGEST_SHELL_COMMANDS` Aliases: - `--suggest-shell-commands` - `--no-suggest-shell-commands` ### `--fancy-input` -Enable/disable fancy input with history and completion (default: True) -Default: True -Environment variable: `CECLI_FANCY_INPUT` -Aliases: +Enable/disable fancy input with history and completion (default: True) Default: True Environment variable: `CECLI_FANCY_INPUT` Aliases: - `--fancy-input` - `--no-fancy-input` ### `--multiline` -Enable/disable multi-line input mode with Meta-Enter to submit (default: False) -Default: False -Environment variable: `CECLI_MULTILINE` -Aliases: +Enable/disable multi-line input mode with Meta-Enter to submit (default: False) Default: False Environment variable: `CECLI_MULTILINE` Aliases: - `--multiline` - `--no-multiline` ### `--notifications` -Enable/disable terminal bell notifications when LLM responses are ready (default: False) -Default: False -Environment variable: `CECLI_NOTIFICATIONS` -Aliases: +Enable/disable terminal bell notifications when LLM responses are ready (default: False) Default: False Environment variable: `CECLI_NOTIFICATIONS` Aliases: - `--notifications` - `--no-notifications` ### `--notifications-command COMMAND` -Specify a command to run for notifications instead of the terminal bell. If not specified, a default command for your OS may be used. -Environment variable: `CECLI_NOTIFICATIONS_COMMAND` +Specify a command to run for notifications instead of the terminal bell. If not specified, a default command for your OS may be used. Environment variable: `CECLI_NOTIFICATIONS_COMMAND` ### `--detect-urls` -Enable/disable detection and offering to add URLs to chat (default: True) -Default: True -Environment variable: `CECLI_DETECT_URLS` -Aliases: +Enable/disable detection and offering to add URLs to chat (default: True) Default: True Environment variable: `CECLI_DETECT_URLS` Aliases: - `--detect-urls` - `--no-detect-urls` ### `--editor VALUE` -Specify which editor to use for the /editor command -Environment variable: `CECLI_EDITOR` +Specify which editor to use for the /editor command Environment variable: `CECLI_EDITOR` ### `--shell-completions SHELL` -Print shell completion script for the specified SHELL and exit. Supported shells: bash, tcsh, zsh. Example: cecli --shell-completions bash -Environment variable: `CECLI_SHELL_COMPLETIONS` - - +Print shell completion script for the specified SHELL and exit. Supported shells: bash, tcsh, zsh. Example: cecli --shell-completions bash Environment variable: `CECLI_SHELL_COMPLETIONS` diff --git a/cecli/website/docs/config/persistent-memory.md b/cecli/website/docs/config/persistent-memory.md index 2edf5f67a24..2d03a2854dd 100644 --- a/cecli/website/docs/config/persistent-memory.md +++ b/cecli/website/docs/config/persistent-memory.md @@ -52,7 +52,7 @@ cecli --auto-memory cecli --no-auto-memory ``` -You can also set this in your [configuration file](/config/options.html): +You can also set this in your [configuration file](options.html): ```yaml # .cecli.yml or other config file @@ -163,11 +163,11 @@ sqlite3 .cecli/memory.v1/cache.db "SELECT * FROM Facts;" rm -rf .cecli/memory.v1/ ``` -cecli will automatically recreate the database with an empty schema on the next invocation. +Cecli will automatically recreate the database with an empty schema on the next invocation. --- ## Related -- [Sub-Agents](/docs/config/subagents.html) — Learn more about the sub-agent system that powers the memorizer -- [Options Reference](/docs/config/options.html) — All available CLI flags including `--auto-memory` +- [Sub-Agents](subagents.html) — Learn more about the sub-agent system that powers the memorizer +- [Options Reference](options.html) — All available CLI flags including `--auto-memory` diff --git a/cecli/website/docs/config/reasoning.md b/cecli/website/docs/config/reasoning.md index 1aa30e8ce82..60c9ec0e0f0 100644 --- a/cecli/website/docs/config/reasoning.md +++ b/cecli/website/docs/config/reasoning.md @@ -4,32 +4,22 @@ nav_order: 110 description: How to configure reasoning model settings from secondary providers. --- -# Reasoning models - -![Thinking demo](/assets/thinking.jpg) - ## Basic usage -cecli is configured to work with most popular reasoning models out of the box. -You can use them like this: +Cecli is configured to work with most popular reasoning models out of the box. You can use them like this: ```bash # Sonnet uses a thinking token budget -cecli --model sonnet --thinking-tokens 8k +cecli --model claude-sonnet-5 --thinking-tokens 8k # o3-mini uses low/medium/high reasoning effort -cecli --model o3-mini --reasoning-effort high +cecli --model gpt-5.6-terra --reasoning-effort high -# R1 doesn't have configurable thinking/reasoning -cecli --model r1 ``` -Inside the cecli chat, you can use `/thinking-tokens 4k` or `/reasoning-effort low` to change -the amount of reasoning. Use `/thinking-tokens 0` to disable thinking tokens. +Inside the cecli chat, you can use `/thinking-tokens 4k` or `/reasoning-effort low` to change the amount of reasoning. Use `/thinking-tokens 0` to disable thinking tokens. -The rest of this document describes more advanced details which are mainly needed -if you're configuring cecli to work with a lesser known reasoning model or one served -via an unusual provider. +The rest of this document describes more advanced details which are mainly needed if you're configuring cecli to work with a lesser known reasoning model or one served via an unusual provider. ## Reasoning settings @@ -37,26 +27,18 @@ Different models support different reasoning settings. cecli provides several wa ### Reasoning effort -You can use the `--reasoning-effort` switch to control the reasoning effort -of models which support this setting. -This switch is useful for OpenAI's reasoning models, which accept "low", "medium" and "high". +You can use the `--reasoning-effort` switch to control the reasoning effort of models which support this setting. This switch is useful for OpenAI's reasoning models, which accept "low", "medium" and "high". ### Thinking tokens -You can use the `--thinking-tokens` switch to request -the model use a certain number of thinking tokens. -This switch is useful for Sonnet 3.7. -You can specify the token budget like "1024", "1k", "8k" or "0.01M". -Use "0" to disable thinking tokens. +You can use the `--thinking-tokens` switch to request the model use a certain number of thinking tokens. You can specify the token budget like "1024", "1k", "8k" or "0.01M". Use "0" to disable thinking tokens. ### Model compatibility and settings -Not all models support these two settings. cecli uses the -[model's metadata](/docs/config/adv-model-settings.html) -to determine which settings each model accepts: +Not all models support these two settings. cecli uses the [model's metadata](adv-model-settings.html) to determine which settings each model accepts: ```yaml -- name: o3-mini +- name: gpt-5-mini ... accepts_settings: ["reasoning_effort"] ``` @@ -64,7 +46,7 @@ to determine which settings each model accepts: If you try to use a setting that a model doesn't explicitly support, cecli will warn you: ``` -Warning: o3-mini does not support 'thinking_tokens', ignoring. +Warning: gpt-5-mini does not support 'thinking_tokens', ignoring. Use --no-check-model-accepts-settings to force the 'thinking_tokens' setting. ``` @@ -76,135 +58,5 @@ This functionality helps prevent API errors while still allowing you to experime Each model has a predefined list of supported settings in its configuration. For example: -- OpenAI reasoning models generally support `reasoning_effort` -- Anthropic reasoning models generally support `thinking_tokens` - - -### How `accepts_settings` works - -Models define which reasoning settings they accept using the `accepts_settings` property: - -```yaml -- name: a-fancy-reasoning-model - edit_format: diff - use_repo_map: true - accepts_settings: # <--- - - reasoning_effort # <--- -``` - -This configuration: -1. Tells cecli that the model accepts the `reasoning_effort` setting -2. Indicates the model does NOT accept `thinking_tokens` (since it's not listed) -3. Causes cecli to ignore any `--thinking-tokens` value passed for this model -4. Generates a warning if you try to use `--thinking-tokens` with this model - -You can override this behavior with `--no-check-model-accepts-settings`, which will: -1. Force cecli to apply all settings passed via command line -2. Skip all compatibility checks -3. Potentially cause API errors if the model truly doesn't support the setting - -This is useful when testing new models or using models through custom API providers. - - -## Thinking tokens in XML tags - -There is also a `reasoning_tag` setting, which takes the name of an XML tag -that the model uses to wrap its reasoning/thinking output. - -For example when using DeepSeek R1 from Fireworks, the reasoning comes back inside -`...` tags, so cecli's settings -include `reasoning_tag: think`. - -``` - -The user wants me to greet them! - - -Hello! -``` - -cecli will display the thinking/reasoning output, -but it won't be used for file editing instructions, added to the chat history, etc. -cecli will rely on the non-thinking output for instructions on how to make code changes, etc. - -### Model-specific reasoning tags - -Different models use different XML tags for their reasoning: -When using custom or self-hosted models, you may need to specify the appropriate reasoning tag in your configuration. - -```yaml -- name: fireworks_ai/accounts/fireworks/models/deepseek-r1 - edit_format: diff - weak_model_name: fireworks_ai/accounts/fireworks/models/deepseek-v3 - use_repo_map: true - extra_params: - max_tokens: 160000 - use_temperature: false - editor_model_name: fireworks_ai/accounts/fireworks/models/deepseek-v3 - editor_edit_format: editor-diff - reasoning_tag: think # <--- -``` - -## Reasoning model limitations - -Many "reasoning" models have restrictions on how they can be used: -they sometimes prohibit streaming, use of temperature and/or the system prompt. -cecli is configured to work properly with popular models -when served through major provider APIs. - -If you're using a model through a different provider (like Azure or custom deployment), -you may need to [configure model settings](/docs/config/adv-model-settings.html) -if you see errors related to temperature or system prompt. - -Include settings for your new provider in `.cecli.model.settings.yml` file -at the root of your project or in your home directory. - -### Temperature, streaming and system prompt - -Reasoning models often have specific requirements for these settings: - -| Setting | Description | Common Restrictions | -|---------|-------------|---------------------| -| `use_temperature` | Whether to use temperature sampling | Many reasoning models require this set to `false` | -| `streaming` | Whether to stream responses | Some reasoning models don't support streaming | -| `use_system_prompt` | Whether to use system prompt | Some reasoning models don't support system prompts | - -It may be helpful to find one of the -[existing model setting configuration entries](https://github.com/cecli-dev/cecli/blob/main/cecli/resources/model-settings.yml) -for the model you are interested in, say o3-mini: - -```yaml -- name: o3-mini - edit_format: diff - weak_model_name: gpt-4o-mini - use_repo_map: true - use_temperature: false # <--- - editor_model_name: gpt-4o - editor_edit_format: editor-diff - accepts_settings: ["reasoning_effort"] -``` - -Pay attention to these settings, which must be set to `false` -for certain reasoning models: - -- `use_temperature` -- `streaming` -- `use_system_prompt` - -### Custom provider example - -Here's an example of the settings to use o3-mini via Azure. -Note that cecli already has these settings pre-configured, but they -serve as a good example of how to adapt the main model -settings for a different provider. - -```yaml -- name: azure/o3-mini - edit_format: diff - weak_model_name: azure/gpt-4o-mini - use_repo_map: true - use_temperature: false # <--- - editor_model_name: azure/gpt-4o - editor_edit_format: editor-diff - accepts_settings: ["reasoning_effort"] -``` +- OpenAI-compatible model APIs generally support `reasoning_effort` +- Anthropic-compatible model APIs generally support `thinking_tokens` diff --git a/cecli/website/docs/config/retries.md b/cecli/website/docs/config/retries.md index 606bd31c660..73891eec981 100644 --- a/cecli/website/docs/config/retries.md +++ b/cecli/website/docs/config/retries.md @@ -6,9 +6,7 @@ description: How to configure cecli retry behavior for failed API calls. # Retries -cecli can be configured to retry failed API calls. -This is useful for handling intermittent network issues or other transient errors. -The `retries` option is a JSON object that can be configured with the following keys: +Cecli can be configured to retry failed API calls. This is useful for handling intermittent network issues or other transient errors. The `retries` option is a JSON object that can be configured with the following keys: - `retry-timeout`: The timeout in seconds for each retry. - `retry-backoff-factor`: The backoff factor to use between retries. @@ -34,4 +32,8 @@ Or by setting the `CECLI_RETRIES` environment variable: ``` export CECLI_RETRIES='{"retry-timeout": 30, "retry-backoff-factor": 1.50, "retry-on-unavailable": true}' ``` -{% include keys.md %} \ No newline at end of file + +> **Tip:** +> See the +> [API key configuration docs](api-keys.html) +> for information on how to configure and store your API keys. diff --git a/cecli/website/docs/config/skills.md b/cecli/website/docs/config/skills.md index 148e3bae0d4..d1c3993e760 100644 --- a/cecli/website/docs/config/skills.md +++ b/cecli/website/docs/config/skills.md @@ -28,7 +28,7 @@ skill-name/ └── evals.json # Evaluation tests ``` -## SKILL.md Format +## SKILL\.md Format The `SKILL.md` file contains YAML frontmatter followed by markdown instructions: @@ -69,91 +69,6 @@ def process_data(data): return result ``` -## Evals Format (`evals.json`) - -The `evals/` directory contains `evals.json` files for testing skill performance. These evaluations help ensure that skills behave as expected and provide a way to measure their accuracy and effectiveness. These evaluation files can be executed using the `RunEvals` tool in Agent Mode. - -`evals.json` files can be in one of two formats: - -### Standard Format - -The standard format includes metadata about the skill and a list of evaluation cases. - -**Structure:** - -```json -{ - "skill_name": "your-skill-name", - "evals": [ - { - "id": 1, - "prompt": "A user query to test the skill.", - "expected_output": "A description of the ideal response from the AI.", - "assertions": [ - "A list of specific points or phrases that must be in the output.", - "Another assertion to check for.", - "And so on..." - ], - "files": [ - "path/to/test/file1.txt", - "path/to/test/file2.py" - ] - } - ] -} -``` - -- **`skill_name`**: The name of the skill being evaluated. -- **`evals`**: An array of evaluation objects. - - **`id`**: A unique identifier for the test case. - - **`prompt`**: The input prompt to send to the AI. - - **`expected_output`**: A natural language description of what the ideal response should contain. - - **`assertions`**: A list of specific, verifiable statements that must be true about the AI's output. These are used for automated checking. - - **`files`**: A list of file paths to be included in the context when running the evaluation. - -### Assertion-Based Format - -This format is a direct array of evaluation cases, each with structured assertions. This is useful for more granular, automated testing. - -**Structure:** - -```json -[ - { - "id": "billing-charge-error", - "description": "Clear billing question about a charge", - "input": "I was charged $99 but I only signed up for the $49 plan.", - "assertions": [ - { "type": "exact", "value": "BILLING" } - ] - }, - { - "id": "technical-api-error", - "description": "API authentication failure is TECHNICAL", - "input": "I keep getting a 403 error when I try to authenticate.", - "assertions": [ - { "type": "exact", "value": "TECHNICAL" } - ] - }, - { - "id": "no-extra-text", - "description": "Output should only be the label — nothing else", - "input": "Where can I find my invoices?", - "assertions": [ - { "type": "contains", "value": "BILLING" }, - { "type": "max_length", "value": 10 } - ] - } -] -``` - -- **`id`**: A unique string identifier for the test case. -- **`description`**: A brief explanation of the test case's purpose. -- **`input`**: The input prompt to send to the AI. -- **`assertions`**: An array of assertion objects for automated validation. - - **`type`**: The type of assertion (e.g., `exact`, `contains`, `max_length`). - - **`value`**: The value to check against. - ## Skill Configuration Skills are configured through the `agent-config` parameter in the YAML configuration file. The following options are available: @@ -177,13 +92,7 @@ agent-config: | "skills_excludelist": ["legacy-tools"], # Optional: Blacklist of skills to exclude # Other Agent Mode settings - "large_file_token_threshold": 12500, # Token threshold for large file warnings - "skip_cli_confirmations": false, # YOLO mode - be brave and let the LLM cook - "allowed_commands": ["wc -l*"], # Commands matching these glob patterns will not prompt for confirmation - "tools_includelist": ["view", "makeeditable", "replacetext", "finished"], # Optional: Whitelist of tools - "tools_excludelist": ["command", "commandinteractive"], # Optional: Blacklist of tools - "include_context_blocks": ["todo_list", "git_status"], # Optional: Context blocks to include - "exclude_context_blocks": ["symbol_outline", "directory_structure"] # Optional: Context blocks to exclude + ... } ``` @@ -199,70 +108,6 @@ To create a custom skill: 6. Add evaluation tests in `evals/` directory to test skill performance 7. Test the skill by adding it to your configuration file: -Example skill creation: -```bash -mkdir -p ~/skills/my-custom-skill/{references,scripts,assets,evals} - -cat > ~/skills/my-custom-skill/SKILL.md << 'EOF' ---- -name: my-custom-skill -description: My custom skill for specific tasks -license: MIT -metadata: - version: 1.0.0 - author: Your Name ---- - -# My Custom Skill - -This skill helps with... - -## Features -- Feature 1 -- Feature 2 - -## Usage -1. Step 1 -2. Step 2 -EOF - -# Add a reference -cat > ~/skills/my-custom-skill/references/api.md << 'EOF' -# API Reference - -## Endpoints -- GET /api/data -- POST /api/process -EOF - -# Add a script -cat > ~/skills/my-custom-skill/scripts/setup.sh << 'EOF' -#!/bin/bash -echo "Setting up my custom skill..." -# Setup commands here -EOF -chmod +x ~/skills/my-custom-skill/scripts/setup.sh - -# Add an eval file -cat > ~/skills/my-custom-skill/evals/evals.json << 'EOF' -{ - "skill_name": "my-custom-skill", - "evals": [ - { - "id": 1, - "prompt": "Test prompt for feature 1", - "expected_output": "Expected behavior for feature 1", - "assertions": [ - "Should do this", - "Should not do that" - ], - "files": [] - } - ] -} -EOF -``` - ## Best Practices for Skills 1. **Keep skills focused**: Each skill should address a specific domain or task @@ -275,7 +120,7 @@ EOF ## Skills in Action -With skills enabled, the AI can: +With skills enabled, the LLM can: - Reference specific techniques from skill instructions - Use provided scripts to automate tasks - Consult reference materials for API details diff --git a/cecli/website/docs/config/subagents.md b/cecli/website/docs/config/subagents.md index c54a32c5a5b..de25d363907 100644 --- a/cecli/website/docs/config/subagents.md +++ b/cecli/website/docs/config/subagents.md @@ -42,7 +42,7 @@ and suggestions for improvement. |-------|----------|-------------| | `name` | Yes | Unique name used to reference the sub-agent in commands and the Delegate tool | | `model` | No | Model override for this sub-agent. If omitted, inherits the parent agent's model | -| `hooks` | No | Per-agent hooks configuration (see [Hooks](/config/hooks) for syntax) | +| `hooks` | No | Per-agent hooks configuration (see [Hooks](hooks.html) for syntax) | | `agent-config` | No | Override `agent-config` property of cecli configuration with custom values for sub agent | | `auto_reap` | No | Controls whether this sub-agent is automatically reaped when the limit is reached. Defaults to `true` if omitted | @@ -254,10 +254,10 @@ You are a testing specialist. Your job is to write comprehensive tests for code changes. ``` -The `hooks` field uses the same syntax as the global hooks configuration (see [Hooks](/config/hooks) for details). +The `hooks` field uses the same syntax as the global hooks configuration (see [Hooks](hooks.html) for details). ## See Also -- [Agent Mode](/config/agent-mode) -- [Custom Commands](/config/custom-commands) -- [Custom System Prompts](/config/custom-system-prompts) -- [Hooks](/config/hooks) \ No newline at end of file +- [Agent Mode](agent-mode.html) +- [Custom Commands](custom-commands.html) +- [Custom System Prompts](custom-system-prompts.html) +- [Hooks](hooks.html) \ No newline at end of file diff --git a/cecli/website/docs/config/tui.md b/cecli/website/docs/config/tui.md index f56604f4cb6..3a6aad356df 100644 --- a/cecli/website/docs/config/tui.md +++ b/cecli/website/docs/config/tui.md @@ -1,26 +1,23 @@ --- parent: Configuration nav_order: 40 -description: TUI (Textual User Interface) Mode provides a modern, visually rich terminal interface for AI pair programming. +description: The TUI (Terminal User Interface) provides a modern, visually rich terminal interface for AI pair programming. --- -# TUI Mode +# TUI -TUI (Textual User Interface) Mode provides a modern, visually rich terminal interface for AI pair programming. +TUI (Terminal User Interface) Mode provides a modern, visually rich terminal interface for AI pair programming. ## Activation -Command line: -``` -cecli ... --tui - -### OR! +The TUI is the default in recent versions of Cecli and on older versions it can be started explicitly in the terminal with: +``` cecli ... --tui ``` ## Configuration -TUI Mode can be configured directly in the relevant config.json file or with JSON in the command line arguments: +The TUI can be configured directly in the relevant config.json file or with JSON in the command line arguments: ### Minimal Configuration @@ -30,7 +27,7 @@ tui: true ### Complete Configuration Example -Complete configuration example in YAML configuration file (`.cecli.conf.yml` or `~/.cecli.conf.yml`). The base theme is pretty nice but if you want different colors and key bindings, do you thing: +The base theme is pretty nice but if you want different colors and key bindings, you can specify them in the configuration files (`~/.cecli/conf.yml` or `.cecli.conf.yml`): ```yaml tui: true @@ -68,6 +65,9 @@ tui-config: cancel: "ctrl+c" clear: "ctrl+l" quit: "ctrl+q" + next_agent: "alt+ctrl+right" + prev_agent: "alt+ctrl+left" + main_agent: "alt+ctrl+up" ``` @@ -92,6 +92,9 @@ The TUI provides customizable key bindings for all major actions. The default ke | Focus | `ctrl+f` | Focus the input area | | Clear | `ctrl+l` | Clear the output area | | Quit | `ctrl+q` | Exit the TUI | +| Next Agent | `alt+ctrl+right` | Switch to the next agent (sub-agent or primary), wrapping around | +| Previous Agent | `alt+ctrl+left` | Switch to the previous agent (sub-agent or primary), wrapping around | +| Main Agent | `alt+ctrl+up` | Switch back to the main (primary) agent | #### Customizing Key Bindings @@ -144,5 +147,3 @@ TUI Mode works seamlessly with other cecli features: - **Minimum Size**: 80x24 terminal size recommended - **Unicode Support**: Required for proper symbol display - **Modern Terminal**: Recommended: Kitty, WezTerm, iTerm2, or Windows Terminal - -TUI Mode represents a significant evolution in cecli's user experience, providing a modern, efficient interface for AI pair programming while maintaining the power and flexibility of the command-line foundation. Ideally, this mode makes ai-enabled programming more colorful and more fun for us all! \ No newline at end of file diff --git a/cecli/website/docs/ctags.md b/cecli/website/docs/ctags.md index 1d37ed58b48..5578f0c6b71 100644 --- a/cecli/website/docs/ctags.md +++ b/cecli/website/docs/ctags.md @@ -4,118 +4,53 @@ excerpt: Using ctags to build a "repository map" to increase GPT-4's ability to highlight_image: /assets/robot-flowchart.png nav_exclude: true --- -{% if page.date %} - -{% endif %} # Improving GPT-4's codebase understanding with ctags ![robot flowchat](/assets/robot-flowchart.png) - ## Updated -cecli no longer uses ctags to build a repo map. -Please see the newer article about -[using tree-sitter to build a better repo map](https://cecli.dev/docs/repomap.html). +Cecli no longer uses ctags to build a repo map. Please see the newer article about [using tree-sitter to build a better repo map](repomap.html). ------- -GPT-4 is extremely useful for "self-contained" coding tasks, -like generating brand new code or modifying a pure function -that has no dependencies. +GPT-4 is extremely useful for "self-contained" coding tasks, like generating brand new code or modifying a pure function that has no dependencies. -But it's difficult to use GPT-4 to modify or extend -a large, complex pre-existing codebase. -To modify such code, GPT needs to understand the dependencies and APIs -which interconnect its subsystems. -Somehow we need to provide this "code context" to GPT -when we ask it to accomplish a coding task. Specifically, we need to: +But it's difficult to use GPT-4 to modify or extend a large, complex pre-existing codebase. To modify such code, GPT needs to understand the dependencies and APIs which interconnect its subsystems. Somehow we need to provide this "code context" to GPT when we ask it to accomplish a coding task. Specifically, we need to: - Help GPT understand the overall codebase, so that it -can decifer the meaning of code with complex dependencies and generate -new code that respects and utilizes existing abstractions. +can decifer the meaning of code with complex dependencies and generate new code that respects and utilizes existing abstractions. - Convey all of this "code context" to GPT in an efficient manner that fits within the 8k-token context window. -To address these issues, `cecli` now -sends GPT a **concise map of your whole git repository** -that includes -all declared variables and functions with call signatures. -This *repo map* is built automatically using `ctags`, which -extracts symbol definitions from source files. Historically, -ctags were generated and indexed by IDEs and editors to -help humans search and navigate large codebases. -Instead, we're going to use ctags to help GPT better comprehend, navigate -and edit code in larger repos. - -To get a sense of how effective this can be, this -[chat transcript](https://cecli.dev/examples/add-test.html) -shows GPT-4 creating a black box test case, **without being given -access to the source code of the function being tested or any of the -other code in the repo.** -Using only the meta-data in the repo map, GPT is able to figure out how to -call the method to be tested, as well as how to instantiate multiple -class objects that are required to prepare for the test. +To address these issues, `cecli` now sends GPT a **concise map of your whole git repository** that includes all declared variables and functions with call signatures. This *repo map* is built automatically using `ctags`, which extracts symbol definitions from source files. Historically, ctags were generated and indexed by IDEs and editors to help humans search and navigate large codebases. Instead, we're going to use ctags to help GPT better comprehend, navigate and edit code in larger repos. -To code with GPT-4 using the techniques discussed here: +To get a sense of how effective this can be, this [chat transcript](https://cecli.dev/examples/add-test.html) shows GPT-4 creating a black box test case, **without being given access to the source code of the function being tested or any of the other code in the repo.** Using only the meta-data in the repo map, GPT is able to figure out how to call the method to be tested, as well as how to instantiate multiple class objects that are required to prepare for the test. +To code with GPT-4 using the techniques discussed here: - - Install [cecli](https://cecli.dev/docs/install.html). + - Install [cecli](install.html). - Install universal ctags. - Run `cecli` inside your repo, and it should say "Repo-map: universal-ctags using 1024 tokens". ## The problem: code context -GPT-4 is great at "self contained" coding tasks, like writing or -modifying a pure function with no external dependencies. -GPT can easily handle requests like "write a -Fibonacci function" or "rewrite the loop using list -comprehensions", because they require no context beyond the code -being discussed. - -Most real code is not pure and self-contained, it is intertwined with -and depends on code from many different files in a repo. -If you ask GPT to "switch all the print statements in class Foo to -use the BarLog logging system", it needs to see the code in the Foo class -with the prints, and it also needs to understand the project's BarLog -subsystem. - -A simple solution is to **send the entire codebase** to GPT along with -each change request. Now GPT has all the context! But this won't work -for even moderately -sized repos, because they won't fit into the 8k-token context window. - -A better approach is to be selective, -and **hand pick which files to send**. -For the example above, you could send the file that -contains the Foo class -and the file that contains the BarLog logging subsystem. -This works pretty well, and is supported by `cecli` -- you -can manually specify which files to "add to the chat" you are having with GPT. - -But it's not ideal to have to manually identify the right -set of files to add to the chat. -And sending whole files is a bulky way to send code context, -wasting the precious 8k context window. -GPT doesn't need to see the entire implementation of BarLog, -it just needs to understand it well enough to use it. -You may quickly run out of context window if you -send many files worth of code just to convey context. +GPT-4 is great at "self contained" coding tasks, like writing or modifying a pure function with no external dependencies. GPT can easily handle requests like "write a Fibonacci function" or "rewrite the loop using list comprehensions", because they require no context beyond the code being discussed. + +Most real code is not pure and self-contained, it is intertwined with and depends on code from many different files in a repo. If you ask GPT to "switch all the print statements in class Foo to use the BarLog logging system", it needs to see the code in the Foo class with the prints, and it also needs to understand the project's BarLog subsystem. + +A simple solution is to **send the entire codebase** to GPT along with each change request. Now GPT has all the context! But this won't work for even moderately sized repos, because they won't fit into the 8k-token context window. + +A better approach is to be selective, and **hand pick which files to send**. For the example above, you could send the file that contains the Foo class and the file that contains the BarLog logging subsystem. This works pretty well, and is supported by `cecli` -- you can manually specify which files to "add to the chat" you are having with GPT. + +But it's not ideal to have to manually identify the right set of files to add to the chat. And sending whole files is a bulky way to send code context, wasting the precious 8k context window. GPT doesn't need to see the entire implementation of BarLog, it just needs to understand it well enough to use it. You may quickly run out of context window if you send many files worth of code just to convey context. ## Using a repo map to provide context -The latest version of `cecli` sends a **repo map** to GPT along with -each change request. The map contains a list of all the files in the -repo, along with the symbols which are defined in each file. Callables -like functions and methods also include their signatures. +The latest version of `cecli` sends a **repo map** to GPT along with each change request. The map contains a list of all the files in the repo, along with the symbols which are defined in each file. Callables like functions and methods also include their signatures. -Here's a -sample of the map of the cecli repo, just showing the maps of -[main.py](https://github.com/cecli-dev/cecli/blob/main/cecli/main.py) -and -[io.py](https://github.com/cecli-dev/cecli/blob/main/cecli/io.py) -: +Here's a sample of the map of the cecli repo, just showing the maps of [main.py](https://github.com/cecli-dev/cecli/blob/main/cecli/main.py) and [io.py](https://github.com/cecli-dev/cecli/blob/main/cecli/io.py) : ``` cecli/ @@ -152,30 +87,15 @@ Mapping out the repo like this provides some benefits: - GPT can see variables, classes, methods and function signatures from everywhere in the repo. This alone may give it enough context to solve many tasks. For example, it can probably figure out how to use the API exported from a module just based on the details shown in the map. - If it needs to see more code, GPT can use the map to figure out by itself which files it needs to look at. GPT will then ask to see these specific files, and `cecli` will automatically add them to the chat context (with user approval). -Of course, for large repositories even just the map might be too large -for the context window. However, this mapping approach opens up the -ability to collaborate with GPT-4 on larger codebases than previous -methods. It also reduces the need to manually curate which files to -add to the chat context, empowering GPT to autonomously identify -relevant files for the task at hand. +Of course, for large repositories even just the map might be too large for the context window. However, this mapping approach opens up the ability to collaborate with GPT-4 on larger codebases than previous methods. It also reduces the need to manually curate which files to add to the chat context, empowering GPT to autonomously identify relevant files for the task at hand. ## Using ctags to make the map -Under the hood, `cecli` uses -[universal ctags](https://github.com/universal-ctags/ctags) -to build the -map. Universal ctags can scan source code written in many -languages, and extract data about all the symbols defined in each -file. +Under the hood, `cecli` uses [universal ctags](https://github.com/universal-ctags/ctags) to build the map. Universal ctags can scan source code written in many languages, and extract data about all the symbols defined in each file. -Historically, ctags were generated and indexed by IDEs or code editors -to make it easier for a human to search and navigate a -codebase, find the implementation of functions, etc. -Instead, we're going to use ctags to help GPT navigate and understand the codebase. +Historically, ctags were generated and indexed by IDEs or code editors to make it easier for a human to search and navigate a codebase, find the implementation of functions, etc. Instead, we're going to use ctags to help GPT navigate and understand the codebase. -Here is the type of output you get when you run ctags on source code. Specifically, -this is the -`ctags --fields=+S --output-format=json` output for the `main.py` file mapped above: +Here is the type of output you get when you run ctags on source code. Specifically, this is the `ctags --fields=+S --output-format=json` output for the `main.py` file mapped above: ```json { @@ -195,35 +115,19 @@ this is the } ``` -The repo map is built using this type of `ctags` data, -but formatted into the space -efficient hierarchical tree format shown earlier. -This is a format that GPT can easily understand -and which conveys the map data using a -minimal number of tokens. +The repo map is built using this type of `ctags` data, but formatted into the space efficient hierarchical tree format shown earlier. This is a format that GPT can easily understand and which conveys the map data using a minimal number of tokens. ## Example chat transcript -This -[chat transcript](https://cecli.dev/examples/add-test.html) -shows GPT-4 creating a black box test case, **without being given -access to the source code of the function being tested or any of the -other code in the repo.** Instead, GPT is operating solely off -the repo map. +This [chat transcript](https://cecli.dev/examples/add-test.html) shows GPT-4 creating a black box test case, **without being given access to the source code of the function being tested or any of the other code in the repo.** Instead, GPT is operating solely off the repo map. Using only the meta-data in the map, GPT is able to figure out how to call the method to be tested, as well as how to instantiate multiple class objects that are required to prepare for the test. -GPT makes one reasonable mistake writing the first version of the test, but is -able to quickly fix the issue after being shown the `pytest` error output. +GPT makes one reasonable mistake writing the first version of the test, but is able to quickly fix the issue after being shown the `pytest` error output. ## Future work -Just as "send the whole codebase to GPT with every request" -is not an efficient solution to this problem, -there are probably better approaches than -"send the whole repo map with every request". -Sending an appropriate subset of the repo map would help `cecli` work -better with even larger repositories which have large maps. +Just as "send the whole codebase to GPT with every request" is not an efficient solution to this problem, there are probably better approaches than "send the whole repo map with every request". Sending an appropriate subset of the repo map would help `cecli` work better with even larger repositories which have large maps. Some possible approaches to reducing the amount of map data are: @@ -231,21 +135,12 @@ Some possible approaches to reducing the amount of map data are: - Provide a mechanism for GPT to start with a distilled subset of the global map, and let it ask to see more detail about subtrees or keywords that it feels are relevant to the current coding task. - Attempt to analyze the natural language coding task given by the user and predict which subset of the repo map is relevant. Possibly by analysis of prior coding chats within the specific repo. Work on certain files or types of features may require certain somewhat predictable context from elsewhere in the repo. Vector and keyword search against the chat history, repo map or codebase may help here. -One key goal is to prefer solutions which are language agnostic or -which can be easily deployed against most popular code languages. -The `ctags` solution has this benefit, since it comes pre-built -with support for most popular languages. -I suspect that Language Server Protocol might be an even -better tool than `ctags` for this problem. -But it is more cumbersome to deploy for a broad -array of languages. -Users would need to stand up an LSP server for their -specific language(s) of interest. +One key goal is to prefer solutions which are language agnostic or which can be easily deployed against most popular code languages. The `ctags` solution has this benefit, since it comes pre-built with support for most popular languages. I suspect that Language Server Protocol might be an even better tool than `ctags` for this problem. But it is more cumbersome to deploy for a broad array of languages. Users would need to stand up an LSP server for their specific language(s) of interest. ## Try it out To use this experimental repo map feature: - - Install [cecli](https://cecli.dev/docs/install.html). + - Install [cecli](install.html). - Install ctags. - Run `cecli` inside your repo, and it should say "Repo-map: universal-ctags using 1024 tokens". diff --git a/cecli/website/docs/git.md b/cecli/website/docs/git.md index fab890975cf..5e01233b25d 100644 --- a/cecli/website/docs/git.md +++ b/cecli/website/docs/git.md @@ -6,14 +6,13 @@ description: cecli is tightly integrated with git. # Git integration -cecli works best with code that is part of a git repo. -cecli is tightly integrated with git, which makes it easy to: +Cecli works best with code that is part of a git repo. cecli is tightly integrated with git, which makes it easy to: - Use the `/undo` command to instantly undo any AI changes that you don't like. - Go back in the git history to review the changes that cecli made to your code - Manage a series of cecli's changes on a git branch -cecli uses git in these ways: +Cecli uses git in these ways: - It asks to create a git repo if you launch it in a directory without one. - Whenever cecli edits a file, it commits those changes with a descriptive commit message. This makes it easy to undo or review cecli's changes. @@ -22,9 +21,7 @@ This keeps your edits separate from cecli's edits, and makes sure you never lose ## In-chat commands -cecli also allows you to use -[in-chat commands](/docs/usage/commands.html) -to perform git operations: +Cecli also allows you to use [in-chat commands](usage/commands.html) to perform git operations: - `/diff` will show all the file changes since the last message you sent. - `/undo` will undo and discard the last change. @@ -44,33 +41,24 @@ While it is not recommended, you can disable cecli's use of git in a few ways: ## Commit messages -cecli sends the `--weak-model` a copy of the diffs and the chat history -and asks it to produce a commit message. -By default, cecli creates commit messages which follow -[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). +Cecli sends the `--weak-model` a copy of the diffs and the chat history and asks it to produce a commit message. By default, cecli creates commit messages which follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). -You can customize the -[commit prompt](https://github.com/cecli-dev/cecli/blob/main/cecli/prompts.py#L5) -with the `--commit-prompt` option. -You can place that on the command line, or -[configure it via a config file or environment variables](https://cecli.dev/docs/config.html). +You can customize the [commit prompt](https://github.com/cecli-dev/cecli/blob/main/cecli/prompts.py#L5) with the `--commit-prompt` option. You can place that on the command line, or [configure it via a config file or environment variables](config.html). ## Commit attribution -cecli marks commits that it either authored or committed. +Cecli marks commits that it either authored or committed. - If cecli authored the changes in a commit, they will have "(cecli)" appended to the git author and git committer name metadata. - If cecli simply committed changes (found in dirty files), the commit will have "(cecli)" appended to the git committer name metadata. -You can use `--no-attribute-author` and `--no-attribute-committer` to disable -modification of the git author and committer name fields. +You can use `--no-attribute-author` and `--no-attribute-committer` to disable modification of the git author and committer name fields. Additionally, you can use the following options to prefix commit messages: - `--attribute-commit-message-author`: Prefix commit messages with 'cecli: ' if cecli authored the changes. - `--attribute-commit-message-committer`: Prefix all commit messages with 'cecli: ', regardless of whether cecli authored the changes or not. -Finally, you can use `--attribute-co-authored-by` to have cecli append a Co-authored-by trailer to the end of the commit string. -This will disable appending `(cecli)` to the git author and git committer unless you have explicitly enabled those settings. +Finally, you can use `--attribute-co-authored-by` to have cecli append a Co-authored-by trailer to the end of the commit string. This will disable appending `(cecli)` to the git author and git committer unless you have explicitly enabled those settings. diff --git a/cecli/website/docs/index.md b/cecli/website/docs/index.md index 678560b299c..ccc515c5ddd 100644 --- a/cecli/website/docs/index.md +++ b/cecli/website/docs/index.md @@ -1,47 +1,55 @@ --- -nav_exclude: true +title: Documentation --- # Documentation -This documentation will help you get the most out of cecli. - -
-{% assign pages_list = site.html_pages | sort: "nav_order" %} - -
    -{% for page in pages_list %} - {% if page.title and page.url != "/" and page.parent == nil and page.nav_exclude != true %} -
  • - {{ page.title }}{% if page.description %} — {{ page.description }}{% endif %} - - {% assign children = site.html_pages | where: "parent", page.title | sort: "nav_order" %} - {% if children.size > 0 %} -
      - {% for child in children %} - {% if child.title %} -
    • - {{ child.title }}{% if child.description %} — {{ child.description }}{% endif %} - - {% assign grandchildren = site.html_pages | where: "parent", child.title | sort: "nav_order" %} - {% if grandchildren.size > 0 %} -
        - {% for grandchild in grandchildren %} - {% if grandchild.title %} -
      • - {{ grandchild.title }}{% if grandchild.description %} — {{ grandchild.description }}{% endif %} -
      • - {% endif %} - {% endfor %} -
      - {% endif %} -
    • - {% endif %} - {% endfor %} -
    - {% endif %} -
  • - {% endif %} -{% endfor %} -
-
+It's a terminal agent! LLMs yap enough and I won't belabor the point, but still, try it out! + +## Getting Started + +```bash +uv pip install cecli-dev + +# Change directory into your codebase +cd /to/your/project +# Claude 4.5 Sonnet +cecli --model claude-sonnet-5 --api-key anthropic= + +# Gemini 3 +cecli --model gemini/gemini-3.5-flash-preview --api-key gemini= + +# GPT-5.2 +cecli --model openai/gpt-5.5-terra --api-key openai= + +# DeepSeek Chat +cecli --model deepseek/deepseek-v4-flash --api-key deepseek= +``` + +Want more details? [Installation Guide](install.html) · [Usage Guide](usage.html) + +## More Information + +### Documentation + +Everything you need to get started and make the most of cecli. + +- [Installation Guide](install.html) +- [Usage Guide](usage.html) +- [Connecting to LLMs](llms.html) +- [Configuration Options](config.html) +- [Troubleshooting](troubleshooting.html) + +### Community & Resources + +Connect with other users and find additional resources. + +- [GitHub Repository](https://github.com/cecli-dev/cecli) +- [Discord Community](https://discord.gg/AX9ZEA7nJn) +- [Release notes](https://github.com/cecli-dev/cecli/releases) +- [LLM Leaderboards](leaderboards/index.html) + +## Reference + +- [In-chat commands](usage/commands.html) +- [Options reference](config/options.html) diff --git a/cecli/website/docs/install.md b/cecli/website/docs/install.md index 0b306543bbc..247f8a9c16f 100644 --- a/cecli/website/docs/install.md +++ b/cecli/website/docs/install.md @@ -6,13 +6,10 @@ description: How to install and get started pair programming with cecli. --- # Installation -{: .no_toc } ## One-liners -These one-liners will install cecli, along with python 3.12 if needed (cecli supports Python 3.10-3.14). -They are based on the -[uv installers](https://docs.astral.sh/uv/getting-started/installation/). +These one-liners will install cecli, along with python 3.12 if needed (cecli supports Python 3.10-3.14). They are based on the [uv installers](https://docs.astral.sh/uv/getting-started/installation/). #### Linux & Mac @@ -42,12 +39,9 @@ You can install cecli with uv: uv tool install --native-tls --python python3.12 cecli-dev ``` -This will install cecli in its own isolated environment. -If needed, -uv will automatically install a separate python 3.12 to use with cecli (cecli supports Python 3.10-3.14). +This will install cecli in its own isolated environment. If needed, uv will automatically install a separate python 3.12 to use with cecli (cecli supports Python 3.10-3.14). -Also see the -[docs on other methods for installing uv itself](https://docs.astral.sh/uv/getting-started/installation/). +Also see the [docs on other methods for installing uv itself](https://docs.astral.sh/uv/getting-started/installation/). ## Install with pipx @@ -60,20 +54,15 @@ pipx install cecli-dev You can use pipx to install cecli with python versions 3.10-3.14. -Also see the -[docs on other methods for installing pipx itself](https://pipx.pypa.io/stable/installation/). +Also see the [docs on other methods for installing pipx itself](https://pipx.pypa.io/stable/installation/). ## Other install methods -You can install cecli with the methods described below, but one of the above -methods is usually safer. +You can install cecli with the methods described below, but one of the above methods is usually safer. #### Install with pip -If you install with pip, you should consider -using a -[virtual environment](https://docs.python.org/3/library/venv.html) -to keep cecli's dependencies separated. +If you install with pip, you should consider using a [virtual environment](https://docs.python.org/3/library/venv.html) to keep cecli's dependencies separated. You can use pip to install cecli with python versions 3.10-3.14. @@ -125,5 +114,4 @@ On first run to configure keybindings for the program (notably `shift+enter`). S ## Next steps... -See the [usage instructions](https://cecli.dev/docs/usage.html) to start coding with cecli. - +See the [usage instructions](usage.html) to start coding with cecli. diff --git a/cecli/website/docs/install/docker.md b/cecli/website/docs/install/docker.md index 0e410a07ff2..3a8f261cec7 100644 --- a/cecli/website/docs/install/docker.md +++ b/cecli/website/docs/install/docker.md @@ -25,17 +25,9 @@ docker run \ ## How to use it -You should run the above commands from the root of your git repo, -since the `--volume` arg maps your current directory into the -docker container. -Given that, you need to be in the root of your git repo for cecli to be able to -see the repo and all its files. - -You should be sure your that -git repo config contains your user name and email, since the -docker container won't have your global git config. -Run these commands while in your git repo, before -you do the `docker run` command: +You should run the above commands from the root of your git repo, since the `--volume` arg maps your current directory into the docker container. Given that, you need to be in the root of your git repo for cecli to be able to see the repo and all its files. + +You should be sure your that git repo config contains your user name and email, since the docker container won't have your global git config. Run these commands while in your git repo, before you do the `docker run` command: ``` git config user.email "you@example.com" diff --git a/cecli/website/docs/languages.md b/cecli/website/docs/languages.md index 07664728c97..25478f895a6 100644 --- a/cecli/website/docs/languages.md +++ b/cecli/website/docs/languages.md @@ -5,52 +5,19 @@ description: cecli supports pretty much all popular coding languages. --- # Supported languages -cecli should work well with most popular coding languages. -This is because top LLMs are fluent in most mainstream languages, -and familiar with popular libraries, packages and frameworks. +Cecli should work well with most popular coding languages. This is because top LLMs are fluent in most mainstream languages, and familiar with popular libraries, packages and frameworks. -cecli has specific support for linting many languages. -By default, cecli runs the built in linter any time a file is edited. -If it finds syntax errors, cecli will offer to fix them for you. -This helps catch small code issues and quickly fix them. - -cecli also does code analysis to help -the LLM navigate larger code bases by producing -a [repository map](https://cecli.dev/docs/repomap.html). -cecli can currently produce repository maps for many popular -mainstream languages, listed below. +Cecli has specific support for linting many languages. By default, cecli runs the built in linter any time a file is edited. If it finds syntax errors, cecli will offer to fix them for you. This helps catch small code issues and quickly fix them. +Cecli also does code analysis to help the LLM navigate larger code bases by producing a [repository map](repomap.html). cecli can currently produce repository maps for many popular mainstream languages, listed below. ## How to add support for another language -cecli should work quite well for other languages, even those -without repo map or linter support. -You should really try coding with cecli before -assuming it needs better support for your language. - -That said, if cecli already has support for linting your language, -then it should be possible to add repo map support. -To build a repo map, cecli needs the `tags.scm` file -from the given language's tree-sitter grammar. -If you can find and share that file in a -[GitHub issue](https://github.com/cecli-dev/cecli/issues), -then it may be possible to add repo map support. +Cecli should work quite well for other languages, even those without repo map or linter support. You should really try coding with cecli before assuming it needs better support for your language. -If cecli doesn't already support linting your language, -it will be more complicated to add support. -cecli relies on -[tree-sitter-language-pack](https://github.com/Goldziher/tree-sitter-language-pack) -to provide pre-packaged versions of tree-sitter -language parsers. -This makes it easy for users to install cecli in many diverse environments. -You probably need to work with that project to get your language -supported, which will easily allow cecli to lint that language. -For repo-map support, you will also need to find or create a `tags.scm` file. +That said, if cecli already has support for linting your language, then it should be possible to add repo map support. To build a repo map, cecli needs the `tags.scm` file from the given language's tree-sitter grammar. If you can find and share that file in a [GitHub issue](https://github.com/cecli-dev/cecli/issues), then it may be possible to add repo map support. - +If cecli doesn't already support linting your language, it will be more complicated to add support. cecli relies on [tree-sitter-language-pack](https://github.com/Goldziher/tree-sitter-language-pack) to provide pre-packaged versions of tree-sitter language parsers. This makes it easy for users to install cecli in many diverse environments. You probably need to work with that project to get your language supported, which will easily allow cecli to lint that language. For repo-map support, you will also need to find or create a `tags.scm` file. | Language | File extension | Repo map | Linter | |:--------:|:--------------:|:--------:|:------:| @@ -258,7 +225,3 @@ cog.out(get_supported_languages_md()) | xml | .xsl | | ✓ | | yuck | .yuck | | ✓ | | zig | .zig | ✓ | ✓ | - - - - diff --git a/cecli/website/docs/leaderboards/contrib.md b/cecli/website/docs/leaderboards/contrib.md index fbf7f336388..dfc3a82c886 100644 --- a/cecli/website/docs/leaderboards/contrib.md +++ b/cecli/website/docs/leaderboards/contrib.md @@ -5,10 +5,5 @@ nav_order: 900 # Contributing results -Contributions of benchmark results are welcome! -See the -[benchmark README](https://github.com/cecli-dev/cecli/blob/main/benchmark/README.md) -for information on running cecli's code editing benchmarks. -Submit results by opening a PR with edits to the -[benchmark results data files](https://github.com/cecli-dev/cecli/blob/main/cecli/website/_data/). +Contributions of benchmark results are welcome! See the [benchmark README](https://github.com/cecli-dev/cecli/blob/main/benchmark/README.md) for information on running cecli's code editing benchmarks. Submit results by opening a PR with edits to the [benchmark results data files](https://github.com/cecli-dev/cecli/blob/main/cecli/website/_data/). diff --git a/cecli/website/docs/leaderboards/edit.md b/cecli/website/docs/leaderboards/edit.md index 1b1f5b3a459..aab6bb08720 100644 --- a/cecli/website/docs/leaderboards/edit.md +++ b/cecli/website/docs/leaderboards/edit.md @@ -8,69 +8,110 @@ description: Quantitative benchmark of basic LLM code editing skill. # Code editing leaderboard -{: .note :} -This old -[cecli code editing leaderboard](edit.html) -has been replaced by the -new, much more challenging -[polyglot leaderboard](/docs/leaderboards/). - -[cecli's code editing benchmark](/docs/benchmarks.html#the-benchmark) asks the LLM to edit python source files to complete 133 small coding exercises -from Exercism. -This measures the LLM's coding ability, and whether it can -write new code that integrates into existing code. -The model also has to successfully apply all its changes to the source file without human intervention. - - - - - - - - - - - - - - - {% assign edit_sorted = site.data.edit_leaderboard | sort: 'pass_rate_2' | reverse %} - {% for row in edit_sorted %} - - - - - - - - {% endfor %} - -
ModelPercent completed correctlyPercent using correct edit formatCommandEdit format
{{ row.model }}{{ row.pass_rate_2 }}%{{ row.percent_cases_well_formed }}%{{ row.command }}{{ row.edit_format }}
- - - - - - - +> **Note:** This old [cecli code editing leaderboard](edit.html) has been replaced by the new, much more challenging [polyglot leaderboard](index.html). + +[cecli's code editing benchmark](../benchmarks.html#gpt-code-editing-benchmarks-the-benchmark) asks the LLM to edit python source files to complete 133 small coding exercises from Exercism. This measures the LLM's coding ability, and whether it can write new code that integrates into existing code. The model also has to successfully apply all its changes to the source file without human intervention. + +| Model | Percent completed correctly | Percent using correct edit format | Command | Edit format | +|---|---|---|---|---| +| claude-3-5-sonnet-20241022 | 84.2% | 99.2% | `aider --model anthropic/claude-3-5-sonnet-20241022` | diff | +| o1 | 84.2% | 99.2% | `aider --model openrouter/openai/o1` | diff | +| gemini-exp-1206 (whole) | 80.5% | 100.0% | `aider --model gemini/gemini-exp-1206` | whole | +| o1-preview | 79.7% | 93.2% | `aider --model o1-preview` | diff | +| claude-3.5-sonnet-20240620 | 77.4% | 99.2% | `aider --model claude-3.5-sonnet-20240620` | diff | +| claude-3-5-haiku-20241022 | 75.2% | 95.5% | `aider --model anthropic/claude-3-5-haiku-20241022` | diff | +| gpt-4o-2024-05-13 | 72.9% | 96.2% | `aider` | diff | +| DeepSeek Coder V2 0724 | 72.9% | 97.7% | `aider --model deepseek/deepseek-coder` | diff | +| ollama/qwen2.5-coder:32b | 72.9% | 100.0% | `aider --model ollama/qwen2.5-coder:32b` | whole | +| DeepSeek V2.5 | 72.2% | 96.2% | `aider --deepseek` | diff | +| openai/chatgpt-4o-latest | 72.2% | 97.0% | `aider --model openai/chatgpt-4o-latest` | diff | +| DeepSeek-V2.5-1210 | 72.2% | 99.2% | `aider --model deepseek/deepseek-chat` | diff | +| gpt-4o-2024-08-06 | 71.4% | 98.5% | `aider --model openai/gpt-4o-2024-08-06` | diff | +| Qwen2.5-Coder-32B-Instruct | 71.4% | 94.7% | `aider --model openai/hf:Qwen/Qwen2.5-Coder-32B-Instruct --openai-api-base https://glhf.chat/api/openai/v1` | diff | +| gpt-4o-2024-11-20 | 71.4% | 99.2% | `aider --model openai/gpt-4o-2024-11-20` | diff | +| o1-mini (whole) | 70.7% | 90.0% | `aider --model o1-mini` | whole | +| DeepSeek Chat V2 0628 | 69.9% | 97.7% | `aider --model deepseek/deepseek-chat` | diff | +| gemini-2.0-flash-exp | 69.9% | 97.0% | `aider --model gemini/gemini-2.0-flash-exp` | diff | +| Qwen2.5-Coder-14B-Instruct | 69.2% | 100.0% | `aider --model openai/Qwen2.5-Coder-14B-Instruct` | whole | +| gemini-exp-1206 (diff) | 69.2% | 84.2% | `aider --model gemini/gemini-exp-1206` | diff | +| claude-3-opus-20240229 | 68.4% | 100.0% | `aider --opus` | diff | +| gpt-4-0613 | 67.7% | 100.0% | `aider -4` | diff | +| gemini-1.5-pro-exp-0827 | 66.9% | 94.7% | `aider --model gemini/gemini-1.5-pro-exp-0827` | diff-fenced | +| Dracarys2-72B-Instruct | 66.9% | 100.0% | `(via glhf.chat)` | whole | +| gpt-4-0125-preview | 66.2% | 97.7% | `aider --model gpt-4-0125-preview` | udiff | +| gpt-4-0314 | 66.2% | 93.2% | `aider --model gpt-4-0314` | diff | +| llama-3.1-405b-instruct (whole) | 66.2% | 100.0% | `aider --model openrouter/meta-llama/llama-3.1-405b-instruct` | whole | +| gpt-4-1106-preview | 65.4% | 92.5% | `aider --model gpt-4-1106-preview` | udiff | +| qwen-2.5-72b-instruct (bf16) | 65.4% | 96.2% | `aider --model openrouter/qwen/qwen-2.5-72b-instruct` | diff | +| gemini-1.5-pro-002 | 65.4% | 96.2% | `aider --model gemini/gemini-1.5-pro-002` | diff-fenced | +| Mistral Large (2411) | 65.4% | 96.2% | `aider --model mistral/mistral-large-latest` | diff | +| openrouter/qwen/qwen-2.5-coder-32b-instruct | 65.4% | 84.2% | `aider --model openrouter/qwen/qwen-2.5-coder-32b-instruct` | diff | +| yi-lightning | 65.4% | 97.0% | `aider --model openai/yi-lightning` | whole | +| gpt-4-turbo-2024-04-09 (udiff) | 63.9% | 97.0% | `aider --gpt-4-turbo` | udiff | +| llama-3.1-405b-instruct (diff) | 63.9% | 92.5% | `aider --model openrouter/meta-llama/llama-3.1-405b-instruct` | diff | +| nousresearch/hermes-3-llama-3.1-405b | 63.9% | 100.0% | `aider --model openrouter/nousresearch/hermes-3-llama-3.1-405b` | whole | +| ollama/Qwen2.5.1-Coder-7B-Instruct-GGUF:Q8_0-32k | 63.9% | 100.0% | `aider --model ollama/Qwen2.5.1-Coder-7B-Instruct-GGUF:Q8_0-32k` | whole | +| ollama/qwen2.5-coder:14b | 61.7% | 98.5% | `aider --model ollama/qwen2.5-coder:14b` | whole | +| o1-mini | 61.1% | 100.0% | `aider --model o1-mini` | diff | +| gemini-exp-1114 | 60.9% | 85.7% | `aider --model gemini/gemini-exp-1114` | diff | +| Mistral Large 2 (2407) | 60.2% | 100.0% | `aider --model mistral/mistral-large-2407` | whole | +| llama-3.3-70b-instruct | 59.4% | 88.7% | `aider --model openrouter/meta-llama/llama-3.3-70b-instruct` | diff | +| llama-3.1-70b-instruct | 58.6% | 100.0% | `aider --model fireworks_ai/accounts/fireworks/models/llama-v3p1-70b-instruct` | whole | +| Grok-2 | 58.6% | 98.5% | `aider --model openrouter/x-ai/grok-2` | whole | +| ollama/qwen2.5:32b-instruct-q8_0 | 58.6% | 100.0% | `aider --model ollama/qwen2.5:32b-instruct-q8_0` | whole | +| gpt-3.5-turbo-0301 | 57.9% | 100.0% | `aider --model gpt-3.5-turbo-0301` | whole | +| Qwen2.5-Coder-7B-Instruct | 57.9% | 100.0% | `aider --model openai/Qwen2.5-Coder-7B-Instruct` | whole | +| gemini-exp-1121 | 57.9% | 83.5% | `aider --model gemini/gemini-exp-1121` | diff | +| gpt-4-turbo-2024-04-09 (diff) | 57.6% | 100.0% | `aider --model gpt-4-turbo-2024-04-09` | diff | +| gemini-1.5-pro-001 | 57.1% | 87.2% | `aider --model gemini/gemini-1.5-pro-latest` | diff-fenced | +| gpt-3.5-turbo-1106 | 56.1% | 100.0% | `aider --model gpt-3.5-turbo-1106` | whole | +| Qwen2 72B Instruct | 55.6% | 100.0% | `aider --model together_ai/qwen/Qwen2-72B-Instruct` | whole | +| gpt-4o-mini | 55.6% | 100.0% | `aider --model gpt-4o-mini` | whole | +| claude-3-sonnet-20240229 | 54.9% | 100.0% | `aider --sonnet` | whole | +| Grok-2-mini | 54.9% | 100.0% | `aider --model openrouter/x-ai/grok-2-mini` | whole | +| Llama-3.1-Nemotron-70B-Instruct-HF | 54.9% | 99.2% | `(via glhf.chat)` | whole | +| Yi Coder 9B Chat | 54.1% | 100.0% | `aider --model openai/hf:01-ai/Yi-Coder-9B-Chat --openai-api-base https://glhf.chat/api/openai/v1` | whole | +| ollama/qwen2.5:32b | 54.1% | 100.0% | `aider --model ollama/qwen2.5:32b` | whole | +| Nova Pro | 54.1% | 100.0% | `aider --model bedrock/us.amazon.nova-pro-v1:0` | whole | +| gemini-1.5-flash-exp-0827 | 52.6% | 100.0% | `aider --model gemini/gemini-1.5-flash-exp-0827` | whole | +| qwen2.5-coder:7b-instruct-q8_0 | 51.9% | 100.0% | `aider --model ollama/qwen2.5-coder:7b-instruct-q8_0` | whole | +| codestral-2405 | 51.1% | 100.0% | `aider --model mistral/codestral-2405` | whole | +| gemini-1.5-flash-002 (0924) | 51.1% | 100.0% | `aider --model gemini/gemini-1.5-flash-002` | whole | +| gpt-3.5-turbo-0125 | 50.4% | 100.0% | `aider -3` | whole | +| gpt-3.5-turbo-0613 | 50.4% | 100.0% | `aider --model gpt-3.5-turbo-0613` | whole | +| qwen2:72b-instruct-q8_0 | 49.6% | 100.0% | `aider --model ollama/qwen2:72b-instruct-q8_0` | whole | +| llama3-70b-8192 | 49.2% | 73.5% | `aider --model groq/llama3-70b-8192` | diff | +| codestral:22b-v0.1-q8_0 | 48.1% | 100.0% | `aider --model ollama/codestral:22b-v0.1-q8_0` | whole | +| Codestral-22B-v0.1-Q4_K_M | 48.1% | 100.0% | `aider --model Codestral-22B-v0.1-Q4_K_M` | whole | +| claude-3-haiku-20240307 | 47.4% | 100.0% | `aider --model claude-3-haiku-20240307` | whole | +| ollama/codestral | 45.9% | 98.5% | `aider --model ollama/codestral` | whole | +| yi-coder:9b-chat-q4_0 | 45.1% | 100.0% | `aider --model ollama/yi-coder:9b-chat-q4_0` | whole | +| WizardLM-2 8x22B | 44.4% | 100.0% | `aider --model openrouter/microsoft/wizardlm-2-8x22b` | whole | +| gemini-1.5-flash-latest | 44.4% | 100.0% | `aider --model gemini/gemini-1.5-flash-latest` | whole | +| ollama/yi-coder:9b-chat-fp16 | 43.6% | 99.2% | `aider --model ollama/yi-coder:9b-chat-fp16` | whole | +| Reflection-70B | 42.1% | 100.0% | `(not currently supported)` | whole | +| Qwen2.5-Coder-3B-Instruct | 39.1% | 100.0% | `aider --model openai/Qwen2.5-Coder-3B-Instruct` | whole | +| gemini-1.5-flash-8b-exp-0827 | 38.3% | 100.0% | `aider --model gemini/gemini-1.5-flash-8b-exp-0827` | whole | +| Command R+ (08-24) | 38.3% | 100.0% | `aider --model command-r-plus-08-2024` | whole | +| Command R (08-24) | 38.3% | 100.0% | `aider --model command-r-08-2024` | whole | +| gemini-1.5-flash-8b-exp-0924 | 38.3% | 100.0% | `aider --model gemini/gemini-1.5-flash-8b-exp-0924` | whole | +| ollama/mistral-small | 38.3% | 99.2% | `aider --model ollama/mistral-small` | whole | +| qwen1.5-110b-chat | 37.6% | 100.0% | `aider --model together_ai/qwen/qwen1.5-110b-chat` | whole | +| llama-3.1-8b-instruct | 37.6% | 100.0% | `aider --model fireworks_ai/accounts/fireworks/models/llama-v3p1-8b-instruct` | whole | +| gemma2:27b-instruct-q8_0 | 36.1% | 100.0% | `aider --model ollama/gemma2:27b-instruct-q8_0` | whole | +| codeqwen:7b-chat-v1.5-q8_0 | 34.6% | 100.0% | `aider --model ollama/codeqwen:7b-chat-v1.5-q8_0` | whole | +| ollama/mistral-nemo:12b-instruct-2407-q4_K_M | 33.1% | 100.0% | `aider --model ollama/mistral-nemo:12b-instruct-2407-q4_K_M` | whole | +| ollama/codegeex4 | 32.3% | 97.0% | `aider --model ollama/codegeex4` | whole | +| command-r-plus | 31.6% | 100.0% | `aider --model command-r-plus` | whole | +| Qwen2.5-Coder-1.5B-Instruct | 31.6% | 100.0% | `aider --model openai/Qwen2.5-Coder-1.5B-Instruct` | whole | +| ollama/wojtek/opencodeinterpreter:6.7b | 30.1% | 91.0% | `aider --model ollama/wojtek/opencodeinterpreter:6.7b` | whole | +| ollama/hermes3:8b-llama3.1-fp16 | 30.1% | 98.5% | `aider --model ollama/hermes3:8b-llama3.1-fp16` | whole | +| o1-mini-2024-09-12 | 27.1% | 95.6% | `aider --model o1-mini` | whole | +| ollama/llama3.2:3b-instruct-fp16 | 26.3% | 97.0% | `aider --model ollama/llama3.2:3b-instruct-fp16` | whole | +| ollama/tulu3 | 26.3% | 100.0% | `aider --model ollama/tulu3` | whole | +| ollama/hermes3 | 22.6% | 98.5% | `aider --model ollama/hermes3` | whole | +| ollama/granite3-dense:8b | 20.3% | 78.9% | `aider --model ollama/granite3-dense:8b` | whole | +| Qwen2.5-Coder-0.5B-Instruct | 14.3% | 100.0% | `aider --model openai/Qwen2.5-Coder-0.5B-Instruct` | whole | ## Notes on benchmarking results @@ -82,52 +123,12 @@ The key benchmarking results are: ## Notes on the edit format -cecli uses different "edit formats" to collect code edits from different LLMs. -The "whole" format is the easiest for an LLM to use, but it uses a lot of tokens -and may limit how large a file can be edited. -Models which can use one of the diff formats are much more efficient, -using far fewer tokens. -Models that use a diff-like format are able to -edit larger files with less cost and without hitting token limits. +Cecli uses different "edit formats" to collect code edits from different LLMs. The "whole" format is the easiest for an LLM to use, but it uses a lot of tokens and may limit how large a file can be edited. Models which can use one of the diff formats are much more efficient, using far fewer tokens. Models that use a diff-like format are able to edit larger files with less cost and without hitting token limits. -cecli is configured to use the best edit format for the popular OpenAI and Anthropic models -and the [other models recommended on the LLM page](/docs/llms.html). -For lesser known models cecli will default to using the "whole" editing format -since it is the easiest format for an LLM to use. +Cecli is configured to use the best edit format for the popular OpenAI and Anthropic models and the [other models recommended on the LLM page](../llms.html). For lesser known models cecli will default to using the "whole" editing format since it is the easiest format for an LLM to use. ## Contributing benchmark results -Contributions of benchmark results are welcome! -See the -[benchmark README](https://github.com/cecli-dev/cecli/blob/main/benchmark/README.md) -for information on running cecli's code editing benchmarks. -Submit results by opening a PR with edits to the -[benchmark results data files](https://github.com/cecli-dev/cecli/blob/main/cecli/website/_data/). - - - +By Paul Gauthier, last updated April 12, 2025. diff --git a/cecli/website/docs/leaderboards/index.md b/cecli/website/docs/leaderboards/index.md index 131dd9beac8..7ddc7c7eeff 100644 --- a/cecli/website/docs/leaderboards/index.md +++ b/cecli/website/docs/leaderboards/index.md @@ -8,281 +8,82 @@ has_children: true # LLM Leaderboards -cecli excels with LLMs skilled at writing and *editing* code, -and uses benchmarks to -evaluate an LLM's ability to follow instructions and edit code successfully without -human intervention. -[Aider's polyglot benchmark](https://cecli.dev/2024/12/21/polyglot.html#the-polyglot-benchmark) tests LLMs on 225 challenging Exercism coding exercises across C++, Go, Java, JavaScript, Python, and Rust. - -

cecli polyglot coding leaderboard

- -
- -
- - - -
- -
- - - - - - - - - - - - - - {% assign max_cost = 0 %} - {% for row in site.data.polyglot_leaderboard %} - {% if row.total_cost > max_cost %} - {% assign max_cost = row.total_cost %} - {% endif %} - {% endfor %} - {% if max_cost == 0 %}{% assign max_cost = 1 %}{% endif %} - {% assign edit_sorted = site.data.polyglot_leaderboard | sort: 'pass_rate_2' | reverse %} - {% for row in edit_sorted %} {% comment %} Add loop index for unique IDs {% endcomment %} - {% assign row_index = forloop.index0 %} - - - - - - - - - - - - {% endfor %} - -
- - ModelPercent correctCostCorrect edit formatEdit Format
- - - {{ row.model }} -
- {{ row.pass_rate_2 }}% -
- {% if row.total_cost > 0 %} -
- {% endif %} - {% assign rounded_cost = row.total_cost | times: 1.0 | round: 2 %} - {% if row.total_cost == 0 or rounded_cost == 0.00 %}{% else %}${{ rounded_cost }}{% endif %} -
{{ row.percent_cases_well_formed }}%{{ row.edit_format }}
- - - - - - +Cecli excels with LLMs skilled at writing and *editing* code, and uses benchmarks to evaluate an LLM's ability to follow instructions and edit code successfully without human intervention. [Aider's polyglot benchmark](https://cecli.dev/2024/12/21/polyglot.html#the-polyglot-benchmark) tests LLMs on 225 challenging Exercism coding exercises across C++, Go, Java, JavaScript, Python, and Rust. + +## cecli polyglot coding leaderboard + +| Model | Percent correct | Cost | Correct edit format | Edit format | +|---|---|---|---|---| +| gpt-5 (high) | 88.0% | $29.08 | 91.6% | diff | +| gpt-5 (medium) | 86.7% | $17.69 | 88.4% | diff | +| o3-pro (high) | 84.9% | $146.32 | 97.8% | diff | +| gemini-2.5-pro-preview-06-05 (32k think) | 83.1% | $49.88 | 99.6% | diff-fenced | +| o3 (high) | 81.3% | $21.23 | 94.7% | diff | +| gpt-5 (low) | 81.3% | $10.37 | 86.7% | diff | +| grok-4 (high) | 79.6% | $59.62 | 97.3% | diff | +| gemini-2.5-pro-preview-06-05 (default think) | 79.1% | $45.60 | 100.0% | diff-fenced | +| o3 (high) + gpt-4.1 | 78.2% | $17.55 | 100.0% | architect | +| Gemini 2.5 Pro Preview 05-06 | 76.9% | $37.41 | 97.3% | diff-fenced | +| o3 | 76.9% | $13.75 | 93.8% | diff | +| DeepSeek-V3.2-Exp (Reasoner) | 74.2% | $1.30 | 97.3% | diff | +| Gemini 2.5 Pro Preview 03-25 | 72.9% | | 92.4% | diff-fenced | +| o4-mini (high) | 72.0% | $19.64 | 90.7% | diff | +| claude-opus-4-20250514 (32k thinking) | 72.0% | $65.75 | 97.3% | diff | +| DeepSeek R1 (0528) | 71.4% | $4.80 | 94.6% | diff | +| claude-opus-4-20250514 (no think) | 70.7% | $68.63 | 98.7% | diff | +| DeepSeek-V3.2-Exp (Chat) | 70.2% | $0.88 | 98.2% | diff | +| claude-3-7-sonnet-20250219 (32k thinking tokens) | 64.9% | $36.83 | 97.8% | diff | +| DeepSeek R1 + claude-3-5-sonnet-20241022 | 64.0% | $13.29 | 100.0% | architect | +| o1-2024-12-17 (high) | 61.7% | $186.50 | 91.5% | diff | +| claude-sonnet-4-20250514 (32k thinking) | 61.3% | $26.58 | 97.3% | diff | +| o3-mini (high) | 60.4% | $18.16 | 93.3% | diff | +| claude-3-7-sonnet-20250219 (no thinking) | 60.4% | $17.72 | 93.3% | diff | +| Qwen3 235B A22B diff, no think, Alibaba API | 59.6% | | 92.9% | diff | +| Kimi K2 | 59.1% | $1.24 | 92.9% | diff | +| DeepSeek R1 | 56.9% | $5.42 | 96.9% | diff | +| claude-sonnet-4-20250514 (no thinking) | 56.4% | $15.82 | 98.2% | diff | +| DeepSeek V3 (0324) | 55.1% | $1.12 | 99.6% | diff | +| gemini-2.5-flash-preview-05-20 (24k think) | 55.1% | $8.56 | 95.6% | diff | +| Quasar Alpha | 54.7% | | 98.2% | diff | +| o3-mini (medium) | 53.8% | $8.86 | 95.1% | diff | +| Grok 3 Beta | 53.3% | $11.03 | 99.6% | diff | +| Optimus Alpha | 52.9% | | 97.3% | diff | +| gpt-4.1 | 52.4% | $9.86 | 98.2% | diff | +| claude-3-5-sonnet-20241022 | 51.6% | $14.41 | 99.6% | diff | +| Grok 3 Mini Beta (high) | 49.3% | $0.73 | 99.6% | whole | +| DeepSeek Chat V3 (prev) | 48.4% | $0.34 | 98.7% | diff | +| gemini-2.5-flash-preview-04-17 (default) | 47.1% | $1.85 | 85.3% | diff | +| chatgpt-4o-latest (2025-03-29) | 45.3% | $19.74 | 64.4% | diff | +| gpt-4.5-preview | 44.9% | $183.18 | 97.3% | diff | +| gemini-2.5-flash-preview-05-20 (no think) | 44.0% | $1.14 | 93.8% | diff | +| gpt-oss-120b (high) | 41.8% | $0.74 | 79.1% | diff | +| Qwen3 32B | 40.0% | $0.76 | 83.6% | diff | +| gemini-exp-1206 | 38.2% | | 98.2% | whole | +| Gemini 2.0 Pro exp-02-05 | 35.6% | | 100.0% | whole | +| Grok 3 Mini Beta (low) | 34.7% | $0.79 | 100.0% | whole | +| o1-mini-2024-09-12 | 32.9% | $18.58 | 96.9% | whole | +| gpt-4.1-mini | 32.4% | $1.99 | 92.4% | diff | +| claude-3-5-haiku-20241022 | 28.0% | $6.06 | 91.1% | diff | +| chatgpt-4o-latest (2025-02-15) | 27.1% | $14.37 | 93.3% | diff | +| QwQ-32B + Qwen 2.5 Coder Instruct | 26.2% | | 100.0% | architect | +| gpt-4o-2024-08-06 | 23.1% | $7.03 | 94.2% | diff | +| gemini-2.0-flash-exp | 22.2% | | 100.0% | whole | +| qwen-max-2025-01-25 | 21.8% | | 90.2% | diff | +| QwQ-32B | 20.9% | | 67.6% | diff | +| gpt-4o-2024-11-20 | 18.2% | $6.74 | 95.1% | diff | +| gemini-2.0-flash-thinking-exp-01-21 | 18.2% | | 77.8% | diff | +| DeepSeek Chat V2.5 | 17.8% | $0.51 | 92.9% | diff | +| Qwen2.5-Coder-32B-Instruct | 16.4% | | 99.6% | whole | +| Llama 4 Maverick | 15.6% | | 99.1% | whole | +| yi-lightning | 12.9% | | 92.9% | whole | +| command-a-03-2025-quality | 12.0% | | 99.6% | whole | +| Codestral 25.01 | 11.1% | $1.98 | 100.0% | whole | +| openhands-lm-32b-v0.1 | 10.2% | | 95.1% | whole | +| gpt-4.1-nano | 8.9% | $0.43 | 94.2% | whole | +| Qwen2.5-Coder-32B-Instruct | 8.0% | | 71.6% | diff | +| gemma-3-27b-it | 4.9% | | 100.0% | whole | +| gpt-4o-mini-2024-07-18 | 3.6% | $0.32 | 100.0% | whole | + +The full per-run details for each model (command, date, error counts, token usage, etc.) are maintained in [`cecli/website/_data/polyglot_leaderboard.yml`](https://github.com/cecli-dev/cecli/blob/main/cecli/website/_data/polyglot_leaderboard.yml) in the repository. + +By Paul Gauthier, last updated November 20, 2025. diff --git a/cecli/website/docs/leaderboards/notes.md b/cecli/website/docs/leaderboards/notes.md index 7fcfca0c044..a075aa164ab 100644 --- a/cecli/website/docs/leaderboards/notes.md +++ b/cecli/website/docs/leaderboards/notes.md @@ -7,11 +7,7 @@ nav_order: 800 ## Notes on pricing -All pricing information is the cost to run the benchmark at the time it was -run. -Providers change their pricing and sometimes introduce entirely novel pricing structures. -Pricing is provided on a *best efforts* basis, and may not always be current -or fully accurate. +All pricing information is the cost to run the benchmark at the time it was run. Providers change their pricing and sometimes introduce entirely novel pricing structures. Pricing is provided on a *best efforts* basis, and may not always be current or fully accurate. ## Notes on benchmarking results @@ -23,15 +19,6 @@ The key benchmarking results are: ## Notes on the edit format -cecli uses different "edit formats" to collect code edits from different LLMs. -The "whole" format is the easiest for an LLM to use, but it uses a lot of tokens -and may limit how large a file can be edited. -Models which can use one of the diff formats are much more efficient, -using far fewer tokens. -Models that use a diff-like format are able to -edit larger files with less cost and without hitting token limits. - -cecli is configured to use the best edit format for the popular OpenAI and Anthropic models -and the [other models recommended on the LLM page](/docs/llms.html). -For lesser known models cecli will default to using the "whole" editing format -since it is the easiest format for an LLM to use. +Cecli uses different "edit formats" to collect code edits from different LLMs. The "whole" format is the easiest for an LLM to use, but it uses a lot of tokens and may limit how large a file can be edited. Models which can use one of the diff formats are much more efficient, using far fewer tokens. Models that use a diff-like format are able to edit larger files with less cost and without hitting token limits. + +Cecli is configured to use the best edit format for the popular OpenAI and Anthropic models and the [other models recommended on the LLM page](../llms.html). For lesser known models cecli will default to using the "whole" editing format since it is the easiest format for an LLM to use. diff --git a/cecli/website/docs/leaderboards/refactor.md b/cecli/website/docs/leaderboards/refactor.md index 5a7f9458dcb..f7ba09cec54 100644 --- a/cecli/website/docs/leaderboards/refactor.md +++ b/cecli/website/docs/leaderboards/refactor.md @@ -8,71 +8,25 @@ description: Quantitative benchmark of LLM code refactoring skill. ## Refactoring leaderboard -[cecli's refactoring benchmark](https://github.com/cecli-AI/refactor-benchmark) asks the LLM to refactor 89 large methods from large python classes. This is a more challenging benchmark, which tests the model's ability to output long chunks of code without skipping sections or making mistakes. It was developed to provoke and measure [GPT-4 Turbo's "lazy coding" habit](/2023/12/21/unified-diffs.html). - -The refactoring benchmark requires a large context window to -work with large source files. -Therefore, results are available for fewer models. - - - - - - - - - - - - - - - {% assign refac_sorted = site.data.refactor_leaderboard | sort: 'pass_rate_1' | reverse %} - {% for row in refac_sorted %} - - - - - - - - {% endfor %} - -
ModelPercent completed correctlyPercent using correct edit formatCommandEdit format
{{ row.model }}{{ row.pass_rate_1 }}%{{ row.percent_cases_well_formed }}%{{ row.command }}{{ row.edit_format }}
- - - - - - - - +[cecli's refactoring benchmark](https://github.com/cecli-AI/refactor-benchmark) asks the LLM to refactor 89 large methods from large python classes. This is a more challenging benchmark, which tests the model's ability to output long chunks of code without skipping sections or making mistakes. It was developed to provoke and measure [GPT-4 Turbo's "lazy coding" habit](https://cecli.dev/2023/12/21/unified-diffs.html). + +The refactoring benchmark requires a large context window to work with large source files. Therefore, results are available for fewer models. + +| Model | Percent completed correctly | Percent using correct edit format | Command | Edit format | +|---|---|---|---|---| +| claude-3-5-sonnet-20241022 | 92.1% | 91.0% | `aider --sonnet` | diff | +| o1-preview | 75.3% | 57.3% | `aider --model o1-preview` | diff | +| claude-3-opus-20240229 | 72.3% | 79.5% | `aider --opus` | diff | +| claude-3.5-sonnet-20240620 | 64.0% | 76.4% | `aider --sonnet` | diff | +| gpt-4o | 62.9% | 53.9% | `aider` | diff | +| gpt-4-1106-preview | 50.6% | 39.3% | `aider --model gpt-4-1106-preview` | udiff | +| gemini/gemini-1.5-pro-latest | 49.4% | 7.9% | `aider --model gemini/gemini-1.5-pro-latest` | diff-fenced | +| gpt-4o-2024-08-06 | 49.4% | 89.9% | `aider --model openai/gpt-4o-2024-08-06` | diff | +| o1-mini | 44.9% | 29.2% | `aider --model o1-mini` | diff | +| gpt-4-turbo-2024-04-09 (udiff) | 34.1% | 30.7% | `aider --gpt-4-turbo` | udiff | +| gpt-4-0125-preview | 33.7% | 47.2% | `aider --model gpt-4-0125-preview` | udiff | +| DeepSeek Coder V2 0724 (deprecated) | 32.6% | 59.6% | `aider --model deepseek/deepseek-coder` | diff | +| DeepSeek Chat V2.5 | 31.5% | 67.4% | `aider --deepseek` | diff | +| gpt-4-turbo-2024-04-09 (diff) | 21.4% | 6.8% | `aider --model gpt-4-turbo-2024-04-09` | diff | + +By Paul Gauthier, last updated April 12, 2025. diff --git a/cecli/website/docs/legal/contributor-agreement.md b/cecli/website/docs/legal/contributor-agreement.md index d16add56de4..15a3fd3b0c8 100644 --- a/cecli/website/docs/legal/contributor-agreement.md +++ b/cecli/website/docs/legal/contributor-agreement.md @@ -1,23 +1,11 @@ Individual Contributor License Agreement -Thank you for your interest in cecli AI LLC ("cecli AI"). -To clarify the intellectual property license -granted with Contributions from any person or entity, cecli AI -must have on file a signed Contributor License Agreement ("CLA") -from each Contributor, indicating agreement with the license -terms below. This agreement is for your protection as a Contributor -as well as the protection of cecli AI and its users. It does not -change your rights to use your own Contributions for any other purpose. +Thank you for your interest in cecli AI LLC ("cecli AI"). To clarify the intellectual property license granted with Contributions from any person or entity, cecli AI must have on file a signed Contributor License Agreement ("CLA") from each Contributor, indicating agreement with the license terms below. This agreement is for your protection as a Contributor as well as the protection of cecli AI and its users. It does not change your rights to use your own Contributions for any other purpose. -Please complete and sign this Agreement. Read this document carefully -before signing and keep a copy for your records. +Please complete and sign this Agreement. Read this document carefully before signing and keep a copy for your records. -You accept and agree to the following terms and conditions for Your -Contributions (present and future) that you submit to cecli AI. -Except for the license granted herein to cecli AI and recipients -of software distributed by cecli AI, You reserve all right, title, -and interest in and to Your Contributions. +You accept and agree to the following terms and conditions for Your Contributions (present and future) that you submit to cecli AI. Except for the license granted herein to cecli AI and recipients of software distributed by cecli AI, You reserve all right, title, and interest in and to Your Contributions. 1. Definitions. diff --git a/cecli/website/docs/legal/privacy.md b/cecli/website/docs/legal/privacy.md index 6c1aca386d7..890e2cf3969 100644 --- a/cecli/website/docs/legal/privacy.md +++ b/cecli/website/docs/legal/privacy.md @@ -5,8 +5,7 @@ nav_order: 500 # Privacy policy -[cecli AI LLC](/docs/faq.html#what-is-cecli-ai-llc) -(“cecli,” “we,” “our,” and/or “us”) values the privacy of individuals who use our website, programming tools, and related services (collectively, our “Services”). This privacy policy (the “Privacy Policy”) explains how we collect, use, and disclose information from users of our Services. By using our Services, you agree to the collection, use, disclosure, and procedures this Privacy Policy describes. +[cecli AI LLC](contributor-agreement.html) (“cecli,” “we,” “our,” and/or “us”) values the privacy of individuals who use our website, programming tools, and related services (collectively, our “Services”). This privacy policy (the “Privacy Policy”) explains how we collect, use, and disclose information from users of our Services. By using our Services, you agree to the collection, use, disclosure, and procedures this Privacy Policy describes. ### Information We Collect @@ -26,7 +25,6 @@ We may collect a variety of information from or about you or your devices from v **Information from Cookies and Other Tracking Technologies.** We and our third-party partners may collect information about your activities on our Services using cookies, pixel tags, SDKs, or other tracking technologies. Our third-party partners, such as analytics and security partners, may also use these technologies to collect information about your online activities over time and across different services. - ### How We Use the Information We Collect We use the information we collect: @@ -55,9 +53,7 @@ We use the information we collect: ### Your Choices -**Analytics Information.** You can turn off analytics collection when using our programming tools. Please visit this -[documentation page](/docs/more/analytics.html) -for more information about the data collected and your options. +**Analytics Information.** You can turn off analytics collection when using our programming tools. Please visit this [documentation page](../more/analytics.html) for more information about the data collected and your options. ### Third Parties @@ -75,7 +71,6 @@ We do not knowingly collect, maintain, or use personal information from children Our Services are hosted in the United States and intended for visitors located within the United States. If you choose to use the Services from the European Union or other regions of the world with laws governing data collection and use that may differ from U.S. law, then please note that you are transferring your personal information outside of those regions to the U.S. for storage and processing. We may also transfer your data from the U.S. to other countries or regions in connection with storage and processing of data, fulfilling your requests, and operating the Services. By providing any information, including personal information, on or to the Services, you consent to such transfer, storage, and processing. - ### Changes to this Privacy Policy We will post any adjustments to the Privacy Policy on this page, and the revised version will be effective when it is posted. If we materially change the ways in which we use or disclose personal information previously collected from you through the Services, we will notify you through the Services, by email, or other communication. @@ -88,17 +83,6 @@ If you have any questions, comments, or concerns about our processing activities diff --git a/cecli/website/docs/llms.md b/cecli/website/docs/llms.md index cdb508182ac..324723e4d14 100644 --- a/cecli/website/docs/llms.md +++ b/cecli/website/docs/llms.md @@ -6,38 +6,25 @@ description: cecli can connect to most LLMs for AI pair programming. --- ## Recommended models -{: .no_toc } -cecli works best with these models, which are skilled at editing code: +Cecli works best with these models, which are skilled at editing code: -- [Gemini 3+](/docs/llms/gemini.html) -- [DeepSeek V4+](/docs/llms/deepseek.html) -- [Claude 4+](/docs/llms/anthropic.html) -- [GPT 5+](/docs/llms/openai.html) +- [Gemini 3+](llms/gemini.html) +- [DeepSeek V4+](llms/deepseek.html) +- [Claude 4+](llms/anthropic.html) +- [GPT 5+](llms/openai.html) ## Free models -{: .no_toc } -cecli works with a number of **free** API providers: +Cecli works with a number of **free** API providers: - [OpenRouter offers free access to many models](https://openrouter.ai/models/?q=free), with limitations on daily usage. ## Local models -{: .no_toc } -cecli can also work with local models, for example using [Ollama](/docs/llms/ollama.html). -It can also access -local models that provide an -[Open AI compatible API](/docs/llms/openai-compat.html). +Cecli can also work with local models, for example using [Ollama](llms/ollama.html). It can also access local models that provide an [Open AI compatible API](llms/openai-compat.html). ## Use a capable model -{: .no_toc } - -Be aware that cecli may not work well with less capable models. -If you see the model returning code, but cecli isn't able to edit your files -and commit the changes... -this is usually because the model isn't capable of properly -returning "code edits". -Models weaker than GPT 4o may have problems working well with cecli. +Be aware that cecli may not work well with less capable models. If you see the model returning code, but cecli isn't able to edit your files and commit the changes... this is usually because the model isn't capable of properly returning "code edits". Models weaker than GPT 4o may have problems working well with cecli. diff --git a/cecli/website/docs/llms/anthropic.md b/cecli/website/docs/llms/anthropic.md index ebcfa132c17..0aae89011c8 100644 --- a/cecli/website/docs/llms/anthropic.md +++ b/cecli/website/docs/llms/anthropic.md @@ -5,14 +5,13 @@ nav_order: 200 # Anthropic -To work with Anthropic's models, you need to provide your -[Anthropic API key](https://docs.anthropic.com/claude/reference/getting-started-with-the-api) -either in the `ANTHROPIC_API_KEY` environment variable or -via the `--anthropic-api-key` command line switch. +To work with Anthropic's models, you need to provide your [Anthropic API key](https://docs.anthropic.com/claude/reference/getting-started-with-the-api) either in the `ANTHROPIC_API_KEY` environment variable or via the `--anthropic-api-key` command line switch. First, install cecli: -{% include install.md %} +```bash +uv tool install cecli-dev +``` Then configure your API keys: @@ -34,26 +33,15 @@ cecli cecli --list-models anthropic/ ``` -{: .tip } -Anthropic has very low rate limits. -You can access all the Anthropic models via -[OpenRouter](openrouter.md) -or [Google Vertex AI](vertex.md) -with more generous rate limits. +> **Tip:** Anthropic has very low rate limits. You can access all the Anthropic models via [OpenRouter](openrouter.md) or [Google Vertex AI](vertex.md) with more generous rate limits. -You can use `cecli --model ` to use any other Anthropic model. -For example, if you want to use a specific version of Opus -you could do `cecli --model claude-3-opus-20240229`. +You can use `cecli --model ` to use any other Anthropic model. For example, if you want to use a specific version of Opus you could do `cecli --model claude-3-opus-20240229`. ## Thinking tokens -cecli can work with Sonnet 3.7's new thinking tokens, but does not ask Sonnet to use -thinking tokens by default. +Cecli can work with Sonnet 3.7's new thinking tokens, but does not ask Sonnet to use thinking tokens by default. -Enabling thinking currently requires manual configuration. -You need to add the following to your `.cecli.model.settings.yml` -[model settings file](/docs/config/adv-model-settings.html#model-settings). -Adjust the `budget_tokens` value to change the target number of thinking tokens. +Enabling thinking currently requires manual configuration. You need to add the following to your `.cecli.model.settings.yml` [model settings file](../config/adv-model-settings.html#advanced-model-settings-model-settings). Adjust the `budget_tokens` value to change the target number of thinking tokens. ```yaml - name: anthropic/claude-3-7-sonnet-20250219 diff --git a/cecli/website/docs/llms/azure.md b/cecli/website/docs/llms/azure.md index 8513ec03833..1043dc5607e 100644 --- a/cecli/website/docs/llms/azure.md +++ b/cecli/website/docs/llms/azure.md @@ -5,11 +5,13 @@ nav_order: 500 # Azure -cecli can connect to the OpenAI models on Azure. +Cecli can connect to the OpenAI models on Azure. First, install cecli: -{% include install.md %} +```bash +uv tool install cecli-dev +``` Then configure your API keys and endpoint: @@ -38,11 +40,10 @@ cecli --model azure/ cecli --list-models azure/ ``` -Note that cecli will also use environment variables -like `AZURE_OPENAI_API_xxx`. +Note that cecli will also use environment variables like `AZURE_OPENAI_API_xxx`. The `cecli --list-models azure/` command will list all models that cecli supports through Azure, not the models that are available for the provided endpoint. When setting the model to use with `--model azure/`, `` is likely just the name of the model you have deployed to the endpoint for example `o3-mini` or `gpt-4o`. The screenshow below shows `o3-mini` and `gpt-4o` deployments in the Azure portal done under the `myendpt` resource. -![example azure deployment](/assets/azure-deployment.png) \ No newline at end of file +![example azure deployment](/assets/azure-deployment.png) diff --git a/cecli/website/docs/llms/bedrock.md b/cecli/website/docs/llms/bedrock.md index 2c672906c34..673b3c80f14 100644 --- a/cecli/website/docs/llms/bedrock.md +++ b/cecli/website/docs/llms/bedrock.md @@ -5,41 +5,28 @@ nav_order: 560 # Amazon Bedrock -cecli can connect to models provided by Amazon Bedrock. -To configure cecli to use the Amazon Bedrock API, you need to set up your AWS credentials. -This can be done using the AWS CLI or by setting environment variables. +Cecli can connect to models provided by Amazon Bedrock. To configure cecli to use the Amazon Bedrock API, you need to set up your AWS credentials. This can be done using the AWS CLI or by setting environment variables. ## Select a Model from Amazon Bedrock -Before you can use a model through Amazon Bedrock, you must "enable" the model under the **Model -Access** screen in the AWS Management Console. -To find the `Model ID`, open the **Model Catalog** area in the Bedrock console, select the model -you want to use, and the find the `modelId` property under the "Usage" heading. +Before you can use a model through Amazon Bedrock, you must "enable" the model under the **Model Access** screen in the AWS Management Console. To find the `Model ID`, open the **Model Catalog** area in the Bedrock console, select the model you want to use, and the find the `modelId` property under the "Usage" heading. ### Bedrock Inference Profiles -Amazon Bedrock has added support for a new feature called [cross-region "inference profiles."](https://aws.amazon.com/about-aws/whats-new/2024/09/amazon-bedrock-knowledge-bases-cross-region-inference/) -Some models hosted in Bedrock _only_ support these inference profiles. -If you're using one of these models, then you will need to use the `Inference Profile ID` -instead of the `Model ID` from the **Model Catalog** screen, in the AWS Management Console. -For example, the Claude Sonnet 3.7 model, release in February 2025, exclusively supports -inference through inference profiles. To use this model, you would use the -`us.anthropic.claude-3-7-sonnet-20250219-v1:0` Inference Profile ID. -In the Amazon Bedrock console, go to Inference and Assessment ➡️ Cross-region Inference -to find the `Inference Profile ID` value. +Amazon Bedrock has added support for a new feature called [cross-region "inference profiles."](https://aws.amazon.com/about-aws/whats-new/2024/09/amazon-bedrock-knowledge-bases-cross-region-inference/) Some models hosted in Bedrock _only_ support these inference profiles. If you're using one of these models, then you will need to use the `Inference Profile ID` instead of the `Model ID` from the **Model Catalog** screen, in the AWS Management Console. For example, the Claude Sonnet 3.7 model, release in February 2025, exclusively supports inference through inference profiles. To use this model, you would use the `us.anthropic.claude-3-7-sonnet-20250219-v1:0` Inference Profile ID. In the Amazon Bedrock console, go to Inference and Assessment ➡️ Cross-region Inference to find the `Inference Profile ID` value. -If you attempt to use a `Model ID` for a model that exclusively supports the Inference Profile -feature, you will receive an error message like the following: +If you attempt to use a `Model ID` for a model that exclusively supports the Inference Profile feature, you will receive an error message like the following: > litellm.BadRequestError: BedrockException - b'{"message":"Invocation of model ID -anthropic.claude-3-7-sonnet-20250219-v1:0 with on-demand throughput isn\xe2\x80\x99t supported. Retry your -request with the ID or ARN of an inference profile that contains this model."}' +anthropic.claude-3-7-sonnet-20250219-v1:0 with on-demand throughput isn\xe2\x80\x99t supported. Retry your request with the ID or ARN of an inference profile that contains this model."}' ## Installation and Configuration First, install cecli: -{% include install.md %} +```bash +uv tool install cecli-dev +``` Next, configure your AWS credentials. This can be done using the AWS CLI or by setting environment variables. @@ -68,8 +55,7 @@ export AWS_SECRET_ACCESS_KEY=your_secret_key export AWS_PROFILE=your-profile ``` -You can add these to your -[.env file](/docs/config/dotenv.html). +You can add these to your [.env file](../config/dotenv.html). ### Set Environment Variables with PowerShell @@ -81,7 +67,6 @@ $env:AWS_SECRET_ACCESS_KEY = 'your_secret_key' $env:AWS_REGION = 'us-west-2' # Put whichever AWS region that you'd like, that the Bedrock service supports. ``` - ## Get Started Once your AWS credentials are set up, you can run cecli with the `--model` command line switch, specifying the Bedrock model you want to use: @@ -99,7 +84,6 @@ Sometimes it seems to help if you prefix the model name with "us.": cecli --model bedrock/us.anthropic.claude-3-5-sonnet-20240620-v1:0 ``` - ## Available Models To see some models available via Bedrock, run: @@ -128,5 +112,4 @@ pip install -U boto3 For more information on Amazon Bedrock and its models, refer to the [official AWS documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html). -Also, see the -[litellm docs on Bedrock](https://litellm.vercel.app/docs/providers/bedrock). +Also, see the [litellm docs on Bedrock](https://litellm.vercel.app/docs/providers/bedrock). diff --git a/cecli/website/docs/llms/cohere.md b/cecli/website/docs/llms/cohere.md index 3f3e23e0425..37169ddde7f 100644 --- a/cecli/website/docs/llms/cohere.md +++ b/cecli/website/docs/llms/cohere.md @@ -5,14 +5,13 @@ nav_order: 500 # Cohere -Cohere offers *free* API access to their models. -Their Command-R+ model works well with cecli -as a *very basic* coding assistant. -You'll need a [Cohere API key](https://dashboard.cohere.com/welcome/login). +Cohere offers *free* API access to their models. Their Command-R+ model works well with cecli as a *very basic* coding assistant. You'll need a [Cohere API key](https://dashboard.cohere.com/welcome/login). First, install cecli: -{% include install.md %} +```bash +uv tool install cecli-dev +``` Then configure your API keys: diff --git a/cecli/website/docs/llms/deepseek.md b/cecli/website/docs/llms/deepseek.md index 44b045cd01d..23a9c95a670 100644 --- a/cecli/website/docs/llms/deepseek.md +++ b/cecli/website/docs/llms/deepseek.md @@ -5,13 +5,13 @@ nav_order: 500 # DeepSeek -cecli can connect to the DeepSeek.com API. -To work with DeepSeek's models, you need to set the `DEEPSEEK_API_KEY` environment variable with your [DeepSeek API key](https://platform.deepseek.com/api_keys). -The DeepSeek Chat V3 model has a top score on cecli's code editing benchmark. +Cecli can connect to the DeepSeek.com API. To work with DeepSeek's models, you need to set the `DEEPSEEK_API_KEY` environment variable with your [DeepSeek API key](https://platform.deepseek.com/api_keys). The DeepSeek Chat V3 model has a top score on cecli's code editing benchmark. First, install cecli: -{% include install.md %} +```bash +uv tool install cecli-dev +``` Then configure your API keys: @@ -29,4 +29,3 @@ cd /to/your/project # Use DeepSeek Chat v3 cecli --model deepseek/deepseek-chat ``` - diff --git a/cecli/website/docs/llms/gemini.md b/cecli/website/docs/llms/gemini.md index 17a0acb09be..70754d32da0 100644 --- a/cecli/website/docs/llms/gemini.md +++ b/cecli/website/docs/llms/gemini.md @@ -9,7 +9,9 @@ You'll need a [Gemini API key](https://aistudio.google.com/app/u/2/apikey). First, install cecli: -{% include install.md %} +```bash +uv tool install cecli-dev +``` Then configure your API keys: @@ -20,7 +22,6 @@ setx GEMINI_API_KEY # Windows, restart shell after setx Start working with cecli and Gemini on your codebase: - ```bash # Change directory into your codebase cd /to/your/project diff --git a/cecli/website/docs/llms/github.md b/cecli/website/docs/llms/github.md index 96f859ff1ac..ca0162e64d1 100644 --- a/cecli/website/docs/llms/github.md +++ b/cecli/website/docs/llms/github.md @@ -5,8 +5,7 @@ nav_order: 510 # GitHub Copilot -cecli can connect to GitHub Copilot’s LLMs because Copilot exposes a standard **OpenAI-style** -endpoint at: +Cecli can connect to GitHub Copilot’s LLMs because Copilot exposes a standard **OpenAI-style** endpoint at: ``` https://api.githubcopilot.com @@ -14,98 +13,10 @@ https://api.githubcopilot.com First, install cecli: -{% include install.md %} - ---- - -## Configure your environment - -```bash -# macOS/Linux -export OPENAI_API_BASE=https://api.githubcopilot.com -export OPENAI_API_KEY= - -# Windows (PowerShell) -setx OPENAI_API_BASE https://api.githubcopilot.com -setx OPENAI_API_KEY -# …restart the shell after setx commands -``` - ---- - -### Where do I get the token? -The easiest path is to sign in to Copilot from any JetBrains IDE (PyCharm, GoLand, etc). -After you authenticate a file appears: - -``` -~/.config/github-copilot/apps.json -``` - -On Windows the config can be found in: - -``` -~\AppData\Local\github-copilot\apps.json -``` - -Copy the `oauth_token` value – that string is your `OPENAI_API_KEY`. - -*Note:* tokens created by the Neovim **copilot.lua** plugin (old `hosts.json`) sometimes lack the -needed scopes. If you see “access to this endpoint is forbidden”, regenerate the token with a -JetBrains IDE. - ---- - -## Discover available models - -Copilot hosts many models (OpenAI, Anthropic, Google, etc). -List the models your subscription allows with: - ```bash -curl -s https://api.githubcopilot.com/models \ - -H "Authorization: Bearer $OPENAI_API_KEY" \ - -H "Content-Type: application/json" \ - -H "Copilot-Integration-Id: vscode-chat" | jq -r '.data[].id' -``` - -Each returned ID can be used with cecli by **prefixing it with `openai/`**: - -```bash -cecli --model openai/gpt-4o -# or -cecli --model openai/claude-3.7-sonnet-thought +uv tool install cecli-dev ``` --- -## Quick start - -```bash -# change into your project -cd /to/your/project - -# talk to Copilot -cecli --model openai/gpt-4o -``` - ---- - -## Optional config file (`~/.cecli.conf.yml`) - -```yaml -openai-api-base: https://api.githubcopilot.com -openai-api-key: "" -model: openai/gpt-4o -weak-model: openai/gpt-4o-mini -show-model-warnings: false -``` - ---- - -## FAQ - -* Calls made through cecli are billed through your Copilot subscription - (cecli will still print *estimated* costs). -* The Copilot docs explicitly allow third-party “agents” that hit this API – cecli is playing by - the rules. -* cecli talks directly to the REST endpoint—no web-UI scraping or browser automation. - +When you specify a github copilot model on start up (e.g. `github_copilot/gpt-5-mini`), [litellm](https://github.com/BerriAI/litellm) will enter a github auth workflow wherein you will connect to your github account with the provided auth code to grant the system access. Further details can be found [here](https://docs.litellm.ai/docs/providers/github_copilot). \ No newline at end of file diff --git a/cecli/website/docs/llms/groq.md b/cecli/website/docs/llms/groq.md index e7cde7c8657..d9687051c3c 100644 --- a/cecli/website/docs/llms/groq.md +++ b/cecli/website/docs/llms/groq.md @@ -5,14 +5,13 @@ nav_order: 400 # GROQ -Groq currently offers *free* API access to the models they host. -The Llama 3 70B model works -well with cecli and is comparable to GPT-3.5 in code editing performance. -You'll need a [Groq API key](https://console.groq.com/keys). +Groq currently offers *free* API access to the models they host. The Llama 3 70B model works well with cecli and is comparable to GPT-3.5 in code editing performance. You'll need a [Groq API key](https://console.groq.com/keys). First, install cecli: -{% include install.md %} +```bash +uv tool install cecli-dev +``` Then configure your API keys: @@ -32,5 +31,3 @@ cecli --model groq/llama3-70b-8192 # List models available from Groq cecli --list-models groq/ ``` - - diff --git a/cecli/website/docs/llms/lm-studio.md b/cecli/website/docs/llms/lm-studio.md index 1931ae9bd0d..17e1d2afa76 100644 --- a/cecli/website/docs/llms/lm-studio.md +++ b/cecli/website/docs/llms/lm-studio.md @@ -5,11 +5,13 @@ nav_order: 400 # LM Studio -cecli can connect to models served by LM Studio. +Cecli can connect to models served by LM Studio. First, install cecli: -{% include install.md %} +```bash +uv tool install cecli-dev +``` Then configure your API key and endpoint: @@ -34,6 +36,4 @@ cd /to/your/project cecli --model lm_studio/ ``` -See the [model warnings](warnings.html) -section for information on warnings which will occur -when working with models that cecli is not familiar with. +See the [model warnings](warnings.html) section for information on warnings which will occur when working with models that cecli is not familiar with. diff --git a/cecli/website/docs/llms/ollama.md b/cecli/website/docs/llms/ollama.md index fbbe22917b2..2d46304107b 100644 --- a/cecli/website/docs/llms/ollama.md +++ b/cecli/website/docs/llms/ollama.md @@ -5,11 +5,13 @@ nav_order: 500 # Ollama -cecli can connect to local Ollama models. +Cecli can connect to local Ollama models. First, install cecli: -{% include install.md %} +```bash +uv tool install cecli-dev +``` Then configure your Ollama API endpoint (usually the default): @@ -33,13 +35,9 @@ cd /to/your/project cecli --model ollama_chat/ ``` -{: .note } -Using `ollama_chat/` is recommended over `ollama/`. +> **Note:** Using `ollama_chat/` is recommended over `ollama/`. - -See the [model warnings](warnings.html) -section for information on warnings which will occur -when working with models that cecli is not familiar with. +See the [model warnings](warnings.html) section for information on warnings which will occur when working with models that cecli is not familiar with. ## API Key @@ -52,24 +50,14 @@ setx OLLAMA_API_KEY # Windows, restart shell after setx ## Setting the context window size -[Ollama uses a 2k context window by default](https://github.com/ollama/ollama/blob/main/docs/faq.md#how-can-i-specify-the-context-window-size), -which is very small for working with cecli. -It also **silently** discards context that exceeds the window. -This is especially dangerous because many users don't even realize that most of their data -is being discarded by Ollama. +[Ollama uses a 2k context window by default](https://github.com/ollama/ollama/blob/main/docs/faq.md#how-can-i-specify-the-context-window-size), which is very small for working with cecli. It also **silently** discards context that exceeds the window. This is especially dangerous because many users don't even realize that most of their data is being discarded by Ollama. -By default, cecli sets Ollama's context window -to be large enough for each request you send plus 8k tokens for the reply. -This ensures data isn't silently discarded by Ollama. +By default, cecli sets Ollama's context window to be large enough for each request you send plus 8k tokens for the reply. This ensures data isn't silently discarded by Ollama. -If you'd like you can configure a fixed sized context window instead -with an -[`.cecli.model.settings.yml` file](https://cecli.dev/docs/config/adv-model-settings.html#model-settings) -like this: +If you'd like you can configure a fixed sized context window instead with an [`.cecli.model.settings.yml` file](../config/adv-model-settings.html#advanced-model-settings-model-settings) like this: ``` - name: ollama/qwen2.5-coder:32b-instruct-fp16 extra_params: num_ctx: 65536 ``` - diff --git a/cecli/website/docs/llms/openai-compat.md b/cecli/website/docs/llms/openai-compat.md index 1eb96f19c43..b380d602097 100644 --- a/cecli/website/docs/llms/openai-compat.md +++ b/cecli/website/docs/llms/openai-compat.md @@ -5,11 +5,13 @@ nav_order: 500 # OpenAI compatible APIs -cecli can connect to any LLM which is accessible via an OpenAI compatible API endpoint. +Cecli can connect to any LLM which is accessible via an OpenAI compatible API endpoint. First, install cecli: -{% include install.md %} +```bash +uv tool install cecli-dev +``` Then configure your API key and endpoint: @@ -34,6 +36,4 @@ cd /to/your/project cecli --model openai/ ``` -See the [model warnings](warnings.html) -section for information on warnings which will occur -when working with models that cecli is not familiar with. +See the [model warnings](warnings.html) section for information on warnings which will occur when working with models that cecli is not familiar with. diff --git a/cecli/website/docs/llms/openai.md b/cecli/website/docs/llms/openai.md index 735056ffe48..5d7beb26a78 100644 --- a/cecli/website/docs/llms/openai.md +++ b/cecli/website/docs/llms/openai.md @@ -5,14 +5,13 @@ nav_order: 100 # OpenAI -To work with OpenAI's models, you need to provide your -[OpenAI API key](https://help.openai.com/en/articles/4936850-where-do-i-find-my-secret-api-key) -either in the `OPENAI_API_KEY` environment variable or -via the `--api-key openai=` command line switch. +To work with OpenAI's models, you need to provide your [OpenAI API key](https://help.openai.com/en/articles/4936850-where-do-i-find-my-secret-api-key) either in the `OPENAI_API_KEY` environment variable or via the `--api-key openai=` command line switch. First, install cecli: -{% include install.md %} +```bash +uv tool install cecli-dev +``` Then configure your API keys: @@ -40,19 +39,10 @@ cecli --model gpt-4o cecli --list-models openai/ ``` -You can use `cecli --model ` to use any other OpenAI model. -For example, if you want to use a specific version of GPT-4 Turbo -you could do `cecli --model gpt-4-0125-preview`. +You can use `cecli --model ` to use any other OpenAI model. For example, if you want to use a specific version of GPT-4 Turbo you could do `cecli --model gpt-4-0125-preview`. ## Reasoning models from other providers -Many of OpenAI's -"reasoning" models have restrictions on streaming and setting the temperature parameter. -Some also support different levels of "reasoning effort". -cecli is configured to work properly with these models -when served through major provider APIs and -has a `--reasoning-effort` setting. +Many of OpenAI's "reasoning" models have restrictions on streaming and setting the temperature parameter. Some also support different levels of "reasoning effort". cecli is configured to work properly with these models when served through major provider APIs and has a `--reasoning-effort` setting. -You may need to [configure reasoning model settings](/docs/config/reasoning.html) -if you are using them through another provider -and see errors related to temperature or system prompt. +You may need to [configure reasoning model settings](../config/reasoning.html) if you are using them through another provider and see errors related to temperature or system prompt. diff --git a/cecli/website/docs/llms/openrouter.md b/cecli/website/docs/llms/openrouter.md index f70fed8bb0d..902ee4186c8 100644 --- a/cecli/website/docs/llms/openrouter.md +++ b/cecli/website/docs/llms/openrouter.md @@ -5,12 +5,13 @@ nav_order: 500 # OpenRouter -cecli can connect to [models provided by OpenRouter](https://openrouter.ai/models?o=top-weekly): -You'll need an [OpenRouter API key](https://openrouter.ai/keys). +Cecli can connect to [models provided by OpenRouter](https://openrouter.ai/models?o=top-weekly): You'll need an [OpenRouter API key](https://openrouter.ai/keys). First, install cecli: -{% include install.md %} +```bash +uv tool install cecli-dev +``` Then configure your API keys: @@ -34,25 +35,18 @@ cecli --list-models openrouter/ In particular, many cecli users access Sonnet via OpenRouter: -{: .tip } -If you get errors, check your -[OpenRouter privacy settings](https://openrouter.ai/settings/privacy). -Be sure to "enable providers that may train on inputs" -to allow use of all models. +> **Tip:** If you get errors, check your [OpenRouter privacy settings](https://openrouter.ai/settings/privacy). Be sure to "enable providers that may train on inputs" to allow use of all models. ## Controlling provider selection -OpenRouter often has multiple providers serving each model. -You can control which OpenRouter providers are used for your requests in two ways: +OpenRouter often has multiple providers serving each model. You can control which OpenRouter providers are used for your requests in two ways: 1. By "ignoring" certain providers in your -[OpenRouter account settings](https://openrouter.ai/settings/preferences). -This disables those named providers across all the models that you access via OpenRouter. +[OpenRouter account settings](https://openrouter.ai/settings/preferences). This disables those named providers across all the models that you access via OpenRouter. 2. By configuring "provider routing" in a `.cecli.model.settings.yml` file. -Place that file in your home directory or the root of your git project, with -entries like this: +Place that file in your home directory or the root of your git project, with entries like this: ```yaml - name: openrouter/anthropic/claude-3.7-sonnet @@ -71,8 +65,4 @@ entries like this: See [OpenRouter's provider routing docs](https://openrouter.ai/docs/provider-routing) for full details on these settings. -See [Advanced model settings](https://cecli.dev/docs/config/adv-model-settings.html#model-settings) -for more details about model settings files. - - - +See [Advanced model settings](../config/adv-model-settings.html#advanced-model-settings-model-settings) for more details about model settings files. diff --git a/cecli/website/docs/llms/other.md b/cecli/website/docs/llms/other.md index 1f60c93d03d..8139695df7f 100644 --- a/cecli/website/docs/llms/other.md +++ b/cecli/website/docs/llms/other.md @@ -5,15 +5,9 @@ nav_order: 800 # Other LLMs -cecli uses the [litellm](https://docs.litellm.ai/docs/providers) package -to connect to hundreds of other models. -You can use `cecli --model ` to use any supported model. +Cecli uses the [litellm](https://docs.litellm.ai/docs/providers) package to connect to hundreds of other models. You can use `cecli --model ` to use any supported model. -To explore the list of supported models you can run `cecli --list-models ` -with a partial model name. -If the supplied name is not an exact match for a known model, cecli will -return a list of possible matching models. -For example: +To explore the list of supported models you can run `cecli --list-models ` with a partial model name. If the supplied name is not an exact match for a known model, cecli will return a list of possible matching models. For example: ``` $ cecli --list-models turbo @@ -27,34 +21,16 @@ Models which match "turbo": - ... ``` -See the [model warnings](warnings.html) -section for information on warnings which will occur -when working with models that cecli is not familiar with. +See the [model warnings](warnings.html) section for information on warnings which will occur when working with models that cecli is not familiar with. ## LiteLLM -cecli uses the LiteLLM package to connect to LLM providers. -The [LiteLLM provider docs](https://docs.litellm.ai/docs/providers) -contain more detail on all the supported providers, -their models and any required environment variables. - +Cecli uses the LiteLLM package to connect to LLM providers. The [LiteLLM provider docs](https://docs.litellm.ai/docs/providers) contain more detail on all the supported providers, their models and any required environment variables. ## Other API key variables -Here are the API key environment variables that are supported -by litellm. See their docs for more info. +Here are the API key environment variables that are supported by litellm. See their docs for more info. - - ALEPH_ALPHA_API_KEY - ALEPHALPHA_API_KEY - ANTHROPIC_API_KEY @@ -114,4 +90,3 @@ cog.out(''.join(lines)) - WX_API_KEY - XAI_API_KEY - XINFERENCE_API_KEY - diff --git a/cecli/website/docs/llms/vertex.md b/cecli/website/docs/llms/vertex.md index fb79f81b325..ae1b588bab7 100644 --- a/cecli/website/docs/llms/vertex.md +++ b/cecli/website/docs/llms/vertex.md @@ -5,24 +5,19 @@ nav_order: 550 # Vertex AI -cecli can connect to models provided by Google Vertex AI. -You will need to install the -[gcloud CLI](https://cloud.google.com/sdk/docs/install) and [login](https://cloud.google.com/sdk/docs/initializing) with a GCP account -or service account with permission to use the Vertex AI API. +Cecli can connect to models provided by Google Vertex AI. You will need to install the [gcloud CLI](https://cloud.google.com/sdk/docs/install) and [login](https://cloud.google.com/sdk/docs/initializing) with a GCP account or service account with permission to use the Vertex AI API. -With your chosen login method, the gcloud CLI should automatically set the -`GOOGLE_APPLICATION_CREDENTIALS` environment variable which points to the credentials file. +With your chosen login method, the gcloud CLI should automatically set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable which points to the credentials file. First, install cecli: -{% include install.md %} +```bash +uv tool install cecli-dev +``` -To configure cecli to use the Vertex AI API, you need to set `VERTEXAI_PROJECT` (the GCP project ID) -and `VERTEXAI_LOCATION` (the GCP region) [environment variables for cecli](/docs/config/dotenv.html). +To configure cecli to use the Vertex AI API, you need to set `VERTEXAI_PROJECT` (the GCP project ID) and `VERTEXAI_LOCATION` (the GCP region) [environment variables for cecli](../config/dotenv.html). -Note that Claude on Vertex AI is only available in certain GCP regions, -check [the model card](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet) -for your model to see which regions are supported. +Note that Claude on Vertex AI is only available in certain GCP regions, check [the model card](https://console.cloud.google.com/vertex-ai/publishers/anthropic/model-garden/claude-3-5-sonnet) for your model to see which regions are supported. Example `.env` file: @@ -40,8 +35,7 @@ cd /to/your/project cecli --model vertex_ai/claude-3-5-sonnet@20240620 ``` -Or you can use the [YAML config](/docs/config/cecli_conf.html) to set the model to any of the -models supported by Vertex AI. +Or you can use the [YAML config](../config/conf.html) to set the model to any of the models supported by Vertex AI. Example `.cecli.conf.yml` file: diff --git a/cecli/website/docs/llms/warnings.md b/cecli/website/docs/llms/warnings.md index 1034089f9de..4de920ca0bc 100644 --- a/cecli/website/docs/llms/warnings.md +++ b/cecli/website/docs/llms/warnings.md @@ -5,6 +5,67 @@ nav_order: 900 # Model warnings -{% include model-warnings.md %} +## Unknown context window size and token costs +``` +Model foobar: Unknown context window size and costs, using sane defaults. +``` +If you specify a model that cecli has never heard of, you will get +this warning. +This means cecli doesn't know the context window size and token costs +for that model. +Cecli will use an unlimited context window and assume the model is free, +so this is not usually a significant problem. + +See the docs on +[configuring advanced model settings](../config/adv-model-settings.html) +for details on how to remove this warning. + +> **Tip:** +> You can probably ignore the unknown context window size and token costs warning. + +## Did you mean? + +If cecli isn't familiar with the model you've specified, +it will suggest similarly named models. +This helps +in the case where you made a typo or mistake when specifying the model name. + +``` +Model gpt-5o: Unknown context window size and costs, using sane defaults. +Did you mean one of these? +- gpt-4o +``` + +## Missing environment variables + +You need to set the listed environment variables. +Otherwise you will get error messages when you start chatting with the model. + +``` +Model azure/gpt-4-turbo: Missing these environment variables: +- AZURE_API_BASE +- AZURE_API_VERSION +- AZURE_API_KEY +``` + +> **Tip:** +> On Windows, +> if you just set these environment variables using `setx` you may need to restart your terminal or +> command prompt for the changes to take effect. + +## Unknown which environment variables are required + +``` +Model gpt-5: Unknown which environment variables are required. +``` + +Cecli is unable verify the environment because it doesn't know +which variables are required for the model. +If required variables are missing, +you may get errors when you attempt to chat with the model. +You can look in the [cecli's LLM documentation](../llms.html) +or the +[litellm documentation](https://docs.litellm.ai/docs/providers) +to see if the required variables are listed there. diff --git a/cecli/website/docs/llms/xai.md b/cecli/website/docs/llms/xai.md index b0c2abd309f..f66d9be7da6 100644 --- a/cecli/website/docs/llms/xai.md +++ b/cecli/website/docs/llms/xai.md @@ -9,7 +9,9 @@ You'll need a [xAI API key](https://console.x.ai.). First, install cecli: -{% include install.md %} +```bash +uv tool install cecli-dev +``` Then configure your API keys: @@ -40,14 +42,8 @@ cecli --model xai/grok-3-mini-fast-beta cecli --list-models xai/ ``` -The Grok 3 Mini models support the `--reasoning-effort` flag. -See the [reasoning settings documentation](../config/reasoning.md) for details. -Example: +The Grok 3 Mini models support the `--reasoning-effort` flag. See the [reasoning settings documentation](../config/reasoning.md) for details. Example: ```bash cecli --model xai/grok-3-mini-beta --reasoning-effort high ``` - - - - diff --git a/cecli/website/docs/more-info.md b/cecli/website/docs/more-info.md index 555f82496f3..7fb32fc0d09 100644 --- a/cecli/website/docs/more-info.md +++ b/cecli/website/docs/more-info.md @@ -6,3 +6,13 @@ nav_order: 85 # More info See below for more info about cecli, including some advanced topics. + +- [Git integration](../git/) +- [Repository map](../repomap/) +- [Scripting cecli](../scripting/) +- [Supported languages](../languages/) + +- [Infinite output](../more/infinite-output/) +- [Edit formats](../more/edit-formats/) +- [Analytics](../more/analytics/) +- [Privacy policy](../legal/privacy/) diff --git a/cecli/website/docs/more/analytics.md b/cecli/website/docs/more/analytics.md index 2670eefeb97..a2f2538a28c 100644 --- a/cecli/website/docs/more/analytics.md +++ b/cecli/website/docs/more/analytics.md @@ -6,16 +6,13 @@ description: Opt-in, anonymous, no personal info. # Analytics -cecli can collect anonymous analytics to help -improve cecli's ability to work with LLMs, edit code and complete user requests. +Cecli can collect anonymous analytics to help improve cecli's ability to work with LLMs, edit code and complete user requests. ## Opt-in, anonymous, no personal info -Analytics are only collected if you agree and opt-in. -cecli respects your privacy and never collects your code, chat messages, keys or -personal info. +Analytics are only collected if you agree and opt-in. cecli respects your privacy and never collects your code, chat messages, keys or personal info. -cecli collects information on: +Cecli collects information on: - which LLMs are used and with how many tokens, - which of cecli's edit formats are used, @@ -23,13 +20,9 @@ cecli collects information on: - information about exceptions and errors, - etc -These analytics are associated with an anonymous, -randomly generated UUID4 user identifier. +These analytics are associated with an anonymous, randomly generated UUID4 user identifier. -This information helps improve cecli by identifying which models, edit formats, -features and commands are most used. -It also helps uncover bugs that users are experiencing, so that they can be fixed -in upcoming releases. +This information helps improve cecli by identifying which models, edit formats, features and commands are most used. It also helps uncover bugs that users are experiencing, so that they can be fixed in upcoming releases. ## Disabling analytics @@ -41,20 +34,13 @@ cecli --analytics-disable ## Enabling analytics -The `--[no-]analytics` switch controls whether analytics are enabled for the -current session: +The `--[no-]analytics` switch controls whether analytics are enabled for the current session: - `--analytics` will turn on analytics for the current session. -This will *not* have any effect if you have permanently disabled analytics -with `--analytics-disable`. -If this is the first time you have enabled analytics, cecli -will confirm you wish to opt-in to analytics. +This will *not* have any effect if you have permanently disabled analytics with `--analytics-disable`. If this is the first time you have enabled analytics, cecli will confirm you wish to opt-in to analytics. - `--no-analytics` will turn off analytics for the current session. - By default, if you don't provide `--analytics` or `--no-analytics`, -cecli will enable analytics for a random subset of users. -Such randomly selected users will be asked if they wish to opt-in to analytics. -This will never happen if you have permanently disabled analytics -with `--analytics-disable`. +Cecli will enable analytics for a random subset of users. Such randomly selected users will be asked if they wish to opt-in to analytics. This will never happen if you have permanently disabled analytics with `--analytics-disable`. ## Opting in @@ -63,7 +49,7 @@ The first time analytics are enabled, you will need to agree to opt-in. ``` cecli --analytics -cecli respects your privacy and never collects your code, prompts, chats, keys or any personal +Cecli respects your privacy and never collects your code, prompts, chats, keys or any personal info. For more info: https://cecli.dev/docs/more/analytics.html Allow collection of anonymous analytics to help improve cecli? (Y)es/(N)o [Yes]: @@ -76,24 +62,17 @@ If you say "no", analytics will be permanently disabled. ### Sample analytics data -To get a better sense of what type of data is collected, you can review some -[sample analytics logs](https://github.com/cecli-dev/cecli/blob/main/cecli/website/assets/sample-analytics.jsonl). -These are the last 1,000 analytics events from the author's -personal use of cecli, updated regularly. +To get a better sense of what type of data is collected, you can review some [sample analytics logs](https://github.com/cecli-dev/cecli/blob/main/cecli/website/assets/sample-analytics.jsonl). These are the last 1,000 analytics events from the author's personal use of cecli, updated regularly. ### Analytics code -Since cecli is open source, all the places where cecli collects analytics -are visible in the source code. -They can be viewed using -[GitHub search](https://github.com/search?q=repo%3Acecli-ai%2Fcecli+%22.event%28%22&type=code). +Since cecli is open source, all the places where cecli collects analytics are visible in the source code. They can be viewed using [GitHub search](https://github.com/search?q=repo%3Acecli-ai%2Fcecli+%22.event%28%22&type=code). ### Logging and inspecting analytics -You can get a full log of the analytics that cecli is collecting, -in case you would like to audit or inspect this data. +You can get a full log of the analytics that cecli is collecting, in case you would like to audit or inspect this data. ``` cecli --analytics-log filename.jsonl @@ -107,21 +86,16 @@ cecli --analytics-log filename.jsonl --no-analytics ### Sending analytics to custom PostHog project or installation -cecli uses PostHog for analytics collection. You can configure cecli to send analytics to your own PostHog project or a custom PostHog installation using these parameters: +Cecli uses PostHog for analytics collection. You can configure cecli to send analytics to your own PostHog project or a custom PostHog installation using these parameters: - `--analytics-posthog-project-api-key KEY` - Set a custom PostHog project API key - `--analytics-posthog-host HOST` - Set a custom PostHog host (default is app.posthog.com) ## Reporting issues -If you have concerns about any of the analytics that cecli is collecting -or our data practices -please contact us by opening a -[GitHub Issue](https://github.com/cecli-dev/cecli/issues). +If you have concerns about any of the analytics that cecli is collecting or our data practices please contact us by opening a [GitHub Issue](https://github.com/cecli-dev/cecli/issues). ## Privacy policy -Please see cecli's -[privacy policy](/docs/legal/privacy.html) -for more details. +Please see cecli's [privacy policy](../legal/privacy.html) for more details. diff --git a/cecli/website/docs/more/edit-formats.md b/cecli/website/docs/more/edit-formats.md index b40aec5d801..02c38d176a4 100644 --- a/cecli/website/docs/more/edit-formats.md +++ b/cecli/website/docs/more/edit-formats.md @@ -6,19 +6,11 @@ description: cecli uses various "edit formats" to let LLMs edit source files. # Edit formats -cecli uses various "edit formats" to let LLMs edit source files. -Different models work better or worse with different edit formats. -cecli is configured to use the optimal format for most popular, common models. -You can always force use of a specific edit format with -the `--edit-format` switch. +Cecli uses various "edit formats" to let LLMs edit source files. Different models work better or worse with different edit formats. cecli is configured to use the optimal format for most popular, common models. You can always force use of a specific edit format with the `--edit-format` switch. ## whole -The "whole" edit format is the simplest possible editing format. -The LLM is instructed to return a full, updated -copy of each source file that needs changes. -While simple, it can be slow and costly because the LLM has to return -the *entire file* even if just a few lines are edited. +The "whole" edit format is the simplest possible editing format. The LLM is instructed to return a full, updated copy of each source file that needs changes. While simple, it can be slow and costly because the LLM has to return the *entire file* even if just a few lines are edited. The whole format expects the file path just before the fenced file content: @@ -38,12 +30,9 @@ if __name__ == '__main__': ## diff -The "diff" edit format asks the LLM to specify file edits as a series of search/replace blocks. -This is an efficient format, because the model only needs to return parts of the file -which have changes. +The "diff" edit format asks the LLM to specify file edits as a series of search/replace blocks. This is an efficient format, because the model only needs to return parts of the file which have changes. -Edits are formatted using a syntax similar to the git merge conflict resolution markings, -with the file path right before a fenced block: +Edits are formatted using a syntax similar to the git merge conflict resolution markings, with the file path right before a fenced block: ```` mathweb/flask/app.py @@ -59,10 +48,7 @@ from flask import Flask ## diff-fenced -The "diff-fenced" edit format is based on the diff format, but -the file path is placed inside the fence. -It is primarily used with the Gemini family of models, -which often fail to conform to the fencing approach specified in the diff format. +The "diff-fenced" edit format is based on the diff format, but the file path is placed inside the fence. It is primarily used with the Gemini family of models, which often fail to conform to the fencing approach specified in the diff format. ```` ``` @@ -78,16 +64,9 @@ from flask import Flask ## udiff -The "udiff" edit format is based on the widely used unified diff format, -but [modified and simplified](/2023/12/21/unified-diffs.html). -This is an efficient format, because the model only needs to return parts of the file -which have changes. +The "udiff" edit format is based on the widely used unified diff format, but [modified and simplified](https://cecli.dev/2023/12/21/unified-diffs.html). This is an efficient format, because the model only needs to return parts of the file which have changes. -It was mainly used to the GPT-4 Turbo family of models, -because it reduced their "lazy coding" tendencies. -With other edit formats the GPT-4 Turbo models tended to elide -large sections of code and replace them with "# ... original code here ..." -style comments. +It was mainly used to the GPT-4 Turbo family of models, because it reduced their "lazy coding" tendencies. With other edit formats the GPT-4 Turbo models tended to elide large sections of code and replace them with "# ... original code here ..." style comments. ```` @@ -104,13 +83,4 @@ style comments. ## editor-diff and editor-whole -These are streamlined versions of the diff and whole formats, intended to be used -with `--editor-edit-format` when using -[architect mode](/docs/usage/modes.html). -The actual edit format is the same, but cecli uses a simpler prompt that -is more narrowly focused on just editing the file as opposed to -solving the coding task. -The architect model resolves the coding task and -provides plain text instructions about which file changes need to be made. -The editor interprets those instructions to produce the -syntactically correct diff or whole edits. +These are streamlined versions of the diff and whole formats, intended to be used with `--editor-edit-format` when using [architect mode](../usage/modes.html). The actual edit format is the same, but cecli uses a simpler prompt that is more narrowly focused on just editing the file as opposed to solving the coding task. The architect model resolves the coding task and provides plain text instructions about which file changes need to be made. The editor interprets those instructions to produce the syntactically correct diff or whole edits. diff --git a/cecli/website/docs/more/infinite-output.md b/cecli/website/docs/more/infinite-output.md index 32603e0cdf7..f3f9f528272 100644 --- a/cecli/website/docs/more/infinite-output.md +++ b/cecli/website/docs/more/infinite-output.md @@ -6,55 +6,21 @@ description: cecli can handle "infinite output" from models that support prefill # Infinite output -LLM providers limit how much output a model can generate from a single request. -This is usually called the output token limit. +LLM providers limit how much output a model can generate from a single request. This is usually called the output token limit. -cecli is able to work around this limit with models that support -"prefilling" the assistant response. -When you use cecli with a model that supports prefill, you will see -"infinite output" noted in the announcement lines displayed at launch: +Cecli is able to work around this limit with models that support "prefilling" the assistant response. When you use cecli with a model that supports prefill, you will see "infinite output" noted in the announcement lines displayed at launch: ``` cecli v0.58.0 Main model: claude-3-5-sonnet-20240620 with diff edit format, prompt cache, infinite output ``` -Models that support prefill can be primed to think they started their response -with a specific piece of text. -You can put words in their mouth, and they will continue generating -text from that point forward. +Models that support prefill can be primed to think they started their response with a specific piece of text. You can put words in their mouth, and they will continue generating text from that point forward. -When cecli is collecting code edits from a model and -it hits the output token limit, -cecli simply initiates another LLM request with the partial -response prefilled. -This prompts the model to continue where it left off, -generating more of the desired response. -This prefilling of the partially completed response can be repeated, -allowing for very long outputs. -Joining the text across these output limit boundaries -requires some heuristics, but is typically fairly reliable. +When cecli is collecting code edits from a model and it hits the output token limit, cecli simply initiates another LLM request with the partial response prefilled. This prompts the model to continue where it left off, generating more of the desired response. This prefilling of the partially completed response can be repeated, allowing for very long outputs. Joining the text across these output limit boundaries requires some heuristics, but is typically fairly reliable. -cecli supports "infinite output" for models that support "prefill", -such as: +Cecli supports "infinite output" for models that support "prefill", such as: - - anthropic.claude-3-5-haiku-20241022-v1:0 - anthropic.claude-3-5-sonnet-20241022-v2:0 - anthropic.claude-3-7-sonnet-20240620-v1:0 @@ -187,6 +153,3 @@ cog.out(model_list) - vertex_ai/claude-sonnet-4@20250514 - vertex_ai/deepseek-ai/deepseek-r1-0528-maas - vertex_ai/deepseek-ai/deepseek-v3.1-maas - - - diff --git a/cecli/website/docs/repomap.md b/cecli/website/docs/repomap.md index 67ea8bc75aa..60dbe6a4330 100644 --- a/cecli/website/docs/repomap.md +++ b/cecli/website/docs/repomap.md @@ -7,32 +7,13 @@ description: cecli uses a map of your git repository to provide code context to # Repository map -![robot flowchat](/assets/robot-ast.png) - -cecli -uses a **concise map of your whole git repository** -that includes -the most important classes and functions along with their types and call signatures. -This helps cecli understand the code it's editing -and how it relates to the other parts of the codebase. -The repo map also helps cecli write new code -that respects and utilizes existing libraries, modules and abstractions -found elsewhere in the codebase. +Cecli uses a **concise map of your whole git repository** that includes the most important classes and functions along with their types and call signatures. This helps cecli understand the code it's editing and how it relates to the other parts of the codebase. The repo map also helps cecli write new code that respects and utilizes existing libraries, modules and abstractions found elsewhere in the codebase. ## Using a repo map to provide context -cecli sends a **repo map** to the LLM along with -each change request from the user. -The repo map contains a list of the files in the -repo, along with the key symbols which are defined in each file. -It shows how each of these symbols are defined, by including the critical lines of code for each definition. +Cecli sends a **repo map** to the LLM along with each change request from the user. The repo map contains a list of the files in the repo, along with the key symbols which are defined in each file. It shows how each of these symbols are defined, by including the critical lines of code for each definition. -Here's a part of -the repo map of cecli's repo, for -[base_coder.py](https://github.com/cecli-dev/cecli/blob/main/cecli/coders/base_coder.py) -and -[commands.py](https://github.com/cecli-dev/cecli/blob/main/cecli/commands.py) -: +Here's a part of the repo map of cecli's repo, for [base_coder.py](https://github.com/cecli-dev/cecli/blob/main/cecli/coders/base_coder.py) and [commands.py](https://github.com/cecli-dev/cecli/blob/main/cecli/commands.py) : ``` cecli/coders/base_coder.py: @@ -75,38 +56,14 @@ Mapping out the repo like this provides some key benefits: ## Optimizing the map -Of course, for large repositories even just the repo map might be too large -for the LLM's context window. -cecli solves this problem by sending just the **most relevant** -portions of the repo map. -It does this by analyzing the full repo map using -a graph ranking algorithm, computed on a graph -where each source file is a node and edges connect -files which have dependencies. -cecli optimizes the repo map by -selecting the most important parts of the codebase -which will -fit into the active token budget. -The optimization identifies and maps the portions of the code base -which are most relevant to the current state of the chat. - -The token budget is -influenced by the `--map-tokens` switch, which defaults to 1k tokens. -cecli adjusts the size of the repo map dynamically based on the state of the chat. It will usually stay within that setting's value. But it does expand the repo map -significantly at times, especially when no files have been added to the chat and cecli needs to understand the entire repo as best as possible. - - -The sample map shown above doesn't contain *every* class, method and function from those -files. -It only includes the most important identifiers, -the ones which are most often referenced by other portions of the code. -These are the key pieces of context that the LLM needs to know to understand -the overall codebase. +Of course, for large repositories even just the repo map might be too large for the LLM's context window. cecli solves this problem by sending just the **most relevant** portions of the repo map. It does this by analyzing the full repo map using a graph ranking algorithm, computed on a graph where each source file is a node and edges connect files which have dependencies. cecli optimizes the repo map by selecting the most important parts of the codebase which will fit into the active token budget. The optimization identifies and maps the portions of the code base which are most relevant to the current state of the chat. + +The token budget is influenced by the `--map-tokens` switch, which defaults to 1k tokens. cecli adjusts the size of the repo map dynamically based on the state of the chat. It will usually stay within that setting's value. But it does expand the repo map significantly at times, especially when no files have been added to the chat and cecli needs to understand the entire repo as best as possible. + + +The sample map shown above doesn't contain *every* class, method and function from those files. It only includes the most important identifiers, the ones which are most often referenced by other portions of the code. These are the key pieces of context that the LLM needs to know to understand the overall codebase. ## More info -Please check the -[repo map article on cecli's blog](https://cecli.dev/2023/10/22/repomap.html) -for more information on cecli's repository map -and how it is constructed. +Please check the [repo map article on cecli's blog](https://cecli.dev/2023/10/22/repomap.html) for more information on cecli's repository map and how it is constructed. diff --git a/cecli/website/docs/scripting.md b/cecli/website/docs/scripting.md index 6be657fde2f..f01610521fd 100644 --- a/cecli/website/docs/scripting.md +++ b/cecli/website/docs/scripting.md @@ -4,15 +4,13 @@ nav_order: 400 description: You can script cecli via the command line or python. --- -# Scripting cecli +# Scripting Cecli You can script cecli via the command line or python. ## Command line -cecli takes a `--message` argument, where you can give it a natural language instruction. -It will do that one thing, apply the edits to the files and then exit. -So you could do: +Cecli takes a `--message` argument, where you can give it a natural language instruction. It will do that one thing, apply the edits to the files and then exit. So you could do: ```bash cecli --message "make a script that prints hello" hello.js @@ -26,9 +24,7 @@ for FILE in *.py ; do done ``` -Use `cecli --help` to see all the -[command line options](/docs/config/options.html), -but these are useful for scripting: +Use `cecli --help` to see all the [command line options](config/options.html), but these are useful for scripting: ``` --stream, --no-stream @@ -82,9 +78,7 @@ coder.run("/tokens") ``` -See the -[Coder.create() and Coder.__init__() methods](https://github.com/cecli-dev/cecli/blob/main/cecli/coders/base_coder.py) -for all the supported arguments. +See the [Coder.create() and Coder.__init__() methods](https://github.com/cecli-dev/cecli/blob/main/cecli/coders/base_coder.py) for all the supported arguments. It can also be helpful to set the equivalent of `--yes` by doing this: @@ -95,6 +89,4 @@ io = InputOutput(yes=True) coder = Coder.create(model=model, fnames=fnames, io=io) ``` -{: .note } -The python scripting API is not officially supported or documented, -and could change in future releases without providing backwards compatibility. +> **Note:** The python scripting API is not officially supported or documented, and could change in future releases without providing backwards compatibility. diff --git a/cecli/website/docs/troubleshooting.md b/cecli/website/docs/troubleshooting.md index 7829dcc76e3..473cf1c3c46 100644 --- a/cecli/website/docs/troubleshooting.md +++ b/cecli/website/docs/troubleshooting.md @@ -8,4 +8,7 @@ description: How to troubleshoot problems with cecli and get help. Below are some approaches for troubleshooting problems with cecli. -{% include help.md %} +If you need more help, please check our [GitHub issues](https://github.com/cecli-dev/cecli/issues) and file a new issue if your problem isn't discussed. Or drop into our [Discord](https://discord.gg/g4bF53fSWF) to chat with us. + +> **Tip:** +> Use `/help ` to [ask for help about using cecli](troubleshooting/support.html), customizing settings, using LLMs, etc. diff --git a/cecli/website/docs/troubleshooting/cecli-not-found.md b/cecli/website/docs/troubleshooting/cecli-not-found.md index 0b123a8aab6..9f9d91c388d 100644 --- a/cecli/website/docs/troubleshooting/cecli-not-found.md +++ b/cecli/website/docs/troubleshooting/cecli-not-found.md @@ -5,10 +5,7 @@ nav_order: 28 # cecli not found -In some environments the `cecli` command may not be available -on your shell path. -This can occur because of permissions/security settings in your OS, -and often happens to Windows users. +In some environments the `cecli` command may not be available on your shell path. This can occur because of permissions/security settings in your OS, and often happens to Windows users. You may see an error message like this: @@ -20,5 +17,4 @@ Below is the most fail safe way to run cecli in these situations: python -m cecli ``` -You should also consider -[installing cecli using cecli-install, uv or pipx](/docs/install.html). +You should also consider [installing cecli using cecli-install, uv or pipx](../install.html). diff --git a/cecli/website/docs/troubleshooting/edit-errors.md b/cecli/website/docs/troubleshooting/edit-errors.md index 7ea50ecaf0a..72de25142b4 100644 --- a/cecli/website/docs/troubleshooting/edit-errors.md +++ b/cecli/website/docs/troubleshooting/edit-errors.md @@ -5,59 +5,37 @@ nav_order: 10 # File editing problems -Sometimes the LLM will reply with some code changes -that don't get applied to your local files. -In these cases, cecli might say something like "Failed to apply edit to *filename*" -or other error messages. +Sometimes the LLM will reply with some code changes that don't get applied to your local files. In these cases, cecli might say something like "Failed to apply edit to *filename*" or other error messages. -This usually happens because the LLM is disobeying the system prompts -and trying to make edits in a format that cecli doesn't expect. -cecli makes every effort to get the LLM -to conform, and works hard to deal with -LLM edits that are "almost" correctly formatted. +This usually happens because the LLM is disobeying the system prompts and trying to make edits in a format that cecli doesn't expect. cecli makes every effort to get the LLM to conform, and works hard to deal with LLM edits that are "almost" correctly formatted. -But sometimes the LLM just won't cooperate. -In these cases, here are some things you might try. +But sometimes the LLM just won't cooperate. In these cases, here are some things you might try. ## Don't add too many files -Many LLMs now have very large context windows, -but filling them with irrelevant code or conversation -can confuse the model. -Above about 25k tokens of context, most models start to become distracted and become less likely -to conform to their system prompt. +Many LLMs now have very large context windows, but filling them with irrelevant code or conversation can confuse the model. Above about 25k tokens of context, most models start to become distracted and become less likely to conform to their system prompt. - Don't add too many files to the chat, *just* add the files you think need to be edited. -cecli also sends the LLM a [map of your entire git repo](https://cecli.dev/docs/repomap.html), so other relevant code will be included automatically. +Cecli also sends the LLM a [map of your entire git repo](../repomap.html), so other relevant code will be included automatically. - Use `/drop` to remove files from the chat session which aren't needed for the task at hand. This will reduce distractions and may help the LLM produce properly formatted edits. - Use `/clear` to remove the conversation history, again to help the LLM focus. - Use `/tokens` to see how many tokens you are using for each message. ## Use a more capable model -If possible try using GPT-4o, o3-mini, Claude 3.7 Sonnet, DeepSeek V3 or DeepSeek R1. -They are the strong and capable models. +If possible try using GPT-4o, o3-mini, Claude 3.7 Sonnet, DeepSeek V3 or DeepSeek R1. They are the strong and capable models. -Weaker models -are more prone to -disobeying the system prompt instructions. -Most local models are just barely capable of working with cecli, -so editing errors are probably unavoidable. +Weaker models are more prone to disobeying the system prompt instructions. Most local models are just barely capable of working with cecli, so editing errors are probably unavoidable. ## Local models: context window and quantization -Be especially careful about the -[Ollama context window](https://cecli.dev/docs/llms/ollama.html#setting-the-context-window-size) -when working with local models. -It defaults to be very small and silently discards data if you exceed it. +Be especially careful about the [Ollama context window](../llms/ollama.html#ollama-setting-the-context-window-size) when working with local models. It defaults to be very small and silently discards data if you exceed it. -Local models which have been quantized are more likely to have editing problems -because they are not capable enough to follow cecli's system prompts. +Local models which have been quantized are more likely to have editing problems because they are not capable enough to follow cecli's system prompts. ## Try the whole edit format -Run cecli with `--edit-format whole` if were using a different edit format. -You can see which edit format it is using in the announce lines: +Run cecli with `--edit-format whole` if were using a different edit format. You can see which edit format it is using in the announce lines: ``` cecli v0.50.2-dev @@ -66,11 +44,34 @@ Models: claude-3-5-sonnet-20240620 with ♾️ diff edit format ## Try architect mode -Run cecli with `--architect` or `/chat-mode architect` to enable [architect mode](../usage/modes.md#architect-mode-and-the-editor-model). -This mode first proposes changes, then uses a separate model to handle the file edits. -This two-step process often produces more reliable edits, especially with models that have trouble -following edit format instructions. +Run cecli with `--architect` or `/chat-mode architect` to enable [architect mode](../usage/modes.md#chat-modes-architect-mode-and-the-editor-model). This mode first proposes changes, then uses a separate model to handle the file edits. This two-step process often produces more reliable edits, especially with models that have trouble following edit format instructions. ## More help -{% include help.md %} +If you need more help, please check our +[GitHub issues](https://github.com/cecli-dev/cecli/issues) +and file a new issue if your problem isn't discussed. +Or drop into our +[Discord](https://discord.gg/g4bF53fSWF) +to chat with us. + +When reporting problems, it is very helpful if you can provide: + +- cecli version +- LLM model you are using + +Including the "announcement" lines that +aider prints at startup +is an easy way to share this helpful info. + +``` +Aider v0.37.1-dev +Models: gpt-4o with diff edit format, weak model gpt-3.5-turbo +Git repo: .git with 243 files +Repo-map: using 1024 tokens +``` + +> **Tip:** +> Use `/help ` to +> [ask for help about using cecli](support.html), +> customizing settings, troubleshooting, using LLMs, etc. diff --git a/cecli/website/docs/troubleshooting/imports.md b/cecli/website/docs/troubleshooting/imports.md index 271bd4b55b5..3e40f96c2f4 100644 --- a/cecli/website/docs/troubleshooting/imports.md +++ b/cecli/website/docs/troubleshooting/imports.md @@ -5,21 +5,14 @@ nav_order: 28 # Dependency versions -cecli expects to be installed with the -correct versions of all of its required dependencies. +Cecli expects to be installed with the correct versions of all of its required dependencies. -If you've been linked to this doc from a GitHub issue, -or if cecli is reporting `ImportErrors` -it is likely that your -cecli install is using incorrect dependencies. +If you've been linked to this doc from a GitHub issue, or if cecli is reporting `ImportErrors` it is likely that your cecli install is using incorrect dependencies. ## Avoid package conflicts -If you are using cecli to work on a python project, sometimes your project will require -specific versions of python packages which conflict with the versions that cecli -requires. -If this happens, you may see errors like these when running pip installs: +If you are using cecli to work on a python project, sometimes your project will require specific versions of python packages which conflict with the versions that cecli requires. If this happens, you may see errors like these when running pip installs: ``` cecli-dev 0.97.3 requires somepackage==X.Y.Z, but you have somepackage U.W.V which is incompatible. @@ -27,32 +20,19 @@ cecli-dev 0.97.3 requires somepackage==X.Y.Z, but you have somepackage U.W.V whi ## Install with cecli-install, uv or pipx -If you are having dependency problems you should consider -[installing cecli using cecli-install, uv or pipx](/docs/install.html). -This will ensure that cecli is installed in its own python environment, -with the correct set of dependencies. +If you are having dependency problems you should consider [installing cecli using cecli-install, uv or pipx](../install.html). This will ensure that cecli is installed in its own python environment, with the correct set of dependencies. ## Package managers like Homebrew, AUR, ports -Package managers often install cecli with the wrong dependencies, leading -to import errors and other problems. +Package managers often install cecli with the wrong dependencies, leading to import errors and other problems. -It is recommended to -[install cecli using cecli-install, uv or pipx](/docs/install.html). +It is recommended to [install cecli using cecli-install, uv or pipx](../install.html). ## Dependency versions matter -cecli pins its dependencies and is tested to work with those specific versions. -If you are installing cecli directly with pip -you should be careful about upgrading or downgrading the python packages that -cecli uses. +Cecli pins its dependencies and is tested to work with those specific versions. If you are installing cecli directly with pip you should be careful about upgrading or downgrading the python packages that cecli uses. -In particular, be careful with the packages with pinned versions -noted at the end of -[cecli's requirements.in file](https://github.com/cecli-dev/cecli/blob/main/requirements/requirements.in). -These versions are pinned because cecli is known not to work with the -latest versions of these libraries. +In particular, be careful with the packages with pinned versions noted at the end of [cecli's requirements.in file](https://github.com/cecli-dev/cecli/blob/main/requirements/requirements.in). These versions are pinned because cecli is known not to work with the latest versions of these libraries. -Also be wary of upgrading `litellm`, as it changes versions frequently -and sometimes introduces bugs or backwards incompatible changes. +Also be wary of upgrading `litellm`, as it changes versions frequently and sometimes introduces bugs or backwards incompatible changes. diff --git a/cecli/website/docs/troubleshooting/models-and-keys.md b/cecli/website/docs/troubleshooting/models-and-keys.md index 1b3406b4c13..32314be3ce6 100644 --- a/cecli/website/docs/troubleshooting/models-and-keys.md +++ b/cecli/website/docs/troubleshooting/models-and-keys.md @@ -5,31 +5,21 @@ nav_order: 28 # Models and API keys -cecli needs to know which LLM model you would like to work with and which keys -to provide when accessing it via API. +Cecli needs to know which LLM model you would like to work with and which keys to provide when accessing it via API. ## Defaults -If you don't explicitly name a model, cecli will try to select a model -for you to work with. +If you don't explicitly name a model, cecli will try to select a model for you to work with. -First, cecli will check which -[keys you have provided via the environment, config files, or command line arguments](https://cecli.dev/docs/config/api-keys.html). -Based on the available keys, cecli will select the best model to use. +First, cecli will check which [keys you have provided via the environment, config files, or command line arguments](../config/api-keys.html). Based on the available keys, cecli will select the best model to use. ## OpenRouter -If you have not provided any keys, cecli will offer to help you connect to -[OpenRouter](http://openrouter.ai) -which provides both free and paid access to most popular LLMs. -Once connected, cecli will select the best model available on OpenRouter -based on whether you have a free or paid account there. +If you have not provided any keys, cecli will offer to help you connect to [OpenRouter](http://openrouter.ai) which provides both free and paid access to most popular LLMs. Once connected, cecli will select the best model available on OpenRouter based on whether you have a free or paid account there. ## Specifying model & key -You can also tell cecli which LLM to use and provide an API key. -The easiest way is to use the `--model` and `--api-key` -command line arguments, like this: +You can also tell cecli which LLM to use and provide an API key. The easiest way is to use the `--model` and `--api-key` command line arguments, like this: ``` # Work with DeepSeek via DeepSeek's API @@ -50,5 +40,5 @@ cecli --model openrouter/deepseek/deepseek-chat --api-key openrouter=your-key-go For more information, see the documentation sections: -- [Connecting to LLMs](https://cecli.dev/docs/llms.html) -- [Configuring API keys](https://cecli.dev/docs/config/api-keys.html) +- [Connecting to LLMs](../llms.html) +- [Configuring API keys](../config/api-keys.html) diff --git a/cecli/website/docs/troubleshooting/support.md b/cecli/website/docs/troubleshooting/support.md index 036466612f0..eb8575c7ab3 100644 --- a/cecli/website/docs/troubleshooting/support.md +++ b/cecli/website/docs/troubleshooting/support.md @@ -6,23 +6,11 @@ nav_order: 30 # Using /help -Type `/help ` and -cecli will respond with helpful information. -You can ask questions about using cecli, -customizing settings, troubleshooting, using LLMs, etc. +Type `/help ` and cecli will respond with helpful information. You can ask questions about using cecli, customizing settings, troubleshooting, using LLMs, etc. -Behind the scenes, cecli has indexed all of its -[documentation](https://cecli.dev/). -It uses the question to find relevant docs -and share them with the LLM to do -retrieval augmented generation (RAG) -The LLM also has the full context of your ongoing -cecli chat, -so it can help with the exact issue you might be facing. +Behind the scenes, cecli has indexed all of its [documentation](../index.html). It uses the question to find relevant docs and share them with the LLM to do retrieval augmented generation (RAG) The LLM also has the full context of your ongoing cecli chat, so it can help with the exact issue you might be facing. -
- > cecli v0.42.1-dev > Models: claude-3-5-sonnet with diff edit format > Repo-map: using 1024 tokens @@ -43,13 +31,11 @@ If multiple .env files exist in these locations, they are loaded in the order li Here are some relevant documentation links that you might find helpful: -- https://cecli.dev/docs/config.html -- https://cecli.dev/docs/config/dotenv.html +- https://cecli.dev/docs/config/ +- https://cecli.dev/docs/config/dotenv/ The ability to use both global and repo-specific .env files allows for flexible configuration, where you can set default values globally and override them on a per-project basis as needed. -
-
#### /help can i use local LLMs? @@ -65,15 +51,39 @@ However, it's important to note that cecli works best with more capable models. For more detailed information on using local LLMs and connecting to various models, you might want to check out these relevant documentation pages: -- https://cecli.dev/docs/llms.html -- https://cecli.dev/docs/llms/ollama.html -- https://cecli.dev/docs/llms/openai-compat.html +- https://cecli.dev/docs/llms/ +- https://cecli.dev/docs/llms/ollama/ +- https://cecli.dev/docs/llms/openai-compat/ Keep in mind that the performance and capabilities of local LLMs may vary depending on the specific model and your hardware resources. -
- ## Getting more help -{% include help.md %} +If you need more help, please check our +[GitHub issues](https://github.com/cecli-dev/cecli/issues) +and file a new issue if your problem isn't discussed. +Or drop into our +[Discord](https://discord.gg/g4bF53fSWF) +to chat with us. + +When reporting problems, it is very helpful if you can provide: + +- cecli version +- LLM model you are using + +Including the "announcement" lines that +aider prints at startup +is an easy way to share this helpful info. + +``` +Aider v0.37.1-dev +Models: gpt-4o with diff edit format, weak model gpt-3.5-turbo +Git repo: .git with 243 files +Repo-map: using 1024 tokens +``` + +> **Tip:** +> Use `/help ` to +> [ask for help about using cecli](support.html), +> customizing settings, troubleshooting, using LLMs, etc. diff --git a/cecli/website/docs/troubleshooting/token-limits.md b/cecli/website/docs/troubleshooting/token-limits.md index 0239a68cbee..80effd790e2 100644 --- a/cecli/website/docs/troubleshooting/token-limits.md +++ b/cecli/website/docs/troubleshooting/token-limits.md @@ -12,10 +12,7 @@ Every LLM has limits on how many tokens it can process for each request: - Each model has limit on how many **output tokens** it can produce. -cecli will report an error **if a model responds** indicating that -it has exceeded a token limit. -The error will include suggested actions to try and -avoid hitting token limits. +Cecli will report an error **if a model responds** indicating that it has exceeded a token limit. The error will include suggested actions to try and avoid hitting token limits. Here's an example error: @@ -34,27 +31,15 @@ To reduce output tokens: For more info: https://cecli.dev/docs/token-limits.html ``` -{: .note } -cecli never *enforces* token limits, it only *reports* token limit errors -from the API provider. -The token counts that cecli reports are *estimates*. +> **Note:** cecli never *enforces* token limits, it only *reports* token limit errors from the API provider. The token counts that cecli reports are *estimates*. ## Input tokens & context window size -The most common problem is trying to send too much data to a -model, -overflowing its context window. -Technically you can exhaust the context window if the input is -too large or if the input plus output are too large. +The most common problem is trying to send too much data to a model, overflowing its context window. Technically you can exhaust the context window if the input is too large or if the input plus output are too large. -Strong models like GPT-4o and Sonnet have quite -large context windows, so this sort of error is -typically only an issue when working with weaker models. +Strong models like GPT-4o and Sonnet have quite large context windows, so this sort of error is typically only an issue when working with weaker models. -The easiest solution is to try and reduce the input tokens -by removing files from the chat. -It's best to only add the files that cecli will need to *edit* -to complete your request. +The easiest solution is to try and reduce the input tokens by removing files from the chat. It's best to only add the files that cecli will need to *edit* to complete your request. - Use `/tokens` to see token usage. - Use `/drop` to remove unneeded files from the chat session. @@ -63,34 +48,47 @@ to complete your request. ## Output token limits -Most models have quite small output limits, often as low -as 4k tokens. -If you ask cecli to make a large change that affects a lot -of code, the LLM may hit output token limits -as it tries to send back all the changes. +Most models have quite small output limits, often as low as 4k tokens. If you ask cecli to make a large change that affects a lot of code, the LLM may hit output token limits as it tries to send back all the changes. To avoid hitting output token limits: - Ask for smaller changes in each request. - Break your code into smaller source files. - Use a strong model like gpt-4o, sonnet or DeepSeek V3 that can return diffs. -- Use a model that supports [infinite output](/docs/more/infinite-output.html). +- Use a model that supports [infinite output](../more/infinite-output.html). ## Other causes -Sometimes token limit errors are caused by -non-compliant API proxy servers -or bugs in the API server you are using to host a local model. -cecli has been well tested when directly connecting to -major -[LLM provider cloud APIs](https://cecli.dev/docs/llms.html). -For serving local models, -[Ollama](https://cecli.dev/docs/llms/ollama.html) is known to work well with cecli. +Sometimes token limit errors are caused by non-compliant API proxy servers or bugs in the API server you are using to host a local model. cecli has been well tested when directly connecting to major [LLM provider cloud APIs](../llms.html). For serving local models, [Ollama](../llms/ollama.html) is known to work well with cecli. -Try using cecli without an API proxy server -or directly with one of the recommended cloud APIs -and see if your token limit problems resolve. +Try using cecli without an API proxy server or directly with one of the recommended cloud APIs and see if your token limit problems resolve. ## More help -{% include help.md %} +If you need more help, please check our +[GitHub issues](https://github.com/cecli-dev/cecli/issues) +and file a new issue if your problem isn't discussed. +Or drop into our +[Discord](https://discord.gg/g4bF53fSWF) +to chat with us. + +When reporting problems, it is very helpful if you can provide: + +- cecli version +- LLM model you are using + +Including the "announcement" lines that +aider prints at startup +is an easy way to share this helpful info. + +``` +Aider v0.37.1-dev +Models: gpt-4o with diff edit format, weak model gpt-3.5-turbo +Git repo: .git with 243 files +Repo-map: using 1024 tokens +``` + +> **Tip:** +> Use `/help ` to +> [ask for help about using cecli](support.html), +> customizing settings, troubleshooting, using LLMs, etc. diff --git a/cecli/website/docs/troubleshooting/warnings.md b/cecli/website/docs/troubleshooting/warnings.md index a6adf2ccacf..4ccd0826f09 100644 --- a/cecli/website/docs/troubleshooting/warnings.md +++ b/cecli/website/docs/troubleshooting/warnings.md @@ -5,8 +5,97 @@ nav_order: 20 # Model warnings -{% include model-warnings.md %} +## Unknown context window size and token costs + +``` +Model foobar: Unknown context window size and costs, using sane defaults. +``` + +If you specify a model that cecli has never heard of, you will get +this warning. +This means cecli doesn't know the context window size and token costs +for that model. +Cecli will use an unlimited context window and assume the model is free, +so this is not usually a significant problem. + +See the docs on +[configuring advanced model settings](../config/adv-model-settings.html) +for details on how to remove this warning. + +> **Tip:** +> You can probably ignore the unknown context window size and token costs warning. + +## Did you mean? + +If cecli isn't familiar with the model you've specified, +it will suggest similarly named models. +This helps +in the case where you made a typo or mistake when specifying the model name. + +``` +Model gpt-5o: Unknown context window size and costs, using sane defaults. +Did you mean one of these? +- gpt-4o +``` + +## Missing environment variables + +You need to set the listed environment variables. +Otherwise you will get error messages when you start chatting with the model. + +``` +Model azure/gpt-4-turbo: Missing these environment variables: +- AZURE_API_BASE +- AZURE_API_VERSION +- AZURE_API_KEY +``` + +> **Tip:** +> On Windows, +> if you just set these environment variables using `setx` you may need to restart your terminal or +> command prompt for the changes to take effect. + +## Unknown which environment variables are required + +``` +Model gpt-5: Unknown which environment variables are required. +``` + +Cecli is unable verify the environment because it doesn't know +which variables are required for the model. +If required variables are missing, +you may get errors when you attempt to chat with the model. +You can look in the [cecli's LLM documentation](../llms.html) +or the +[litellm documentation](https://docs.litellm.ai/docs/providers) +to see if the required variables are listed there. ## More help -{% include help.md %} +If you need more help, please check our +[GitHub issues](https://github.com/cecli-dev/cecli/issues) +and file a new issue if your problem isn't discussed. +Or drop into our +[Discord](https://discord.gg/g4bF53fSWF) +to chat with us. + +When reporting problems, it is very helpful if you can provide: + +- cecli version +- LLM model you are using + +Including the "announcement" lines that +aider prints at startup +is an easy way to share this helpful info. + +``` +Aider v0.37.1-dev +Models: gpt-4o with diff edit format, weak model gpt-3.5-turbo +Git repo: .git with 243 files +Repo-map: using 1024 tokens +``` + +> **Tip:** +> Use `/help ` to +> [ask for help about using cecli](support.html), +> customizing settings, troubleshooting, using LLMs, etc. diff --git a/cecli/website/docs/unified-diffs.md b/cecli/website/docs/unified-diffs.md index cf8e046206a..7ba8cbdd23c 100644 --- a/cecli/website/docs/unified-diffs.md +++ b/cecli/website/docs/unified-diffs.md @@ -4,105 +4,51 @@ excerpt: GPT-4 Turbo has a problem with lazy coding, which can be signiciantly i highlight_image: /assets/benchmarks-udiff.jpg nav_exclude: true --- -{% if page.date %} - -{% endif %} # Unified diffs make GPT-4 Turbo 3X less lazy ![robot flowchart](/assets/benchmarks-udiff.svg) -cecli now asks GPT-4 Turbo to use -[unified diffs](#choose-a-familiar-editing-format) -to edit your code. -This dramatically improves GPT-4 Turbo's performance on a -challenging -new benchmark -and significantly reduces its bad habit of "lazy" coding, -where it writes -code with comments -like "...add logic here...". - -cecli's new "laziness" benchmark suite -is designed to both provoke and quantify lazy coding. -It consists of -89 python refactoring tasks -which tend to make GPT-4 Turbo write lazy comments like -"...include original method body...". +Cecli now asks GPT-4 Turbo to use [unified diffs](#unified-diffs-make-gpt-4-turbo-3x-less-lazy-unified-diff-editing-format-choose-a-familiar-editing-format) to edit your code. This dramatically improves GPT-4 Turbo's performance on a challenging new benchmark and significantly reduces its bad habit of "lazy" coding, where it writes code with comments like "...add logic here...". + +Cecli's new "laziness" benchmark suite is designed to both provoke and quantify lazy coding. It consists of 89 python refactoring tasks which tend to make GPT-4 Turbo write lazy comments like "...include original method body...". This new laziness benchmark produced the following results with `gpt-4-1106-preview`: - **GPT-4 Turbo only scored 20% as a baseline** using cecli's existing "SEARCH/REPLACE block" edit format. It outputs "lazy comments" on 12 of the tasks. - **cecli's new unified diff edit format raised the score to 61%**. Using this format reduced laziness by 3X, with GPT-4 Turbo only using lazy comments on 4 of the tasks. - **It's worse to add a prompt that says the user is blind, has no hands, will tip $2000 and fears truncated code trauma.** Widely circulated "emotional appeal" folk remedies -produced worse benchmark scores -for both the baseline SEARCH/REPLACE and new unified diff editing formats. +produced worse benchmark scores for both the baseline SEARCH/REPLACE and new unified diff editing formats. The older `gpt-4-0613` also did better on the laziness benchmark using unified diffs: - **The June GPT-4's baseline was 26%** using cecli's existing "SEARCH/REPLACE block" edit format. - **cecli's new unified diff edit format raised June GPT-4's score to 59%**. - The benchmark was designed to use large files, and -28% of them are too large to fit in June GPT-4's 8k context window. -This puts a hard ceiling of 72% on how well the June model could possibly score. - -With unified diffs, GPT acts more like it's writing textual data intended to be read by a program, -not talking to a person. -Diffs are -usually -consumed by the -[patch](https://www.gnu.org/software/diffutils/manual/html_node/Merging-with-patch.html) -program, which is fairly rigid. -This seems to encourage rigor, making -GPT less likely to -leave informal editing instructions in comments -or be lazy about writing all the needed code. - -cecli's new unified diff editing format -outperforms other solutions I evaluated by a wide margin. -I explored many other approaches including: -prompts about being tireless and diligent, -OpenAI's function/tool calling capabilities, -numerous variations on cecli's existing editing formats, -line number based formats -and other diff-like formats. -The results shared here reflect -an extensive investigation and benchmark evaluations of many approaches. - -The rest of this article will describe -cecli's new editing format and refactoring benchmark. -It will highlight some key design decisions, -and evaluate their significance using ablation experiments. +28% of them are too large to fit in June GPT-4's 8k context window. This puts a hard ceiling of 72% on how well the June model could possibly score. + +With unified diffs, GPT acts more like it's writing textual data intended to be read by a program, not talking to a person. Diffs are usually consumed by the [patch](https://www.gnu.org/software/diffutils/manual/html_node/Merging-with-patch.html) program, which is fairly rigid. This seems to encourage rigor, making GPT less likely to leave informal editing instructions in comments or be lazy about writing all the needed code. + +Cecli's new unified diff editing format outperforms other solutions I evaluated by a wide margin. I explored many other approaches including: prompts about being tireless and diligent, OpenAI's function/tool calling capabilities, numerous variations on cecli's existing editing formats, line number based formats and other diff-like formats. The results shared here reflect an extensive investigation and benchmark evaluations of many approaches. +The rest of this article will describe cecli's new editing format and refactoring benchmark. It will highlight some key design decisions, and evaluate their significance using ablation experiments. ## Unified diff editing format -The design and implementation of cecli's new unified diff editing format -helped clarify some general principles -for GPT-4 code editing: +The design and implementation of cecli's new unified diff editing format helped clarify some general principles for GPT-4 code editing: - FAMILIAR - Choose an edit format that GPT is already familiar with. - SIMPLE - Choose a simple format that avoids escaping, syntactic overhead and brittle specifiers like line numbers or line counts. - HIGH LEVEL - Encourage GPT to structure edits as new versions of substantive code blocks (functions, methods, etc), not as a series of surgical/minimal changes to individual lines of code. - FLEXIBLE - Strive to be maximally flexible when interpreting GPT's edit instructions. -A helpful shortcut here is to have empathy for GPT, and imagine you -are the one being asked to specify code edits. -Would you want to hand type a properly escaped json data structure -to invoke surgical insert, delete, replace operations on specific code line numbers? -Do you want to use a brittle format, where any mistake -causes an error that discards all your work? +A helpful shortcut here is to have empathy for GPT, and imagine you are the one being asked to specify code edits. Would you want to hand type a properly escaped json data structure to invoke surgical insert, delete, replace operations on specific code line numbers? Do you want to use a brittle format, where any mistake causes an error that discards all your work? -GPT is quantitatively better at code editing when you reduce the -burden of formatting edits by using a familiar, simple, high level -and flexible editing format. +GPT is quantitatively better at code editing when you reduce the burden of formatting edits by using a familiar, simple, high level and flexible editing format. ### Choose a familiar editing format -Unified diffs are perhaps the most common way to show -code edits, because it's the -default output format of `git diff`: +Unified diffs are perhaps the most common way to show code edits, because it's the default output format of `git diff`: ```diff --- a/greeting.py @@ -115,49 +61,19 @@ default output format of `git diff`: return ``` -Choosing such a popular format means that GPT has -seen *many* examples in its training data. -It's been trained to generate -text that conforms to the unified diff syntax. +Choosing such a popular format means that GPT has seen *many* examples in its training data. It's been trained to generate text that conforms to the unified diff syntax. ### Use a simple editing format -cecli's [previous benchmark results](https://cecli.dev/docs/benchmarks.html) made -it clear that simple editing formats -work best. -Even though OpenAI provides extensive support for -structured formats like json and function calls, -GPT is worse at editing code if you use them. -I repeated these and other similar benchmarks against GPT-4 Turbo, -and again reached these same conclusions. - -Informally, this is probably because stuffing *source code* into JSON is complicated -and error prone. -Wrapping the python code -`print("On Windows use \"C:\\\"")` -as valid json is pretty painful and error prone. -Due to escaping issues GPT's code is often syntactically incorrect when it's -unpacked from JSON, -or the JSON decode just fails entirely. - -On the other hand, the core of the unified diff format is very simple. -You include a hunk of the file that needs to be changed, -with every line prefixed by a character -to indicate unchanged, new or deleted lines. -A unified diff looks pretty much like the code it is modifying. - -The one complicated piece is the line numbers found at the start -of each hunk. They look something like this: `@@ -2,4 +3,5 @@`. -GPT is terrible at working with source code line numbers. -This is a general observation about *any* use of line -numbers in editing formats, -backed up by many quantitative benchmark experiments. - -You've probably ignored the line numbers in every diff you've seen, -because the diffs usually still make sense without them. -cecli tells GPT not to include line numbers, -and just interprets each hunk from the unified diffs -as a search and replace operation: +Cecli's [previous benchmark results](benchmarks.html) made it clear that simple editing formats work best. Even though OpenAI provides extensive support for structured formats like json and function calls, GPT is worse at editing code if you use them. I repeated these and other similar benchmarks against GPT-4 Turbo, and again reached these same conclusions. + +Informally, this is probably because stuffing *source code* into JSON is complicated and error prone. Wrapping the python code `print("On Windows use \"C:\\\"")` as valid json is pretty painful and error prone. Due to escaping issues GPT's code is often syntactically incorrect when it's unpacked from JSON, or the JSON decode just fails entirely. + +On the other hand, the core of the unified diff format is very simple. You include a hunk of the file that needs to be changed, with every line prefixed by a character to indicate unchanged, new or deleted lines. A unified diff looks pretty much like the code it is modifying. + +The one complicated piece is the line numbers found at the start of each hunk. They look something like this: `@@ -2,4 +3,5 @@`. GPT is terrible at working with source code line numbers. This is a general observation about *any* use of line numbers in editing formats, backed up by many quantitative benchmark experiments. + +You've probably ignored the line numbers in every diff you've seen, because the diffs usually still make sense without them. cecli tells GPT not to include line numbers, and just interprets each hunk from the unified diffs as a search and replace operation: This diff: @@ -170,8 +86,7 @@ This diff: return ``` -Means we need to search the file for the -*space* and *minus* `-` lines: +Means we need to search the file for the *space* and *minus* `-` lines: ```python def main(args): @@ -193,10 +108,7 @@ Simple, right? ### Encourage high level edits -The example unified diffs we've seen so far have all been single line changes, -which makes them pretty easy to read and understand. -Consider this slightly more complex change, which renames the variable `n` to -`number`: +The example unified diffs we've seen so far have all been single line changes, which makes them pretty easy to read and understand. Consider this slightly more complex change, which renames the variable `n` to `number`: ```diff @@ ... @@ @@ -210,10 +122,7 @@ Consider this slightly more complex change, which renames the variable `n` to + return number * factorial(number-1) ``` -The following "high level diff" of the same -change is not as succinct as the minimal diff above, -but it is much easier to see two different coherent versions of the -`factorial()` function. +The following "high level diff" of the same change is not as succinct as the minimal diff above, but it is much easier to see two different coherent versions of the `factorial()` function. ```diff @@ ... @@ @@ -229,29 +138,18 @@ but it is much easier to see two different coherent versions of the + return number * factorial(number-1) ``` -cecli's system prompt encourages -GPT to produce these high level diffs. -This makes GPT better at producing correct diffs, which can be successfully -applied to the original file. +Cecli's system prompt encourages GPT to produce these high level diffs. This makes GPT better at producing correct diffs, which can be successfully applied to the original file. -**Experiments without "high level diff" prompting -produce a 30-50% increase in editing errors,** -where diffs fail to apply or apply incorrectly and -produce invalid code. -When a patch fails, cecli needs to ask GPT for a corrected version of the diff. -This takes time, costs tokens and sometimes fails to produce a successful edit -even after multiple retries. +**Experiments without "high level diff" prompting produce a 30-50% increase in editing errors,** where diffs fail to apply or apply incorrectly and produce invalid code. When a patch fails, cecli needs to ask GPT for a corrected version of the diff. This takes time, costs tokens and sometimes fails to produce a successful edit even after multiple retries. -There are probably a couple of reasons why high level diffs -help: +There are probably a couple of reasons why high level diffs help: - It's easier to produce diffs that both correctly match the original code and correctly produce the intended new code. There is less risk of GPT getting confused, compared to generating a series of surgical edits that interleave lines of old and new code. - High level hunks often contain more lines than a surgical hunk, so they are less likely to accidentally match unrelated parts of the code. This is helpful because GPT can't reliably give us line numbers to specify exactly where in the file to make changes. ### Be flexible when applying edits -GPT frequently makes imperfect diffs that won't apply cleanly. -They exhibit a variety of problems: +GPT frequently makes imperfect diffs that won't apply cleanly. They exhibit a variety of problems: - GPT forgets things like comments, docstrings, blank lines, etc. Or it skips over some code that it doesn't intend to change. - GPT forgets the leading *plus* `+` character to mark novel lines that it wants to add to the file. It incorrectly includes them with a leading *space* as if they were already there. @@ -271,12 +169,7 @@ def main(args): main(sys.argv[1:]) ``` -**The diff below is missing the "show a greeting" comment line**, -and represents a common type of mistake GPT might make. -When we search for the *minus* `-` lines, we won't find them -in the original file -because of the missing comment. - +**The diff below is missing the "show a greeting" comment line**, and represents a common type of mistake GPT might make. When we search for the *minus* `-` lines, we won't find them in the original file because of the missing comment. ```diff @@ ... @@ @@ -288,10 +181,7 @@ because of the missing comment. + return ``` - -cecli tries to be very flexible when applying diffs, -in order to handle defects. -If a hunk doesn't apply cleanly, cecli uses a number of strategies: +Cecli tries to be very flexible when applying diffs, in order to handle defects. If a hunk doesn't apply cleanly, cecli uses a number of strategies: - Normalize the hunk, by taking the *minus* `-` and *space* lines as one version of the hunk and the *space* and *plus* `+` lines as a second version and doing an actual unified diff on them. - Try and discover new lines that GPT is trying to add but which it forgot to mark with *plus* `+` markers. This is done by diffing the *minus* `-` and *space* lines back against the original file. @@ -300,87 +190,39 @@ If a hunk doesn't apply cleanly, cecli uses a number of strategies: - Vary the size and offset of the "context window" of *space* lines from the hunk that are used to localize the edit to a specific part of the file. - Combine the above mechanisms to progressively become more permissive about how to apply the hunk. -These flexible patching strategies are critical, and -removing them -radically increases the number of hunks which fail to apply. -**Experiments where flexible patching is disabled show a 9X increase in editing errors** on cecli's original Exercism benchmark. +These flexible patching strategies are critical, and removing them radically increases the number of hunks which fail to apply. **Experiments where flexible patching is disabled show a 9X increase in editing errors** on cecli's original Exercism benchmark. ## Refactoring benchmark -cecli has long used a -[benchmark suite based on 133 Exercism python exercises](https://cecli.dev/2023/07/02/benchmarks.html). -But these are mostly small coding problems, -usually requiring only a few dozen lines of code. -GPT-4 Turbo is typically only lazy on 2-3 of these exercises: -the ones with the most code and which involve refactoring. +Cecli has long used a [benchmark suite based on 133 Exercism python exercises](https://cecli.dev/2023/07/02/benchmarks.html). But these are mostly small coding problems, usually requiring only a few dozen lines of code. GPT-4 Turbo is typically only lazy on 2-3 of these exercises: the ones with the most code and which involve refactoring. -Based on this observation, I set out to build a benchmark based on refactoring -a non-trivial amount of code found in fairly large files. -To do this, I used python's `ast` module to analyze -[9 popular open source python repositories](https://github.com/cecli-AI/refactor-benchmark) -to identify challenging refactoring tasks. -The goal was to find: +Based on this observation, I set out to build a benchmark based on refactoring a non-trivial amount of code found in fairly large files. To do this, I used python's `ast` module to analyze [9 popular open source python repositories](https://github.com/cecli-AI/refactor-benchmark) to identify challenging refactoring tasks. The goal was to find: - Source files that contain classes with non-trivial methods, having 100-250+ AST nodes in their implementation. - Focus on methods that are part of a larger class, which has at least twice as much code as the method itself. - Select methods that don't use their `self` parameter, so they can be trivially refactored out of the class. -We can then turn each of these source files into a task for the benchmark, -where we ask GPT to do something like: +We can then turn each of these source files into a task for the benchmark, where we ask GPT to do something like: > Refactor the `_set_csrf_cookie` method in the `CsrfViewMiddleware` class to be a stand alone, top level function. > Name the new function `_set_csrf_cookie`, exactly the same name as the existing method. > Update any existing `self._set_csrf_cookie` calls to work with the new `_set_csrf_cookie` function. -A [simple python AST scanning script](https://github.com/cecli-dev/cecli/blob/main/benchmark/refactor_tools.py) -found 89 suitable files -and packaged them up as benchmark tasks. -Each task has a test -that checks if the refactor -was performed roughly correctly: +A [simple python AST scanning script](https://github.com/cecli-dev/cecli/blob/main/benchmark/refactor_tools.py) found 89 suitable files and packaged them up as benchmark tasks. Each task has a test that checks if the refactor was performed roughly correctly: - The updated source file must parse as valid python, to detect misapplied edits which produce invalid code. - The target method must now exist as a top-level function in the file. - This new top-level function must contain approximately the same number of AST nodes as the original class method. This ensures that GPT didn't elide code and replace it with comments. - The original class must still be present in the file, and it must be smaller by about the number of AST nodes in the method which was removed. This helps confirm that the method was removed from the class, without other significant modifications. -To be clear, this is not a rigorous test that the refactor was performed correctly. -But it does serve as a basic sanity check that the refactor was essentially done as a cut & paste, without eliding any code as comments. -And it correlates well with other laziness metrics -gathered during benchmarking like the -introduction of new comments that contain "...". +To be clear, this is not a rigorous test that the refactor was performed correctly. But it does serve as a basic sanity check that the refactor was essentially done as a cut & paste, without eliding any code as comments. And it correlates well with other laziness metrics gathered during benchmarking like the introduction of new comments that contain "...". -The result is a pragmatic -[benchmark suite that provokes, detects and quantifies GPT coding laziness](https://github.com/cecli-AI/refactor-benchmark). +The result is a pragmatic [benchmark suite that provokes, detects and quantifies GPT coding laziness](https://github.com/cecli-AI/refactor-benchmark). +## Conclusions and future work +Based on the refactor benchmark results, cecli's new unified diff format seems to dramatically increase GPT-4 Turbo's skill at more complex coding tasks. It also seems very effective at reducing the lazy coding which has been widely noted as a problem with GPT-4 Turbo. -## Conclusions and future work +Unified diffs was one of the very first edit formats I tried when originally building cecli. I think a lot of other AI coding assistant projects have also tried going down this path. It seems like any naive or direct use of structured diff formats is pretty much doomed to failure. But the techniques described here and incorporated into cecli provide a highly effective way to harness GPT's knowledge of unified diffs. -Based on the refactor benchmark results, -cecli's new unified diff format seems -to dramatically increase GPT-4 Turbo's skill at more complex coding tasks. -It also seems very effective at reducing the lazy coding -which has been widely noted as a problem with GPT-4 Turbo. - -Unified diffs was one of the very first edit formats I tried -when originally building cecli. -I think a lot of other AI coding assistant projects have also -tried going down this path. -It seems like any naive or direct use of structured diff formats -is pretty much doomed to failure. -But the techniques described here and -incorporated into cecli provide -a highly effective way to harness GPT's knowledge of unified diffs. - -There could be significant benefits to -fine tuning models on -cecli's simple, high level style of unified diffs. -Dropping line numbers from the hunk headers and focusing on diffs of -semantically coherent chunks of code -seems to be an important part of successful GPT code editing -(besides the relentless focus on flexibly applying edits). -Most LLMs will have already seen plenty of unified diffs -in their normal training data, and so should be -amenable to fining tuning towards this -particular diff style. +There could be significant benefits to fine tuning models on cecli's simple, high level style of unified diffs. Dropping line numbers from the hunk headers and focusing on diffs of semantically coherent chunks of code seems to be an important part of successful GPT code editing (besides the relentless focus on flexibly applying edits). Most LLMs will have already seen plenty of unified diffs in their normal training data, and so should be amenable to fining tuning towards this particular diff style. diff --git a/cecli/website/docs/usage.md b/cecli/website/docs/usage.md index 549ad0c00dd..e60cebfbedd 100644 --- a/cecli/website/docs/usage.md +++ b/cecli/website/docs/usage.md @@ -6,62 +6,39 @@ description: How to use cecli to pair program with AI and edit code in your loca # Usage -Run `cecli` with the source code files you want to edit. -These files will be "added to the chat session", so that -cecli can see their -contents and edit them for you. -They can be existing files or the name of files you want -cecli to create for you. +Run `cecli` with the source code files you want to edit. These files will be "added to the chat session", so that cecli can see their contents and edit them for you. They can be existing files or the name of files you want cecli to create for you. ``` cecli ... ``` -At the cecli `>` prompt, ask for code changes and cecli -will edit those files to accomplish your request. - +At the cecli `>` prompt, ask for code changes and cecli will edit those files to accomplish your request. ``` $ cecli factorial.py -cecli v0.37.1-dev -Models: gpt-4o with diff edit format, weak model gpt-3.5-turbo -Git repo: .git with 258 files -Repo-map: using 1024 tokens -Use /help to see in-chat commands, run with --help to see cmd line args -─────────────────────────────────────────────────────────────────────── +cecli v1.0.0 +Models deepseek-v4-flash (main) +Settings diff (edit format) • prompt cache • infinite output +Environment .git (258 files) • repo-map disabled +─────────────────────────────────────────────────────────────────── > Make a program that asks for a number and prints its factorial ... ``` -{% include help-tip.md %} +> **Tip:** +> Use `/help ` to [ask for help about using cecli](troubleshooting/support.html), customizing settings, troubleshooting, using LLMs, etc. ## Adding files -To edit files, you need to "add them to the chat". -Do this -by naming them on the cecli command line. -Or, you can use the in-chat -`/add` command to add files. With no arguments, `/add` will open a fuzzy finder that lets you select files from your repository. This feature is enabled if you have `fzf` installed. Otherwise, `/add` requires file paths as arguments. - +To edit files, you need to "add them to the chat". Do this by naming them on the cecli command line. Or, you can use the in-chat `/add` command to add files. With no arguments, `/add` will open a fuzzy finder that lets you select files from your repository. This feature is enabled if you have `fzf` installed. Otherwise, `/add` requires file paths as arguments. -Only add the files that need to be edited for your task. -Don't add a bunch of extra files. -If you add too many files, the LLM can get overwhelmed -and confused (and it costs more tokens). -cecli will automatically -pull in content from related files so that it can -[understand the rest of your code base](https://cecli.dev/docs/repomap.html). +Only add the files that need to be edited for your task. Don't add a bunch of extra files. If you add too many files, the LLM can get overwhelmed and confused (and it costs more tokens). cecli will automatically pull in content from related files so that it can [understand the rest of your code base](repomap.html). -You can use cecli without adding any files, -and it will try to figure out which files need to be edited based -on your requests. +You can use cecli without adding any files, and it will try to figure out which files need to be edited based on your requests. -{: .tip } -You'll get the best results if you think about which files need to be -edited. Add **just** those files to the chat. cecli will include -relevant context from the rest of your repo. +> **Tip:** You'll get the best results if you think about which files need to be edited. Add **just** those files to the chat. cecli will include relevant context from the rest of your repo. ## Read-only files @@ -75,28 +52,19 @@ You can also move a file from read-only to editable by using `/add` on a file th ## LLMs -{% include works-best.md %} +Cecli can [connect to almost any LLM, including local models](https://cecli.chat/docs/llms.html). ``` -# o3-mini -$ cecli --model o3-mini --api-key openai= +$ cecli --model gemini/gemini-3.5-flash + -# Claude 3.7 Sonnet -$ cecli --model sonnet --api-key anthropic= +$ cecli --model deepseek/deepseek-v4-flash ``` -Or you can run `cecli --model XXX` to launch cecli with -another model. -During your chat you can switch models with the in-chat -`/model` command. +Or you can run `cecli --model XXX` to launch cecli with another model. During your chat you can switch models with the in-chat `/model` command. ## Making changes -Ask cecli to make changes to your code. -It will show you some diffs of the changes it is making to -complete you request. -[cecli will git commit all of its changes](/docs/git.html), -so they are easy to track and undo. +Ask cecli to make changes to your code. It will show you some diffs of the changes it is making to complete you request. [cecli will git commit all of its changes](git.html), so they are easy to track and undo. -You can always use the `/undo` command to undo AI changes that you don't -like. +You can always use the `/undo` command to undo AI changes that you don't like. diff --git a/cecli/website/docs/usage/commands.md b/cecli/website/docs/usage/commands.md index 10d06994b65..9650275ebac 100644 --- a/cecli/website/docs/usage/commands.md +++ b/cecli/website/docs/usage/commands.md @@ -4,20 +4,9 @@ nav_order: 50 description: Control cecli with in-chat commands like /add, /model, etc. --- -# In-chat commands -{: .no_toc } +# Slash Commands -- TOC -{:toc} - -## Slash commands - -cecli supports commands from within the chat, which all start with `/`. - - +Cecli supports commands from within the chat, which all start with `/`. |Command|Description| |:------|:----------| @@ -68,26 +57,37 @@ cog.out(get_help_md()) | **/weak-model** | Switch the Weak Model to a new LLM | | **/web** | Scrape a webpage, convert to markdown and send in a message | - - -{: .tip } -You can easily re-send commands or messages. -Use the up arrow ⬆ to scroll back -or CONTROL-R to search your message history. +> **Tip:** You can easily re-send commands or messages. Use the up arrow ⬆ to scroll back or CONTROL-R to search your message history. -## Entering multi-line chat messages -{% include multi-line.md %} +## Non-TUI Related Notes -## Interrupting with CONTROL-C +### Multi-line Chat Messages -It's always safe to use Control-C to interrupt cecli if it isn't providing a useful response. The partial response remains in the conversation, so you can refer to it when you reply to the LLM with more information or direction. +You can send long, multi-line messages in the chat in a few ways: + - Paste a multi-line message directly into the chat. + - Enter `{` alone on the first line to start a multiline message and `}` alone on the last line to end it. + - Or, start with `{tag` (where "tag" is any sequence of letters/numbers) and end with `tag}`. This is useful when you need to include closing braces `}` in your message. + - Use Meta-ENTER to start a new line without sending the message (Esc+ENTER in some environments). + - Use `/paste` to paste text from the clipboard into the chat. + - Use the `/editor` command (or press `Ctrl-X Ctrl-E` if your terminal allows) to open your editor to create the next chat message. See [editor configuration docs](../config/editor.html) for more info. + - Use multiline-mode, which swaps the function of Meta-Enter and Enter, so that Enter inserts a newline, and Meta-Enter submits your command. To enable multiline mode: + - Use the `/multiline-mode` command to toggle it during a session. + - Use the `--multiline` switch. + +Example with a tag: +``` +{python +def hello(): + print("Hello}") # Note: contains a brace +python} +``` -## Keybindings +### Key Bindings The interactive prompt is built with [prompt-toolkit](https://github.com/prompt-toolkit/python-prompt-toolkit) which provides emacs and vi keybindings. -### Emacs +#### Emacs - `Up Arrow` : Move up one line in the current message. - `Down Arrow` : Move down one line in the current message. @@ -106,8 +106,7 @@ The interactive prompt is built with [prompt-toolkit](https://github.com/prompt- - `Ctrl-X Ctrl-E` : Open the current input in an external editor - `Ctrl-Y` : Paste (yank) text that was previously cut. - -### Vi +#### Vi To use vi/vim keybindings, run cecli with the `--vim` switch. @@ -132,5 +131,3 @@ To use vi/vim keybindings, run cecli with the `--vim` switch. - `dd` : Delete the current line. - `u` : Undo the last change. - `Ctrl-R` : Redo the last undone change. - - diff --git a/cecli/website/docs/usage/conventions.md b/cecli/website/docs/usage/conventions.md index 64c8601ea46..decf936a25c 100644 --- a/cecli/website/docs/usage/conventions.md +++ b/cecli/website/docs/usage/conventions.md @@ -1,16 +1,13 @@ --- parent: Usage nav_order: 800 -description: Tell cecli to follow your coding conventions when it works on your code. +description: Tell Cecli to follow your coding conventions when it works on your code. --- -# Specifying coding conventions +# Convention Files -Sometimes you want LLMs to be aware of certain coding guidelines, -like whether to provide type hints, which libraries or packages -to prefer, etc. +Sometimes you want LLMs to be aware of certain coding guidelines, like whether to provide type hints, which libraries or packages to prefer, etc. -The easiest way to do that with cecli is to simply create -a small markdown file and include it in the chat. +The easiest way to do that with cecli is to simply create a small markdown file and include it in the chat. For example, say we want our python code to: @@ -19,18 +16,14 @@ For example, say we want our python code to: - Use types everywhere possible. ``` -We would simply create a file like `CONVENTIONS.md` with those lines -and then we can add it to the cecli chat, along with the file(s) -that we want to edit. +We would simply create a file like `CONVENTIONS.md` with those lines and then we can add it to the cecli chat, along with the file(s) that we want to edit. -It's best to load the conventions file with `/rules CONVENTIONS.md` -or `cecli --rules CONVENTIONS.md`. +It's best to load the conventions file with `/rules CONVENTIONS.md` or `cecli --rules CONVENTIONS.md`. ## Always load conventions -You can also configure cecli to always load your conventions file -in the [`.cecli.conf.yml` config file](https://cecli.dev/docs/config/cecli_conf.html): +You can also configure cecli to always load your conventions file in the [`.cecli.conf.yml` config file](../config/conf.html): ```yaml diff --git a/cecli/website/docs/usage/copypaste.md b/cecli/website/docs/usage/copypaste.md index 3e3cbd7e2d2..69e432f0b54 100644 --- a/cecli/website/docs/usage/copypaste.md +++ b/cecli/website/docs/usage/copypaste.md @@ -6,113 +6,68 @@ nav_order: 850 description: cecli works with LLM web chat UIs --- -# Copy/paste with web chat - - - - - ## Working with an LLM web chat -[cecli can connect to most LLMs via API](https://cecli.dev/docs/llms.html) and works best that way. -But there are times when you may want to work with an LLM via its web chat interface: +[Cecli can connect to most LLMs via API](../llms.html) and works best that way. But there are times when you may want to work with an LLM via its web chat interface: - Workplace policies may limit your LLM usage to a proprietary web chat system. - The web chat LLM may have access to unique context or may have been specially fine tuned for your task. - It may be cost prohibitive to use some models via API. - There may not be an API available. -cecli has features for working with an LLM via its web chat interface. -This allows you to use the web chat LLM as the "big brain code architect" -while running cecli with a smaller, cheaper LLM to actually make changes -to your local files. +Cecli has features for working with an LLM via its web chat interface. This allows you to use the web chat LLM as the "big brain code architect" while running cecli with a smaller, cheaper LLM to actually make changes to your local files. -For this "file editor" part of the process -you can run cecli with many open source, free or very inexpensive LLMs. -For example, the demo video above shows cecli using DeepSeek to apply the changes -that o1-preview is suggesting in the web chat. +For this "file editor" part of the process you can run cecli with many open source, free or very inexpensive LLMs. For example, the demo video above shows cecli using DeepSeek to apply the changes that o1-preview is suggesting in the web chat. ### Copy cecli's code context to your clipboard, paste into the web UI -The `/copy-context ` command can be used in chat to copy cecli's code context to your clipboard. -It will include: +The `/copy-context ` command can be used in chat to copy cecli's code context to your clipboard. It will include: - All the files which have been added to the chat via `/add`. - Any read only files which have been added via `/read`. -- cecli's [repository map](https://cecli.dev/docs/repomap.html) that brings in code context related to the above files from elsewhere in your git repo. +- Cecli's [repository map](../repomap.html) that brings in code context related to the above files from elsewhere in your git repo. - Some instructions to the LLM that ask it to output change instructions concisely. - If you include ``, they will be copied too. -You can paste the context into your browser, and start interacting with the LLM web chat to -ask for code changes. +You can paste the context into your browser, and start interacting with the LLM web chat to ask for code changes. ### Paste the LLM's reply back into cecli to edit your files -Once the LLM has replied, you can use the "copy response" button in the web UI to copy -the LLM's response. -Back in cecli, you can run `/paste` and cecli will edit your files -to implement the changes suggested by the LLM. +Once the LLM has replied, you can use the "copy response" button in the web UI to copy the LLM's response. Back in cecli, you can run `/paste` and cecli will edit your files to implement the changes suggested by the LLM. -You can use a cheap, efficient model like GPT-4o Mini, DeepSeek or Qwen to do these edits. -This works best if you run cecli with `--edit-format editor-diff` or `--edit-format editor-whole`. +You can use a cheap, efficient model like gpt-5-mini, claude-4.6-haiku, deepseek-v4-flash or qwen3.6-35b-a3b to do these edits. This works best if you run cecli with `--edit-format editor-diff` or `--edit-format editor-whole`. ### Copy/paste mode -cecli has a `--copy-paste` mode that streamlines this entire process: +Cecli has a `--copy-paste` mode that streamlines this entire process: - Whenever you `/add` or `/read` files, cecli will automatically copy the entire, updated -code context to your clipboard. -You'll see "Copied code context to clipboard" whenever this happens. +code context to your clipboard. You'll see "Copied code context to clipboard" whenever this happens. - When you copy the LLM reply to your clipboard outside cecli, cecli will automatically notice -and load it into the cecli chat. -Just press ENTER to send the message -and cecli will apply the LLMs changes to your local files. +and load it into the cecli chat. Just press ENTER to send the message and cecli will apply the LLMs changes to your local files. - cecli will automatically select the best edit format for this copy/paste functionality. Depending on the LLM you have cecli use, it will be either `editor-whole` or `editor-diff`. -### No API access? Use `cp:model` +### No API access? Use `cp:` If your only access to an LLM is via a web chat (no API keys, no local models), you can run cecli with a model name prefixed by cp:. This performs the entire workflow via copy/paste without making any API calls. -#### What cp: does +#### What the cp: prefix does - Activates CopyPasteCoder, which never sends requests to any LLM API. - Uses the same copy/paste workflow described above #### Token and cost tracking -- cecli uses the text after cp: as the "model name" for local token counting and cost estimation. +- Cecli uses the text after cp: as the "model name" for local token counting and cost estimation. - If the label matches a known model in cecli's pricing tables, cecli will estimate tokens/costs using that model's rates; otherwise, costs may show as unknown or zero. - With flat-rate web chat plans, you can treat any "estimated cost" displayed by cecli as your "savings" versus if you had called an API model. ## Terms of service -Be sure to review the Terms Of Service of any LLM web chat service you use with -these features. -These features are not intended to be used in violation of any service's Terms Of Service (TOS). +Be sure to review the Terms Of Service of any LLM web chat service you use with these features. These features are not intended to be used in violation of any service's Terms Of Service (TOS). -cecli's web chat features have been designed to be compliant with the -terms of service of most LLM web chats. +Cecli's web chat features have been designed to be compliant with the terms of service of most LLM web chats. There are 4 copy/paste steps involved when coding with an LLM web chat: @@ -121,16 +76,8 @@ There are 4 copy/paste steps involved when coding with an LLM web chat: 3. Copy the reply from the LLM web chat. 4. Paste the LLM reply into cecli. -Most LLM web chat TOS prohibit automating steps (2) and (3) where code -is copied from and pasted into the web chat. -cecli's `--copy-paste` mode leaves those as 100% manual steps for the user to complete. -It simply streamlines steps (1) and (4) that are interactions with cecli, -and which should not be under the scope of an LLM web chat TOS. +Most LLM web chat TOS prohibit automating steps (2) and (3) where code is copied from and pasted into the web chat. cecli's `--copy-paste` mode leaves those as 100% manual steps for the user to complete. It simply streamlines steps (1) and (4) that are interactions with cecli, and which should not be under the scope of an LLM web chat TOS. -If you are concerned that -the automatic interactions with cecli in steps (1) and (4) may be problematic with respect to -your LLM web chat provider's TOS, you can forego `--copy-paste` mode. -Instead, manually use the `/copy-context` and `/paste` commands if that -will keep you in compliance. +If you are concerned that the automatic interactions with cecli in steps (1) and (4) may be problematic with respect to your LLM web chat provider's TOS, you can forego `--copy-paste` mode. Instead, manually use the `/copy-context` and `/paste` commands if that will keep you in compliance. -Again, do not use these features in violation of any service's Terms Of Service. +Again, do not use these features in violation of any provider's Terms Of Service. diff --git a/cecli/website/docs/usage/images-urls.md b/cecli/website/docs/usage/images-urls.md index 04c9ba21a35..892407260d8 100644 --- a/cecli/website/docs/usage/images-urls.md +++ b/cecli/website/docs/usage/images-urls.md @@ -10,17 +10,14 @@ You can add images and URLs to the cecli chat. ## Images -cecli supports working with image files for many vision-capable models -like GPT-4o and Claude 3.7 Sonnet. -Adding images to a chat can be helpful in many situations: +Cecli supports working with image files for many multi-modal models. Adding images to a chat can be helpful in many situations: - Add screenshots of web pages or UIs that you want cecli to build or modify. - Show cecli a mockup of a UI you want to build. - Screenshot an error message that is otherwise hard to copy & paste as text. - Etc. -You can add images to the chat just like you would -add any other file: +You can add images to the chat just like you would add any other file: - Use `/add ` from within the chat - Use `/paste` to paste an image from your clipboard into the chat. @@ -28,8 +25,7 @@ add any other file: ## Web pages -cecli can scrape the text from URLs and add it to the chat. -This can be helpful to: +Cecli can scrape the text from URLs and add it to the chat. This can be helpful to: - Include documentation pages for less popular APIs. - Include the latest docs for libraries or packages that are newer than the model's training cutoff date. diff --git a/cecli/website/docs/usage/lint-test.md b/cecli/website/docs/usage/lint-test.md index c3dc0a2d2dc..e2bbdaf5104 100644 --- a/cecli/website/docs/usage/lint-test.md +++ b/cecli/website/docs/usage/lint-test.md @@ -6,28 +6,15 @@ description: Automatically fix linting and testing errors. # Linting and testing -cecli can automatically lint and test your code -every time it makes changes. -This helps identify and repair any problems introduced -by the AI edits. +Cecli can automatically lint and test your code every time it makes changes. This helps identify and repair any problems introduced by the AI edits. ## Linting -cecli comes with built in linters for -[most popular languages](/docs/languages.html) -and will automatically lint code in these languages. +Cecli comes with built in linters for [most popular languages](../languages.html) and will automatically lint code in these languages. -Or you can specify your favorite linter -with the `--lint-cmd ` switch. -The lint command should accept the filenames -of the files to lint. -If there are linting errors, cecli expects the -command to print them on stdout/stderr -and return a non-zero exit code. -This is how most linters normally operate. +Or you can specify your favorite linter with the `--lint-cmd ` switch. The lint command should accept the filenames of the files to lint. If there are linting errors, cecli expects the command to print them on stdout/stderr and return a non-zero exit code. This is how most linters normally operate. -By default, cecli will lint any files which it edits. -You can disable this with the `--no-auto-lint` switch. +By default, cecli will lint any files which it edits. You can disable this with the `--no-auto-lint` switch. ### Per-language linters @@ -35,12 +22,9 @@ To specify different linters based on the code language, use `--lint "language: ### Code formatting "linters" -Many people use code formatters as linters, to format and pretty their code. -These tools sometimes return non-zero exit codes if they make changes, which will -confuse cecli into thinking there's an actual lint error that needs to be fixed. +Many people use code formatters as linters, to format and pretty their code. These tools sometimes return non-zero exit codes if they make changes, which will confuse cecli into thinking there's an actual lint error that needs to be fixed. -You can use formatters by wrapping them in a shell script like this and setting -the script as your linter. +You can use formatters by wrapping them in a shell script like this and setting the script as your linter. ```bash #!/bin/bash @@ -58,61 +42,45 @@ pre-commit run --files "$@" >/dev/null \ ## Testing -You can run tests with `/test `. -cecli will run the test command without any arguments. -If there are test errors, cecli expects the -command to print them on stdout/stderr -and return a non-zero exit code. +You can run tests with `/test `. cecli will run the test command without any arguments. If there are test errors, cecli expects the command to print them on stdout/stderr and return a non-zero exit code. -cecli will try and fix any errors -if the command returns a non-zero exit code. +Cecli will try and fix any errors if the command returns a non-zero exit code. -You can configure cecli to run your test suite -after each time the AI edits your code -using the `--test-cmd ` and -`--auto-test` switch. +You can configure cecli to run your test suite after each time the AI edits your code using the `--test-cmd ` and `--auto-test` switch. ## Compiled languages -If you want to have cecli compile code after each edit, you -can use the lint and test commands to achieve this. +If you want to have cecli compile code after each edit, you can use the lint and test commands to achieve this. - You might want to recompile each file which was modified -to check for compile errors. -To do this, -provide a `--lint-cmd` which both lints and compiles the file. -You could create a small shell script for this. +to check for compile errors. To do this, provide a `--lint-cmd` which both lints and compiles the file. You could create a small shell script for this. - You might want to rebuild the entire project after files -are edited to check for build errors. -To do this, -provide a `--test-cmd` which both builds and tests the project. -You could create a small shell script for this. -Or you may be able to do something as simple as -`--test-cmd "dotnet build && dotnet test"`. +are edited to check for build errors. To do this, provide a `--test-cmd` which both builds and tests the project. You could create a small shell script for this. Or you may be able to do something as simple as `--test-cmd "dotnet build && dotnet test"`. ## Manually running code -You can use the `/run` command in the chat to run your code -and optionally share the output with cecli. -This can be useful to share error messages or to show cecli -the code's output before asking for changes or corrections. +You can use the `/run` command in the chat to run your code and optionally share the output with cecli. This can be useful to share error messages or to show cecli the code's output before asking for changes or corrections. -
-> cecli v0.43.5-dev - -#### /run python myscript.py ``` +/run python myscript.py + Traceback (most recent call last): File "myscript.py", line 22, in \ Add the output to the chat? y +``` + +> Tip: +> You can also preface prompts with an exclamation mark e.g. `!run python myscript.py`. +> Use double exclamation points (`!!run python myscript.py`) to suppress output capture +> Use triple exclamation points (`!!!sudo run python myscript.py`) to suppress output capture and background the TUI for interactive commands + + -
diff --git a/cecli/website/docs/usage/modes.md b/cecli/website/docs/usage/modes.md index 2bc8ca06c2e..4d365e09a11 100644 --- a/cecli/website/docs/usage/modes.md +++ b/cecli/website/docs/usage/modes.md @@ -1,26 +1,22 @@ --- parent: Usage nav_order: 60 -description: Using the code, architect, ask and help chat modes. +description: Using the code, architect, ask, help and agent modes. --- # Chat modes -cecli has a few different chat modes: +Cecli has a few different chat modes: - `code` - cecli will make changes to your code to satisfy your requests. - `ask` - cecli will discuss your code and answer questions about it, but never make changes. - `architect` - Like code mode, cecli will change your files. An architect model will propose changes and an editor model will translate that proposal into specific file edits. - `help` - cecli will answer questions about cecli: usage, configuration, troubleshooting, etc. +- `agent` - cecli will autonomously explore and modify your codebase using local tools, discovering and managing the relevant files itself. -By default, cecli starts in "code" mode. As you are talking, you can -send individual messages in a specific mode using -`/code`, `/architect`, `/ask`, and `/help` commands: -Using these `/`-commands applies just to that particular message. -Your next message will go back to the active mode (usually "code" mode by default). +By default, cecli starts in "code" mode. As you are talking, you can send individual messages in a specific mode using `/code`, `/architect`, `/ask`, `/help`, and `/agent` commands: Using these `/`-commands applies just to that particular message. Your next message will go back to the active mode (usually "code" mode by default). -You can switch the active mode in a sticky way -with the `/chat-mode ` command: +You can switch the active mode in a sticky way with the `/chat-mode ` command: ``` /chat-mode code @@ -29,16 +25,18 @@ with the `/chat-mode ` command: /chat-mode help ``` +Note: agent mode is not a `/chat-mode` value — it is an operational mode you enter with `/agent` (or launch with `--agent`). See [Agent mode](#agent-mode) below. + Or you can switch between coding modes using these commands without arguments: ``` /code /architect /ask +/agent ``` -Or you can launch cecli in one of the modes with the `--chat-mode ` switch. -There is also a special shortcut `--architect` to launch in `--chat-mode architect`. +Or you can launch cecli in one of the modes with the `--chat-mode ` switch. There is also a special shortcut `--architect` to launch in `--chat-mode architect`, and `--agent` to launch directly in agent mode. The cecli prompt will indicate the active mode: @@ -46,30 +44,42 @@ The cecli prompt will indicate the active mode: > This is code mode. ask> This is ask mode. architect> This is architect mode. +agent> This is agent mode. ``` +## Agent mode + +Agent mode is cecli's autonomous, tool-based operational mode. Instead of relying on traditional edit formats, the LLM works through a continuous loop of tool calls — discovering relevant files, analyzing them, making edits, and processing the results — until the task is complete or the iteration limit is reached. + +You can activate agent mode in several ways: + +- In the chat with `/agent`. This switches to agent mode temporarily to autonomously discover and manage relevant files, then returns to your original mode. For example: `/agent Fix this bug` or `/agent Add a new feature`. +- On the command line with `--agent` (`cecli ... --agent`). +- In your configuration files with `agent: true`. + +### What agent mode provides + +- **Autonomous file management**: cecli discovers and manages relevant files itself, rather than relying only on the files you explicitly add. +- **Enhanced context management**: entering agent mode enables context management for large files, and you can tune it with `/context-management` and `/context-blocks`. +- **Skills**: loading, including, excluding, and removing skills is only available in agent mode (`/load-skill`, `/include-skill`, `/exclude-skill`, `/remove-skill`). +- **Sub-agents**: delegate sub-tasks to specialized sub-agents for parallel or focused work. +- **Dedicated agent model**: choose a separate model for agent mode with `--agent-model` or `/agent-model`. + +Agent mode works well for open-ended requests such as "fix this bug" or "add a new feature", where the relevant files aren't obvious up front. See [Agent Mode](../config/agent-mode.html) for full configuration details, including the tool registry, context management, and orchestration settings. ## Ask/code workflow A recommended workflow is to bounce back and forth between `/ask` and `/code` modes. -Use ask mode to discuss what you want to do, get suggestions or options from cecli -and provide feedback on the approach. -Once cecli understands the mission, switch to code mode to have it start editing -your files. -All the conversation and decision making from ask mode will -help ensure that the correct code changes are performed. +Use ask mode to discuss what you want to do, get suggestions or options from cecli and provide feedback on the approach. Once cecli understands the mission, switch to code mode to have it start editing your files. All the conversation and decision making from ask mode will help ensure that the correct code changes are performed. -You can be very terse when you finally switch from ask to code mode. -Saying something as simple as "go ahead" in code mode will -have cecli execute on the plan you've been discussing. +You can be very terse when you finally switch from ask to code mode. Saying something as simple as "go ahead" in code mode will have cecli execute on the plan you've been discussing. -Here's an example with two ask mode messages to agree on the plan, -followed by two terse code mode messages to edit the code. +Here's an example with two ask mode messages to agree on the plan, followed by two terse code mode messages to edit the code. ```` ───────────────────────────────────────────────────────────────────────────────────── -cecli v0.79.0 +cecli v1.0.0 Model: gemini/gemini-2.5-pro-exp-03-25 with diff-fenced edit format > /ask What's the best thing to print if we're making a quick little demo program? @@ -105,58 +115,32 @@ hello.py ```` -You can think of this ask/code workflow as a more fluid version of -architect mode, but working just with one model the whole time. +You can think of this ask/code workflow as a more fluid version of architect mode, but working just with one model the whole time. ## Architect mode and the editor model When you are in architect mode, cecli sends your requests to two models: 1. First, it sends your request to the main model which will act as an architect -to propose how to solve your coding request. -The main model is configured with `/model` or `--model`. +to propose how to solve your coding request. The main model is configured with `/model` or `--model`. 2. cecli then sends another request to an "editor model", -asking it to turn the architect's proposal into specific file editing instructions. -cecli has built in defaults to select an editor model based on your main model. -Or, you can choose a specific editor model with `--editor-model `. - -Certain LLMs aren't able to propose coding solutions *and* -specify detailed file edits all in one go. -For these models, architect mode can produce better results than code mode -by pairing them -with an editor model that is responsible for generating the file editing instructions. -But this uses two LLM requests, -which can take longer and increase costs. - -Architect mode is especially useful with OpenAI's o1 models, which are strong at -reasoning but less capable at editing files. -Pairing an o1 architect with an editor model like GPT-4o or Sonnet will -give the best results. - -But architect mode can also be helpful when you use the same model -as both the architect and the editor. -Allowing the model two requests to solve the problem and edit the files -can sometimes provide better results. - -The editor model uses one of cecli's edit formats to let the LLM -edit source files. -cecli will pick a suitable edit format by default, -but you can customize it with `--editor-edit-format `. -The -["editor-diff" and "editor-whole" edit formats](/docs/more/edit-formats.html#editor-diff-and-editor-whole) -are the recommended edit formats when using architect mode. -See this article on -[cecli's architect/editor mode](/2024/09/26/architect.html) -for more details. +asking it to turn the architect's proposal into specific file editing instructions. cecli has built in defaults to select an editor model based on your main model. Or, you can choose a specific editor model with `--editor-model `. + +Certain LLMs aren't able to propose coding solutions *and* specify detailed file edits all in one go. For these models, architect mode can produce better results than code mode by pairing them with an editor model that is responsible for generating the file editing instructions. But this uses two LLM requests, which can take longer and increase costs. + +Architect mode is especially useful with OpenAI's o1 models, which are strong at reasoning but less capable at editing files. Pairing an o1 architect with an editor model like GPT-4o or Sonnet will give the best results. + +But architect mode can also be helpful when you use the same model as both the architect and the editor. Allowing the model two requests to solve the problem and edit the files can sometimes provide better results. + +The editor model uses one of cecli's edit formats to let the LLM edit source files. cecli will pick a suitable edit format by default, but you can customize it with `--editor-edit-format `. The ["editor-diff" and "editor-whole" edit formats](../more/edit-formats.html#edit-formats-editor-diff-and-editor-whole) are the recommended edit formats when using architect mode. See this article on [cecli's architect/editor mode](https://cecli.dev/2024/09/26/architect.html) for more details. ## Examples -
-> cecli v0.47.1-dev +> cecli v1.0.0 > Models: claude-3-5-sonnet-20240620 with diff edit format > Git repo: .git with 298 files > Repo-map: using 1024 tokens @@ -168,8 +152,7 @@ This is collection of python functions that compute various math functions. #### /help How do I use cecli with ollama? -Run `cecli --model ollama/`. -See these docs for more info: https://cecli.dev/docs/llms/ollama.html +Run `cecli --model ollama/`. See these docs for more info: https://cecli.dev/docs/llms/ollama/ #### /code Add a function to calculate the factorial of a number @@ -190,10 +173,7 @@ This function uses recursion to calculate the factorial. It's been added to your #### /architect Can we make this simpler? -Yes, you could replace the `factorial()` function with a call to the `math.factorial()` -builtin. -This way you don't have to maintain a custom factorial implementation, -and the builtin function is well optimized. +Yes, you could replace the `factorial()` function with a call to the `math.factorial()` builtin. This way you don't have to maintain a custom factorial implementation, and the builtin function is well optimized. ```python <<<<<<< SEARCH @@ -206,6 +186,3 @@ def factorial(n): from math import factorial >>>>>>> REPLACE ``` - -
- diff --git a/cecli/website/docs/usage/not-code.md b/cecli/website/docs/usage/not-code.md index 3cd75210b52..9b6add0e422 100644 --- a/cecli/website/docs/usage/not-code.md +++ b/cecli/website/docs/usage/not-code.md @@ -7,17 +7,12 @@ description: Use cecli to edit configuration files, documentation, and other tex # Editing config & text files -cecli isn't just for code, it can be very helpful when editing -almost any text file. -You can use cecli to make changes to your shell & ssh settings, -Dockerfiles -or pretty much any configuration or documentation file. +Cecli isn't just for code, it can be very helpful when editing almost any text file. You can use cecli to make changes to your shell & ssh settings, Dockerfiles or pretty much any configuration or documentation file. Here are some practical examples of modifying common config/text files: ## Shell Configuration -
$ cecli .bashrc Added .bashrc to the chat. @@ -29,11 +24,9 @@ Added .bashrc to the chat. + alias ll='ls -alh' + export PATH="$PATH:$HOME/.local/bin:$PATH" ``` -
## SSH Configurations -
$ cecli ~/.ssh/config Added config to the chat. @@ -48,11 +41,9 @@ Added config to the chat. + IdentityFile ~/.ssh/deploy_key + ProxyJump bastion.example.com ``` -
## Docker Setup -
$ cecli Dockerfile docker-compose.yml Added Dockerfile and docker-compose.yml to the chat. @@ -76,11 +67,9 @@ Added Dockerfile and docker-compose.yml to the chat. + volumes: + - pgdata:/var/lib/postgresql/data ``` -
## Git Configuration -
$ cecli .gitconfig Added .gitconfig to the chat. @@ -93,10 +82,8 @@ Added .gitconfig to the chat. + [color] + ui = auto ``` -
## System Configuration -
$ cecli /etc/hosts # May need sudo Added hosts to the chat. @@ -107,11 +94,9 @@ Added hosts to the chat. + 127.0.0.1 ads.example.com + 127.0.0.1 track.analytics.co ``` -
## Editor Configs -
$ cecli .vimrc Added .vimrc to the chat. @@ -122,10 +107,8 @@ Added .vimrc to the chat. + set number + autocmd FileType python set tabstop=4 shiftwidth=4 expandtab ``` -
## VSCode Configuration -
$ cecli settings.json Added settings.json to the chat. @@ -136,10 +119,8 @@ Added settings.json to the chat. + "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode" ``` -
## Markdown Documentation -
$ cecli README.md Added README.md to the chat. @@ -157,10 +138,8 @@ Added README.md to the chat. + pipx install cool-app-10k + ``` ``` -
## XML Configuration -
$ cecli pom.xml Added pom.xml to the chat. @@ -174,6 +153,5 @@ Added pom.xml to the chat. + test + ``` -
diff --git a/cecli/website/docs/usage/notifications.md b/cecli/website/docs/usage/notifications.md index 6be21191389..5b2371e8800 100644 --- a/cecli/website/docs/usage/notifications.md +++ b/cecli/website/docs/usage/notifications.md @@ -8,9 +8,7 @@ description: cecli can notify you when it's waiting for your input. # Notifications -cecli can notify you when it's done working and is -waiting for your input. -This is especially useful for long-running operations or when you're multitasking. +Cecli can notify you when it's done working and is waiting for your input. This is especially useful for long-running operations or when you're multitasking. ## Usage @@ -24,10 +22,10 @@ When enabled, cecli will notify you when the LLM has finished generating a respo ## OS-Specific Notifications -cecli automatically detects your operating system and uses an appropriate notification method: +Cecli automatically detects your operating system and uses an appropriate notification method: -- **macOS**: Uses `terminal-notifier` if available, falling back to AppleScript notifications - **Linux**: Uses `notify-send` or `zenity` if available +- **MacOS**: Uses `terminal-notifier` if available, falling back to AppleScript notifications - **Windows**: Uses PowerShell to display a message box ## Custom Notification Commands @@ -46,8 +44,7 @@ cecli --notifications-command "say 'cecli is ready'" ### Remote Notifications -For remote notifications you could use [Apprise](https://github.com/caronc/apprise), -which is a cross-platform Python library for sending notifications to various services. +For remote notifications you could use [Apprise](https://github.com/caronc/apprise), which is a cross-platform Python library for sending notifications to various services. We can use Apprise to send notifications to Slack diff --git a/cecli/website/docs/usage/optional.md b/cecli/website/docs/usage/optional.md index 2bcce8a9501..5a02ad0adf7 100644 --- a/cecli/website/docs/usage/optional.md +++ b/cecli/website/docs/usage/optional.md @@ -4,18 +4,13 @@ nav_order: 25 --- # Optional steps -{: .no_toc } The steps below are completely optional. -- TOC -{:toc} ## Install git -cecli works best if you have git installed. -Here are -[instructions for installing git in various environments](https://github.com/git-guides/install-git). +Cecli works best if you have git installed. Here are [instructions for installing git in various environments](https://github.com/git-guides/install-git). ## Setup an API key @@ -26,41 +21,26 @@ You need an key from an API provider to work with most models: - [DeepSeek](https://platform.deepseek.com/api_keys) provides DeepSeek R1 and DeepSeek Chat V3. - [OpenRouter](https://openrouter.ai/keys) allows you to access models from many providers using a single key. -You can [store your api keys in configuration or env files](/docs/config/api-keys.html) -and they will be loaded automatically whenever you run cecli. +You can [store your api keys in configuration or env files](../config/api-keys.html) and they will be loaded automatically whenever you run cecli. ## Enable Playwright -cecli supports adding web pages to the chat with the `/web ` command. -When you add a url to the chat, cecli fetches the page and scrapes its -content. +Cecli supports adding web pages to the chat with the `/web ` command. When you add a url to the chat, cecli fetches the page and scrapes its content. -By default, cecli uses the `httpx` library to scrape web pages, but this only -works on a subset of web pages. -Some sites explicitly block requests from tools like httpx. -Others rely heavily on javascript to render the page content, -which isn't possible using only httpx. +By default, cecli uses the `httpx` library to scrape web pages, but this only works on a subset of web pages. Some sites explicitly block requests from tools like httpx. Others rely heavily on javascript to render the page content, which isn't possible using only httpx. -cecli works best with all web pages if you install -Playwright's chromium browser and its dependencies: +Cecli works best with all web pages if you install Playwright's chromium browser and its dependencies: ``` playwright install --with-deps chromium ``` -See the -[Playwright for Python documentation](https://playwright.dev/python/docs/browsers#install-system-dependencies) -for additional information. +See the [Playwright for Python documentation](https://playwright.dev/python/docs/browsers#install-system-dependencies) for additional information. ## Enable voice coding -cecli supports -[coding with your voice](https://cecli.dev/docs/usage/voice.html) -using the in-chat `/voice` command. -cecli uses the [PortAudio](http://www.portaudio.com) library to -capture audio. -Installing PortAudio is completely optional, but can usually be accomplished like this: +Cecli supports [coding with your voice](voice.html) using the in-chat `/voice` command. cecli uses the [PortAudio](http://www.portaudio.com) library to capture audio. Installing PortAudio is completely optional, but can usually be accomplished like this: - For Windows, there is no need to install PortAudio. - For Mac, do `brew install portaudio` @@ -69,15 +49,9 @@ Installing PortAudio is completely optional, but can usually be accomplished lik ## Add cecli to your IDE/editor -You can use -[cecli's `--watch-files` mode](https://cecli.dev/docs/usage/watch.html) -to integrate with any IDE or editor. +You can use [cecli's `--watch-files` mode](watch.html) to integrate with any IDE or editor. -There are a number of 3rd party cecli plugins for various IDE/editors. -It's not clear how well they are tracking the latest -versions of cecli, -so it may be best to just run the latest -cecli in a terminal alongside your editor and use `--watch-files`. +There are a number of 3rd party cecli plugins for various IDE/editors. It's not clear how well they are tracking the latest versions of cecli, so it may be best to just run the latest cecli in a terminal alongside your editor and use `--watch-files`. ### NeoVim @@ -87,14 +61,8 @@ cecli in a terminal alongside your editor and use `--watch-files`. ### VS Code -You can run cecli inside a VS Code terminal window. -There are a number of 3rd party -[cecli plugins for VSCode](https://marketplace.visualstudio.com/search?term=cecli%20-kodu&target=VSCode&category=All%20categories&sortBy=Relevance). +You can run cecli inside a VS Code terminal window. There are a number of 3rd party [cecli plugins for VSCode](https://marketplace.visualstudio.com/search?term=cecli%20-kodu&target=VSCode&category=All%20categories&sortBy=Relevance). ### Other editors -If you are interested in creating an cecli plugin for your favorite editor, -please let us know by opening a -[GitHub issue](https://github.com/cecli-dev/cecli/issues). - - +If you are interested in creating an cecli plugin for your favorite editor, please let us know by opening a [GitHub issue](https://github.com/cecli-dev/cecli/issues). diff --git a/cecli/website/docs/usage/sessions.md b/cecli/website/docs/usage/sessions.md index e9abab42814..f6473728724 100644 --- a/cecli/website/docs/usage/sessions.md +++ b/cecli/website/docs/usage/sessions.md @@ -6,7 +6,7 @@ description: Session management utilities to save and load work across multiple # Session Management -cecli provides session management commands that allow you to save, load, and manage your chat sessions. This is particularly useful for: +Cecli provides session management commands that allow you to save, load, and manage your chat sessions. This is particularly useful for: - Continuing work on complex projects across multiple sessions - Recreating specific development environments @@ -18,7 +18,7 @@ cecli provides session management commands that allow you to save, load, and man Save the current chat session to a named file in `.cecli/sessions/`. ### Auto-Save and Auto-Load -cecli can automatically save and load sessions using command line options: +Cecli can automatically save and load sessions using command line options: **Auto-save:** ```bash diff --git a/cecli/website/docs/usage/tips.md b/cecli/website/docs/usage/tips.md index b1440c9c22a..f5c87a48ef2 100644 --- a/cecli/website/docs/usage/tips.md +++ b/cecli/website/docs/usage/tips.md @@ -8,27 +8,19 @@ description: Tips for AI pair programming with cecli. ## Just add the files that need to be changed to the chat -Take a moment and think about which files will need to be changed. -cecli can often figure out which files to edit all by itself, but the most efficient approach is for you to add the files to the chat. +Take a moment and think about which files will need to be changed. cecli can often figure out which files to edit all by itself, but the most efficient approach is for you to add the files to the chat. ## Don't add lots of files to the chat -Just add the files you think need to be edited. -Too much irrelevant code will distract and confuse the LLM. -cecli uses a [map of your entire git repo](https://cecli.dev/docs/repomap.html) -so is usually aware of relevant classes/functions/methods elsewhere in your code base. -It's ok to add 1-2 highly relevant files that don't need to be edited, -but be selective. +Just add the files you think need to be edited. Too much irrelevant code will distract and confuse the LLM. cecli uses a [map of your entire git repo](../repomap.html) so is usually aware of relevant classes/functions/methods elsewhere in your code base. It's ok to add 1-2 highly relevant files that don't need to be edited, but be selective. ## Break your goal down into bite sized steps -Do them one at a time. -Adjust the files added to the chat as you go: `/drop` files that don't need any more changes, `/add` files that need changes for the next step. +Do them one at a time. Adjust the files added to the chat as you go: `/drop` files that don't need any more changes, `/add` files that need changes for the next step. ## For complex changes, discuss a plan first -Use the [`/ask` command](modes.html) to make a plan with cecli. -Once you are happy with the approach, just say "go ahead" without the `/ask` prefix. +Use the [`/ask` command](modes.html) to make a plan with cecli. Once you are happy with the approach, just say "go ahead" without the `/ask` prefix. ## If cecli gets stuck @@ -37,27 +29,17 @@ Once you are happy with the approach, just say "go ahead" without the `/ask` pre - Use `/ask` to discuss a plan before cecli starts editing code. - Use the [`/model` command](commands.html) to switch to a different model and try again. Switching between GPT-4o and Sonnet will often get past problems. - If cecli is hopelessly stuck, -just code the next step yourself and try having cecli code some more after that. -Take turns and pair program with cecli. +just code the next step yourself and try having cecli code some more after that. Take turns and pair program with cecli. ## Creating new files -If you want cecli to create a new file, add it to the repository first with `/add `. -This way cecli knows this file exists and will write to it. -Otherwise, cecli might write the changes to an existing file. -This can happen even if you ask for a new file, as LLMs tend to focus a lot -on the existing information in their contexts. +If you want cecli to create a new file, add it to the repository first with `/add `. This way cecli knows this file exists and will write to it. Otherwise, cecli might write the changes to an existing file. This can happen even if you ask for a new file, as LLMs tend to focus a lot on the existing information in their contexts. ## Fixing bugs and errors -If your code is throwing an error, -use the [`/run` command](commands.html) -to share the error output with the cecli. -Or just paste the errors into the chat. Let the cecli figure out how to fix the bug. +If your code is throwing an error, use the [`/run` command](commands.html) to share the error output with the cecli. Or just paste the errors into the chat. Let the cecli figure out how to fix the bug. -If test are failing, use the [`/test` command](lint-test.html) -to run tests and -share the error output with the cecli. +If test are failing, use the [`/test` command](lint-test.html) to run tests and share the error output with the cecli. ## Providing docs @@ -75,5 +57,24 @@ and cecli will scrape and read it. For example: `Add a submit button like this h Use Control-C to interrupt cecli if it isn't providing a useful response. The partial response remains in the conversation, so you can refer to it when you reply with more information or direction. -{% include multi-line.md %} - +You can send long, multi-line messages in the chat in a few ways: + - Paste a multi-line message directly into the chat. + - Enter `{` alone on the first line to start a multiline message and `}` alone on the last line to end it. + - Or, start with `{tag` (where "tag" is any sequence of letters/numbers) and end with `tag}`. This is useful when you need to include closing braces `}` in your message. + - Use Meta-ENTER to start a new line without sending the message (Esc+ENTER in some environments). + - Use `/paste` to paste text from the clipboard into the chat. + - Use the `/editor` command (or press `Ctrl-X Ctrl-E` if your terminal allows) to open your editor to create the next chat message. See [editor configuration docs](../config/editor.html) for more info. + - Use multiline-mode, which swaps the function of Meta-Enter and Enter, so that Enter inserts a newline, and Meta-Enter submits your command. To enable multiline mode: + - Use the `/multiline-mode` command to toggle it during a session. + - Use the `--multiline` switch. + +Example with a tag: +``` +{python +def hello(): + print("Hello}") # Note: contains a brace +python} +``` + +People often ask for SHIFT-ENTER to be a soft-newline. +Unfortunately there is no portable way to detect that keystroke in terminals. diff --git a/cecli/website/docs/usage/voice.md b/cecli/website/docs/usage/voice.md index 997119ce8b8..9410037b4f4 100644 --- a/cecli/website/docs/usage/voice.md +++ b/cecli/website/docs/usage/voice.md @@ -6,82 +6,24 @@ description: Speak with cecli about your code! # Voice-to-code with cecli -Speak with cecli about your code! Request new features, test cases or bug fixes using your voice and let cecli do the work of editing the files in your local git repo. As with all of aider's capabilities, you can use voice-to-code with an existing repo or to start a new project. +Speak with cecli about your code! Request new features, test cases or bug fixes using your voice and let cecli do the work of editing the files in your local git repo. As with all of cecli's capabilities, you can use voice-to-code with an existing repo or to start a new project. -Voice support fits quite naturally into cecli's AI pair programming -chat interface. Now you can fluidly switch between voice and text chat -when you ask cecli to edit your code. +Voice support fits quite naturally into cecli's AI assistance. You can fluidly switch between voice and text chat when you ask cecli to edit your code. ## How to use voice-to-code -Use the in-chat `/voice` command to start recording, -and press `ENTER` when you're done speaking. -Your voice coding instructions will be transcribed, -as if you had typed them into -the cecli chat session. +Use the in-chat `/voice` command to start recording, and press `ENTER` when you're done speaking. Your voice coding instructions will be transcribed, as if you had typed them into the cecli chat session. -See the [installation instructions](https://cecli.dev/docs/install/optional.html#enable-voice-coding) for -information on how to enable the `/voice` command. - -
-
+See the [installation instructions](../install.html) for information on how to enable the `/voice` command. > cecli v0.11.2-dev > Added app.py to the chat. #### /voice -
-
-

Recording, press ENTER when done... 3.5sec

-
-
-
-
-
- - - - - -
- -“ add a factorial endpoint that uses math factorial ” -
+> Recording, press ENTER when done... 3.5sec + +> "add a factorial endpoint that uses math factorial" #### Add a factorial endpoint that uses math.factorial. @@ -114,8 +56,3 @@ if __name__ == '__main__': > Applied edit to app.py > Commit ef9e3e7 cecli: Add a factorial endpoint that uses math.factorial. - -
-
-
-
diff --git a/cecli/website/docs/usage/watch.md b/cecli/website/docs/usage/watch.md index 0693d85374c..e18c17ae428 100644 --- a/cecli/website/docs/usage/watch.md +++ b/cecli/website/docs/usage/watch.md @@ -1,41 +1,17 @@ --- -title: cecli in your IDE +title: Watch Mode #highlight_image: /assets/browser.jpg parent: Usage nav_order: 750 description: cecli can watch your files and respond to AI comments you add in your favorite IDE or text editor. --- -# cecli in your IDE - - - - ## AI comments -If you run cecli with `--watch-files`, it will watch all files in your repo -and look for any AI coding instructions you add using your favorite IDE or text editor. +If you run cecli with `--watch-files`, it will watch all files in your repo and look for any AI coding instructions you add using your favorite IDE or text editor. Specifically, cecli looks for one-liner comments (# ... or // ...) that either start or end with `AI`, `AI!` or `AI?` like these: @@ -50,17 +26,11 @@ Or in `//` comment languages... // Write a protein folding prediction engine. AI! ``` -cecli will take note of all the comments that start or end with `AI`. -Comments that include `AI!` with an exclamation point or `AI?` with a question -mark are special. -They trigger cecli to take action to collect *all* the AI comments and use them -as your instructions. +Cecli will take note of all the comments that start or end with `AI`. Comments that include `AI!` with an exclamation point or `AI?` with a question mark are special. They trigger cecli to take action to collect *all* the AI comments and use them as your instructions. - `AI!` triggers cecli to make changes to your code. - `AI?` triggers cecli to answer your question. -See the demo video above that shows cecli working with AI comments in VSCode. - ## Example @@ -84,7 +54,7 @@ function factorial(n) { ## Comment styles -cecli only watches for these types of **one-liner** comments: +Cecli only watches for these types of **one-liner** comments: ``` # Python and bash style @@ -92,9 +62,7 @@ cecli only watches for these types of **one-liner** comments: -- SQL style ``` -cecli will look for those comment types in all files. -You can use them into any code file you're editing, even if they aren't the -correct comment syntax for that language. +Cecli will look for those comment types in all files. You can use them into any code file you're editing, even if they aren't the correct comment syntax for that language. ## Multiple uses @@ -102,8 +70,7 @@ This capability is quite flexible and powerful, and can be used in many ways. ### In-context instructions -You can add an AI comment in the function you want changed, -explaining the change request in-context right where you want the changes. +You can add an AI comment in the function you want changed, explaining the change request in-context right where you want the changes. ```javascript app.get('/sqrt/:n', (req, res) => { @@ -118,11 +85,7 @@ app.get('/sqrt/:n', (req, res) => { ### Multiple comments -You can add multiple `AI` comments without the `!`, -before triggering cecli with a final `AI!`. -Also keep in mind that you can spread the AI comments across -multiple files, if you want to coordinate changes in multiple places. -Just use `AI!` last, to trigger cecli. +You can add multiple `AI` comments without the `!`, before triggering cecli with a final `AI!`. Also keep in mind that you can spread the AI comments across multiple files, if you want to coordinate changes in multiple places. Just use `AI!` last, to trigger cecli. ```python @app.route('/factorial/') @@ -143,9 +106,7 @@ def factorial(n): ### Long form instructions -You can add a block of comments, with longer instructions. -Just be sure to start or end one of the lines with `AI` or `AI!` to draw -cecli's attention to the block. +You can add a block of comments, with longer instructions. Just be sure to start or end one of the lines with `AI` or `AI!` to draw cecli's attention to the block. ```python # Make these changes: AI! @@ -160,50 +121,30 @@ if __name__ == "__main__": ### Add a file to the cecli chat -Rather than using `/add` to add a file inside the cecli chat, you can -simply put an `#AI` comment in it and save the file. -You can undo/remove the comment immediately if you like, the file -will still be added to the cecli chat. +Rather than using `/add` to add a file inside the cecli chat, you can simply put an `#AI` comment in it and save the file. You can undo/remove the comment immediately if you like, the file will still be added to the cecli chat. ## Also use cecli chat in the terminal -It can be really helpful to get a change started with AI comments. -But sometimes you want to build on or refine those changes. -You can of course continue to do that with AI comments, -but it can sometimes be effective to switch over to the cecli terminal chat. -The chat has the history of the AI comments you just made, -so you can continue on naturally from there. +It can be really helpful to get a change started with AI comments. But sometimes you want to build on or refine those changes. You can of course continue to do that with AI comments, but it can sometimes be effective to switch over to the cecli terminal chat. The chat has the history of the AI comments you just made, so you can continue on naturally from there. -You can also use the normal cecli chat in your terminal to work with -many of cecli's more advanced features: +You can also use the normal cecli chat in your terminal to work with many of cecli's more advanced features: - Use `/undo` to revert changes you don't like. Although you may also be able to use your IDE's undo function to step back in the file history. -- Use [chat modes](https://cecli.dev/docs/usage/modes.html) to ask questions or get help. +- Use [chat modes](modes.html) to ask questions or get help. - Manage the chat context with `/tokens`, `/clear`, `/drop`, `/reset`. -Adding an AI comment will add the file to the chat. -Periodically, you may want remove extra context that is no longer needed. -- [Fix lint and test errors](https://cecli.dev/docs/usage/lint-test.html). +Adding an AI comment will add the file to the chat. Periodically, you may want remove extra context that is no longer needed. +- [Fix lint and test errors](lint-test.html). - Run shell commands. - Etc. ## You can be lazy -The examples above all show AI -comments with full sentences, proper capitalization, punctuation, etc. -This was done to help explain how AI comments work, but is not needed in practice. +The examples above all show AI comments with full sentences, proper capitalization, punctuation, etc. This was done to help explain how AI comments work, but is not needed in practice. -Most LLMs are perfectly capable of dealing with ambiguity and -inferring implied intent. -This often allows you to be quite lazy with your AI comments. -In particular, you can start and end comments with lowercase `ai` and `ai!`, -but you can also be much more terse with the request itself. -Below are simpler versions of some of the examples given above. +Most LLMs are perfectly capable of dealing with ambiguity and inferring implied intent. This often allows you to be quite lazy with your AI comments. In particular, you can start and end comments with lowercase `ai` and `ai!`, but you can also be much more terse with the request itself. Below are simpler versions of some of the examples given above. -When the context clearly implies the needed action, `ai!` might be all you -need. For example, to implement a factorial function -in a program full of other math functions either of these -approaches would probably work: +When the context clearly implies the needed action, `ai!` might be all you need. For example, to implement a factorial function in a program full of other math functions either of these approaches would probably work: ```js function factorial(n) // ai! @@ -215,9 +156,7 @@ Or... // add factorial() ai! ``` -Rather than a long, explicit comment like "Add error handling for NaN and less than zero," -you can let cecli infer more about the request. -This simpler comment may be sufficient: +Rather than a long, explicit comment like "Add error handling for NaN and less than zero," you can let cecli infer more about the request. This simpler comment may be sufficient: ```javascript app.get('/sqrt/:n', (req, res) => { @@ -249,17 +188,13 @@ def factorial(n): return jsonify(result=result) ``` -As you use cecli with your chosen LLM, you can develop a sense for how -explicit you need to make your AI comments. +As you use cecli with your chosen LLM, you can develop a sense for how explicit you need to make your AI comments. ## Behind the scenes -cecli sends your AI comments to the LLM with the -[repo map](https://cecli.dev/docs/repomap.html) -and all the other code context you've added to the chat. +Cecli sends your AI comments to the LLM with the [repo map](../repomap.html) and all the other code context you've added to the chat. -It also pulls out and highlights the AI comments with specific context, showing the LLM -exactly how they fit into the code base. +It also pulls out and highlights the AI comments with specific context, showing the LLM exactly how they fit into the code base. ``` The "AI" comments below marked with █ can be found in the code files I've shared with you. @@ -289,6 +224,4 @@ todo_app.py: #### Credits -*This feature was inspired by -the way [Override](https://github.com/oi-overide) watches for file changes -to find prompts embedded within `//> a specific set of delimiters a specific set of delimiters An ode to the CLI @@ -59,7 +59,7 @@

An ode to the CLI

Features

- +

@@ -68,7 +68,7 @@

cecli works best with Claude 4.5 Sonnet, DeepSeek V4, OpenAI GPT-5.2 & Gemini 3, but can connect to almost any LLM, including local models.

- +

Maps your codebase

@@ -78,7 +78,7 @@

Maps your codebase

which helps it work well in larger projects.

- +

100+ code languages

@@ -89,7 +89,7 @@

100+ code languages

php, html, css, and dozens more.

- +

Git integration

@@ -101,7 +101,7 @@

Git integration

diff, manage and undo AI changes.

- +

In your IDE

@@ -112,7 +112,7 @@

In your IDE

your code and cecli will get to work.

- +

Images & web pages

@@ -123,7 +123,7 @@

Images & web pages

etc.

- +

Voice-to-code

@@ -134,7 +134,7 @@

Voice-to-code

implement the changes.

- +
@@ -235,7 +233,7 @@

Community & Resources