diff --git a/OpenCode.md b/OpenCode.md index f55de8ccd00bc58596ad01e1c4b3549e9e82bf93..f869136a5a630f548f904dd137885c26dc1097de 100644 --- a/OpenCode.md +++ b/OpenCode.md @@ -1,4 +1,4 @@ -# OpenCode Development Guide +# Crush Development Guide ## Build/Test/Lint Commands diff --git a/README.md b/README.md index 4b68dfbdb4f915dbde5c348720fa37072a3dcafd..c967640fad906c8257784724d4628ea26792beaa 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ⌬ OpenCode +# ⌬ Crush

@@ -8,10 +8,10 @@ A powerful terminal-based AI assistant for developers, providing intelligent cod ## Overview -OpenCode is a Go-based CLI application that brings AI assistance to your terminal. It provides a TUI (Terminal User Interface) for interacting with various AI models to help with coding tasks, debugging, and more. +Crush is a Go-based CLI application that brings AI assistance to your terminal. It provides a TUI (Terminal User Interface) for interacting with various AI models to help with coding tasks, debugging, and more.

For a quick video overview, check out - OpenCode + Gemini 2.5 Pro: BYE Claude Code! I'm SWITCHING To the FASTEST AI Coder!

+ Crush + Gemini 2.5 Pro: BYE Claude Code! I'm SWITCHING To the FASTEST AI Coder!

@@ -64,7 +64,7 @@ go install github.com/charmbracelet/crush@latest ## Configuration -OpenCode looks for configuration in the following locations: +Crush looks for configuration in the following locations: - `$HOME/.crush.json` - `$XDG_CONFIG_HOME/crush/.crush.json` @@ -72,7 +72,7 @@ OpenCode looks for configuration in the following locations: ### Auto Compact Feature -OpenCode includes an auto compact feature that automatically summarizes your conversation when it approaches the model's context window limit. When enabled (default setting), this feature: +Crush includes an auto compact feature that automatically summarizes your conversation when it approaches the model's context window limit. When enabled (default setting), this feature: - Monitors token usage during your conversation - Automatically triggers summarization when usage reaches 95% of the model's context window @@ -89,7 +89,7 @@ You can enable or disable this feature in your configuration file: ### Environment Variables -You can configure OpenCode using environment variables: +You can configure Crush using environment variables: | Environment Variable | Purpose | | -------------------------- | ------------------------------------------------------ | @@ -110,7 +110,7 @@ You can configure OpenCode using environment variables: ### Shell Configuration -OpenCode allows you to configure the shell used by the bash tool. By default, it uses the shell specified in the `SHELL` environment variable, or falls back to `/bin/bash` if not set. +Crush allows you to configure the shell used by the bash tool. By default, it uses the shell specified in the `SHELL` environment variable, or falls back to `/bin/bash` if not set. You can override this in your configuration file: @@ -190,7 +190,7 @@ This is useful if you want to use a different shell than your default system she ## Supported AI Models -OpenCode supports a variety of AI models from different providers: +Crush supports a variety of AI models from different providers: ### OpenAI @@ -247,7 +247,7 @@ OpenCode supports a variety of AI models from different providers: ## Usage ```bash -# Start OpenCode +# Start Crush crush # Start with debug logging @@ -259,7 +259,7 @@ crush -c /path/to/project ## Non-interactive Prompt Mode -You can run OpenCode in non-interactive mode by passing a prompt directly as a command-line argument. This is useful for scripting, automation, or when you want a quick answer without launching the full TUI. +You can run Crush in non-interactive mode by passing a prompt directly as a command-line argument. This is useful for scripting, automation, or when you want a quick answer without launching the full TUI. ```bash # Run a single prompt and print the AI's response to the terminal @@ -272,13 +272,13 @@ crush -p "Explain the use of context in Go" -f json crush -p "Explain the use of context in Go" -q ``` -In this mode, OpenCode will process your prompt, print the result to standard output, and then exit. All permissions are auto-approved for the session. +In this mode, Crush will process your prompt, print the result to standard output, and then exit. All permissions are auto-approved for the session. -By default, a spinner animation is displayed while the model is processing your query. You can disable this spinner with the `-q` or `--quiet` flag, which is particularly useful when running OpenCode from scripts or automated workflows. +By default, a spinner animation is displayed while the model is processing your query. You can disable this spinner with the `-q` or `--quiet` flag, which is particularly useful when running Crush from scripts or automated workflows. ### Output Formats -OpenCode supports the following output formats in non-interactive mode: +Crush supports the following output formats in non-interactive mode: | Format | Description | | ------ | ------------------------------- | @@ -369,7 +369,7 @@ The output format is implemented as a strongly-typed `OutputFormat` in the codeb ## AI Assistant Tools -OpenCode's AI assistant has access to various tools to help with coding tasks: +Crush's AI assistant has access to various tools to help with coding tasks: ### File and Code Tools @@ -395,7 +395,7 @@ OpenCode's AI assistant has access to various tools to help with coding tasks: ## Architecture -OpenCode is built with a modular architecture: +Crush is built with a modular architecture: - **cmd**: Command-line interface using Cobra - **internal/app**: Core application services @@ -410,7 +410,7 @@ OpenCode is built with a modular architecture: ## Custom Commands -OpenCode supports custom commands that can be created by users to quickly send predefined prompts to the AI assistant. +Crush supports custom commands that can be created by users to quickly send predefined prompts to the AI assistant. ### Creating Custom Commands @@ -449,7 +449,7 @@ This creates a command called `user:prime-context`. ### Command Arguments -OpenCode supports named arguments in custom commands using placeholders in the format `$NAME` (where NAME consists of uppercase letters, numbers, and underscores, and must start with a letter). +Crush supports named arguments in custom commands using placeholders in the format `$NAME` (where NAME consists of uppercase letters, numbers, and underscores, and must start with a letter). For example: @@ -461,7 +461,7 @@ RUN git grep --author="$AUTHOR_NAME" -n . RUN grep -R "$SEARCH_PATTERN" $DIRECTORY ``` -When you run a command with arguments, OpenCode will prompt you to enter values for each unique placeholder. Named arguments provide several benefits: +When you run a command with arguments, Crush will prompt you to enter values for each unique placeholder. Named arguments provide several benefits: - Clear identification of what each argument represents - Ability to use the same argument multiple times @@ -487,16 +487,16 @@ The content of the command file will be sent as a message to the AI assistant. ### Built-in Commands -OpenCode includes several built-in commands: +Crush includes several built-in commands: | Command | Description | | ------------------ | --------------------------------------------------------------------------------------------------- | -| Initialize Project | Creates or updates the OpenCode.md memory file with project-specific information | +| Initialize Project | Creates or updates the Crush.md memory file with project-specific information | | Compact Session | Manually triggers the summarization of the current session, creating a new session with the summary | ## MCP (Model Context Protocol) -OpenCode implements the Model Context Protocol (MCP) to extend its capabilities through external tools. MCP provides a standardized way for the AI assistant to interact with external services and tools. +Crush implements the Model Context Protocol (MCP) to extend its capabilities through external tools. MCP provides a standardized way for the AI assistant to interact with external services and tools. ### MCP Features @@ -537,7 +537,7 @@ Once configured, MCP tools are automatically available to the AI assistant along ## LSP (Language Server Protocol) -OpenCode integrates with Language Server Protocol to provide code intelligence features across multiple programming languages. +Crush integrates with Language Server Protocol to provide code intelligence features across multiple programming languages. ### LSP Features @@ -576,13 +576,13 @@ While the LSP client implementation supports the full LSP protocol (including co ## Using a self-hosted model provider -OpenCode can also load and use models from a self-hosted (OpenAI-like) provider. +Crush can also load and use models from a self-hosted (OpenAI-like) provider. This is useful for developers who want to experiment with custom models. ### Configuring a self-hosted provider You can use a self-hosted model by setting the `LOCAL_ENDPOINT` environment variable. -This will cause OpenCode to load and use the models from the specified endpoint. +This will cause Crush to load and use the models from the specified endpoint. ```bash LOCAL_ENDPOINT=http://localhost:1235/v1 @@ -625,7 +625,7 @@ go build -o crush ## Acknowledgments -OpenCode gratefully acknowledges the contributions and support from these key individuals: +Crush gratefully acknowledges the contributions and support from these key individuals: - [@isaacphi](https://github.com/isaacphi) - For the [mcp-language-server](https://github.com/isaacphi/mcp-language-server) project which provided the foundation for our LSP client implementation - [@adamdottv](https://github.com/adamdottv) - For the design direction and UI/UX architecture @@ -634,7 +634,7 @@ Special thanks to the broader open source community whose tools and libraries ha ## License -OpenCode is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. +Crush is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. ## Contributing diff --git a/cmd/root.go b/cmd/root.go index db9cc116f2db557e4affefc1453612fd5f2a9531..0fb28c958b474dac3093deb94687bea3c9dce1b6 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -23,7 +23,7 @@ import ( var rootCmd = &cobra.Command{ Use: "crush", Short: "Terminal-based AI assistant for software development", - Long: `OpenCode is a powerful terminal-based AI assistant that helps with software development tasks. + Long: `Crush is a powerful terminal-based AI assistant that helps with software development tasks. It provides an interactive chat interface with AI capabilities, code analysis, and LSP integration to assist developers in writing, debugging, and understanding code directly from the terminal.`, Example: ` diff --git a/cmd/schema/README.md b/cmd/schema/README.md index 4876ccb4d4e8513b66a03534b015b9de77eb800d..517fdb4d20fb9f2b819051bd72e6c33f5dea2195 100644 --- a/cmd/schema/README.md +++ b/cmd/schema/README.md @@ -1,6 +1,6 @@ -# OpenCode Configuration Schema Generator +# Crush Configuration Schema Generator -This tool generates a JSON Schema for the OpenCode configuration file. The schema can be used to validate configuration files and provide autocompletion in editors that support JSON Schema. +This tool generates a JSON Schema for the Crush configuration file. The schema can be used to validate configuration files and provide autocompletion in editors that support JSON Schema. ## Usage diff --git a/cmd/schema/main.go b/cmd/schema/main.go index 4d2b9b8bffc93c3d653336baf5165320a90650bd..0be2c041451294593e6e8b6fd66f69536e159674 100644 --- a/cmd/schema/main.go +++ b/cmd/schema/main.go @@ -38,8 +38,8 @@ func main() { func generateSchema() map[string]any { schema := map[string]any{ "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OpenCode Configuration", - "description": "Configuration schema for the OpenCode application", + "title": "Crush Configuration", + "description": "Configuration schema for the Crush application", "type": "object", "properties": map[string]any{}, } @@ -91,8 +91,8 @@ func generateSchema() map[string]any { "CLAUDE.local.md", "crush.md", "crush.local.md", - "OpenCode.md", - "OpenCode.local.md", + "Crush.md", + "Crush.local.md", "OPENCODE.md", "OPENCODE.local.md", }, diff --git a/internal/config/config.go b/internal/config/config.go index 07e1c95fab98f84496d572f54a82406947b0589a..5d0d70d470d15c8fceaa3ac6b4e6075dcd164df3 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -112,8 +112,8 @@ var defaultContextPaths = []string{ "CLAUDE.local.md", "crush.md", "crush.local.md", - "OpenCode.md", - "OpenCode.local.md", + "Crush.md", + "Crush.local.md", "OPENCODE.md", "OPENCODE.local.md", } diff --git a/internal/fileutil/ls.go b/internal/fileutil/ls.go index 9a271da25f49b48c965115ae7979c690e88bf8c1..1c898a642a82b0b0500d354721a06f18876c4da0 100644 --- a/internal/fileutil/ls.go +++ b/internal/fileutil/ls.go @@ -63,7 +63,7 @@ var CommonIgnorePatterns = []string{ ".Spotlight-V100", ".fseventsd", - // OpenCode + // Crush ".crush", } diff --git a/internal/llm/agent/mcp-tools.go b/internal/llm/agent/mcp-tools.go index 32ce8287a257438f01fbb6f52770677cb18b3b30..55b6983d053a70ccebf56f7c6d239246acf8c317 100644 --- a/internal/llm/agent/mcp-tools.go +++ b/internal/llm/agent/mcp-tools.go @@ -46,7 +46,7 @@ func runTool(ctx context.Context, c MCPClient, toolName string, input string) (t initRequest := mcp.InitializeRequest{} initRequest.Params.ProtocolVersion = mcp.LATEST_PROTOCOL_VERSION initRequest.Params.ClientInfo = mcp.Implementation{ - Name: "OpenCode", + Name: "Crush", Version: version.Version, } @@ -140,7 +140,7 @@ func getTools(ctx context.Context, name string, m config.MCPServer, permissions initRequest := mcp.InitializeRequest{} initRequest.Params.ProtocolVersion = mcp.LATEST_PROTOCOL_VERSION initRequest.Params.ClientInfo = mcp.Implementation{ - Name: "OpenCode", + Name: "Crush", Version: version.Version, } diff --git a/internal/llm/prompt/coder.go b/internal/llm/prompt/coder.go index dcf3c7370f062375ee8299de71930b5f1a80b3eb..82939a6a238bd9c8670ffdbbd8ff55af3c87305f 100644 --- a/internal/llm/prompt/coder.go +++ b/internal/llm/prompt/coder.go @@ -25,7 +25,7 @@ func CoderPrompt(provider models.ModelProvider) string { } const baseOpenAICoderPrompt = ` -You are operating as and within the OpenCode CLI, a terminal-based agentic coding assistant built by OpenAI. It wraps OpenAI models to enable natural language interaction with a local codebase. You are expected to be precise, safe, and helpful. +You are operating as and within the Crush CLI, a terminal-based agentic coding assistant built by OpenAI. It wraps OpenAI models to enable natural language interaction with a local codebase. You are expected to be precise, safe, and helpful. You can: - Receive user prompts, project context, and files. @@ -71,17 +71,17 @@ You MUST adhere to the following criteria when executing the task: - Remember the user does not see the full output of tools ` -const baseAnthropicCoderPrompt = `You are OpenCode, an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user. +const baseAnthropicCoderPrompt = `You are Crush, an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user. IMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure. # Memory -If the current working directory contains a file called OpenCode.md, it will be automatically added to your context. This file serves multiple purposes: +If the current working directory contains a file called Crush.md, it will be automatically added to your context. This file serves multiple purposes: 1. Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time 2. Recording the user's code style preferences (naming conventions, preferred libraries, etc.) 3. Maintaining useful information about the codebase structure and organization -When you spend time searching for commands to typecheck, lint, build, or test, you should ask the user if it's okay to add those commands to OpenCode.md. Similarly, when learning about code style preferences or important codebase information, ask if it's okay to add that to OpenCode.md so you can remember it for next time. +When you spend time searching for commands to typecheck, lint, build, or test, you should ask the user if it's okay to add those commands to Crush.md. Similarly, when learning about code style preferences or important codebase information, ask if it's okay to add that to Crush.md so you can remember it for next time. # Tone and style You should be concise, direct, and to the point. When you run a non-trivial bash command, you should explain what the command does and why you are running it, to make sure the user understands what you are doing (this is especially important when you are running a command that will make changes to the user's system). diff --git a/internal/llm/prompt/task.go b/internal/llm/prompt/task.go index 1ec3c9bc82b6568158483cc2913a9b9e8c5fdc56..53fd67dc2f88928b4fbe9773db0cd1487bcd811a 100644 --- a/internal/llm/prompt/task.go +++ b/internal/llm/prompt/task.go @@ -7,7 +7,7 @@ import ( ) func TaskPrompt(_ models.ModelProvider) string { - agentPrompt := `You are an agent for OpenCode. Given the user's prompt, you should use the tools available to you to answer the user's question. + agentPrompt := `You are an agent for Crush. Given the user's prompt, you should use the tools available to you to answer the user's question. Notes: 1. IMPORTANT: You should be concise, direct, and to the point, since your responses will be displayed on a command line interface. Answer the user's question directly, without elaboration, explanation, or details. One word answers are best. Avoid introductions, conclusions, and explanations. You MUST avoid text before/after your response, such as "The answer is .", "Here is the content of the file..." or "Based on the information provided, the answer is..." or "Here is what I will do next...". 2. When relevant, share file names and code snippets relevant to the query diff --git a/internal/llm/provider/provider.go b/internal/llm/provider/provider.go index dae3bc10e6dea0ddd6b6757f34c0bd247b10e33e..66e806d6f756661362628750f51f5edb8649dbaa 100644 --- a/internal/llm/provider/provider.go +++ b/internal/llm/provider/provider.go @@ -131,7 +131,7 @@ func NewProvider(providerName models.ModelProvider, opts ...ProviderClientOption WithOpenAIBaseURL("https://openrouter.ai/api/v1"), WithOpenAIExtraHeaders(map[string]string{ "HTTP-Referer": "crush.ai", - "X-Title": "OpenCode", + "X-Title": "Crush", }), ) return &baseProvider[OpenAIClient]{ diff --git a/internal/tui/components/dialog/init.go b/internal/tui/components/dialog/init.go index 0abf3af80fadae6d4fad1b9154a969810286cc2a..787c1e71115f1b43adc2724e93aa356029fbffad 100644 --- a/internal/tui/components/dialog/init.go +++ b/internal/tui/components/dialog/init.go @@ -108,7 +108,7 @@ func (m InitDialogCmp) View() string { explanation := t.S().Text. Width(maxWidth). Padding(0, 1). - Render("Initialization generates a new OpenCode.md file that contains information about your codebase, this file serves as memory for each project, you can freely add to it to help the agents be better at their job.") + Render("Initialization generates a new Crush.md file that contains information about your codebase, this file serves as memory for each project, you can freely add to it to help the agents be better at their job.") question := t.S().Text. Width(maxWidth). diff --git a/internal/tui/components/dialogs/commands/commands.go b/internal/tui/components/dialogs/commands/commands.go index 59b92d1ad52500cedacc9c421288207177b91cd7..823ad2ab72d84ac89e8b10ee686ae20dd8ad17d3 100644 --- a/internal/tui/components/dialogs/commands/commands.go +++ b/internal/tui/components/dialogs/commands/commands.go @@ -226,9 +226,9 @@ func (c *commandDialogCmp) defaultCommands() []Command { { ID: "init", Title: "Initialize Project", - Description: "Create/Update the OpenCode.md memory file", + Description: "Create/Update the Crush.md memory file", Handler: func(cmd Command) tea.Cmd { - prompt := `Please analyze this codebase and create a OpenCode.md file containing: + prompt := `Please analyze this codebase and create a Crush.md file containing: 1. Build/lint/test commands - especially for running a single test 2. Code style guidelines including imports, formatting, types, naming conventions, error handling, etc. diff --git a/opencode-schema.json b/opencode-schema.json index 0e60c0330b5da10cee836385067fb0bfcafe9bcc..3a035482e22817f747859e71527c6d4c585c2552 100644 --- a/opencode-schema.json +++ b/opencode-schema.json @@ -97,7 +97,7 @@ "type": "object" } }, - "description": "Configuration schema for the OpenCode application", + "description": "Configuration schema for the Crush application", "properties": { "agents": { "additionalProperties": { @@ -218,8 +218,8 @@ "CLAUDE.local.md", "crush.md", "crush.local.md", - "OpenCode.md", - "OpenCode.local.md", + "Crush.md", + "Crush.local.md", "OPENCODE.md", "OPENCODE.local.md" ], @@ -397,6 +397,6 @@ "type": "string" } }, - "title": "OpenCode Configuration", + "title": "Crush Configuration", "type": "object" }