diff --git a/README.md b/README.md index b4e1a814071f5189a74f800e9d21cefcc03f4e2a..ca46f048e46fc75d34ce9d0e9a76e335113aa3d9 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,12 @@ Crush is a tool for building software with AI. ## Installation -* [Packages](https://github.com/charmbracelet/crush/releases/tag/nightly) are available in Debian and RPM formats -* [Binaries](https://github.com/charmbracelet/crush/releases/tag/nightly) are available for Linux and macOS +Nightly builds are available while Crush is in development. -Or just install it with go: +- [Packages](https://github.com/charmbracelet/crush/releases/tag/nightly) are available in Debian and RPM formats +- [Binaries](https://github.com/charmbracelet/crush/releases/tag/nightly) are available for Linux and macOS + +You can also just install it with go: ``` git clone git@github.com:charmbracelet/crush.git @@ -23,6 +25,8 @@ cd crush go install ``` +Note that Crush doesn't support Windows yet, however Windows support is planned and in progress. + ## Getting Started For now, the quickest way to get started is to set an environment variable for @@ -45,13 +49,132 @@ providers. | `AZURE_OPENAI_API_KEY` | Azure OpenAI models (optional when using Entra ID) | | `AZURE_OPENAI_API_VERSION` | Azure OpenAI models | +## Configuration + +For many use cases, Crush can be run with no config. That said, if you do need config, it can be added either local to the project itself, or globally. Configuration has the following priority: + +1. `.crush.json` +2. `crush.json` +3. `$HOME/.config/crush/crush.json` + +### LSPs + +Crush can use LSPs for additional context to help inform its decisions, just like you would. LSPs can be added manually like so: + +```json +{ + "lsp": { + "go": { + "disabled": false, + "command": "gopls" + }, + "typescript": { + "disabled": false, + "command": "typescript-language-server", + "args": ["--stdio"] + }, + "nix": { + "command": "alejandra" + } + } +} +``` + +### Amazon Bedrock + +To use AWS Bedrock with Claude models, configure your AWS credentials and region: + +```json +{ + "providers": [ + { + "id": "bedrock", + "provider_type": "bedrock", + "extra_params": { + "region": "us-east-1" + } + } + ] +} +``` + +Bedrock uses your AWS credentials from environment variables (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`) or AWS credential profiles. The region can be specified in the configuration or via the `AWS_REGION` environment variable. + +### Google Vertex AI + +For Google Cloud Vertex AI with Gemini models, configure your project and location: + +```json +{ + "providers": [ + { + "id": "vertexai", + "provider_type": "vertexai", + "extra_headers": { + "project": "your-gcp-project-id", + "location": "us-central1" + } + } + ] +} +``` + +Vertex AI uses Google Cloud authentication. Ensure you have the `GOOGLE_APPLICATION_CREDENTIALS` environment variable set or are authenticated via `gcloud auth application-default login`. + +### OpenAI-Compatible APIs + +Crush supports all OpenAI-compatible APIs, including local models via Ollama: + +```json +{ + "providers": [ + { + "id": "ollama", + "provider_type": "openai", + "base_url": "http://localhost:11434/v1", + "models": [ + { + "id": "llama3.2:3b", + "name": "Llama 3.2 3B", + "context_window": 8192, + "default_max_tokens": 4096 + } + ] + } + ] +} +``` + +For other OpenAI-compatible providers, adjust the `base_url` and provide an `api_key` if required: + +```json +{ + "providers": [ + { + "id": "custom-openai", + "provider_type": "openai", + "base_url": "https://api.example.com/v1", + "api_key": "your-api-key" + } + ] +} +``` + +## Whatcha think? + +We’d love to hear your thoughts on this project. Feel free to drop us a note! + +- [Twitter](https://twitter.com/charmcli) +- [The Fediverse](https://mastodon.social/@charmcli) +- [Discord](https://charm.sh/chat) + ## License [MIT](https://github.com/charmbracelet/crush/raw/main/LICENSE) --- -Part of [Charm](https://charm.sh). +Part of [Charm](https://charm.land). The Charm logo