### Install and Run Tidewave CLI in Terminal Source: https://hexdocs.pm/tidewave/containers.md Downloads the latest Tidewave CLI binary for the current architecture, sets execution permissions, and starts the server on a specified port. ```bash curl -sL -o tidewave https://github.com/tidewave-ai/tidewave_app/releases/latest/download/tidewave-cli-$(uname -m)-unknown-linux-musl chmod +x tidewave ./tidewave --port 9000 ``` -------------------------------- ### Configure VS Code Devcontainer for Tidewave Source: https://hexdocs.pm/tidewave/containers.md Updates devcontainer.json to automatically install the Tidewave CLI upon container creation and start the service on container startup, while forwarding the necessary port. ```json { "postCreateCommand": "curl -sL -o /usr/local/bin/tidewave https://github.com/tidewave-ai/tidewave_app/releases/latest/download/tidewave-cli-aarch64-unknown-linux-musl && chmod +x /usr/local/bin/tidewave", "postStartCommand": "nohup tidewave --port 9000 > /tmp/tidewave.log 2>&1 &", "forwardPorts": [9000] } ``` -------------------------------- ### Dockerfile for Tidewave Development Environment Source: https://hexdocs.pm/tidewave/containers.md This Dockerfile installs necessary dependencies like socat and the Tidewave CLI. It also creates a run.sh script to handle network port forwarding for local development services. ```dockerfile FROM hexpm/elixir:1.18.4-erlang-27.3.4-ubuntu-noble-20250529 RUN mix local.hex --force RUN mix local.rebar --force RUN apt update && apt -y install curl git bash inotify-tools socat RUN curl -sL -o tidewave https://github.com/tidewave-ai/tidewave_app/releases/latest/download/tidewave-cli-$(uname -m)-unknown-linux-musl && \ chmod +x tidewave && \ mv tidewave /usr/local/bin/tidewave RUN <> /run.sh #!/bin/sh socat TCP-LISTEN:4001,fork TCP:localhost:4000 > /dev/null 2>&1 & socat TCP-LISTEN:5432,fork,bind=127.0.0.1 TCP:db:5432 > /dev/null 2>&1 & socat TCP-LISTEN:9001,fork TCP:localhost:9000 > /dev/null 2>&1 & tidewave -p 9000 > /dev/null 2>&1 & bash EOF RUN chmod +x run.sh ``` -------------------------------- ### Create Ruby on Rails Development Dockerfile Source: https://hexdocs.pm/tidewave/containers.md Defines a Docker image for Rails development that installs necessary system dependencies, the Tidewave CLI, and a startup script to proxy ports and launch services. ```dockerfile FROM ruby:3.2 RUN apt update && apt -y install curl git bash inotify-tools socat RUN curl -sL -o tidewave https://github.com/tidewave-ai/tidewave_app/releases/latest/download/tidewave-cli-$(uname -m)-unknown-linux-musl && \ chmod +x tidewave && \ mv tidewave /usr/local/bin/tidewave RUN <> /run.sh #!/bin/sh socat TCP-LISTEN:3001,fork TCP:localhost:3000 > /dev/null 2>&1 & socat TCP-LISTEN:5432,fork,bind=127.0.0.1 TCP:db:5432 > /dev/null 2>&1 & socat TCP-LISTEN:9001,fork TCP:localhost:9000 > /dev/null 2>&1 & tidewave -p 9000 > /dev/null 2>&1 & bash EOF RUN chmod +x run.sh ``` -------------------------------- ### Enable HTTPS via Tidewave CLI Source: https://hexdocs.pm/tidewave/https.md Command-line arguments to specify the HTTPS port and certificate paths when launching the Tidewave CLI. ```shell tidewave --https-port 9833 --https-cert-path ./cert.pem --https-key-path ./key.pem ``` -------------------------------- ### Define Development Database Service with Docker Compose Source: https://hexdocs.pm/tidewave/containers.md Sets up a Postgres database service within a dedicated Docker network for local development environments. ```yaml services: db: image: postgres:16 environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: my_app_dev volumes: - ./db:/var/lib/postgresql/data networks: - my_app networks: my_app: name: my_app ``` -------------------------------- ### Configure Tidewave App Environment Variables (TOML) Source: https://hexdocs.pm/tidewave/claude_code.md This TOML snippet demonstrates how to configure environment variables for the Tidewave app, which are then passed to Claude Code. This allows for customization of Claude Code's behavior, such as enabling Vertex AI integration or specifying the executable path. Remember to restart the Tidewave app after modifying this file. ```toml # This file is used to configure the Tidewave app. # If you change this file, you must restart Tidewave. [env] CLAUDE_CODE_USE_VERTEX = "1" CLAUDE_CODE_EXECUTABLE = "..." ``` -------------------------------- ### Configure Vite Proxy for Tidewave Source: https://hexdocs.pm/tidewave/frontend.md Sets up a proxy in Vite's configuration to redirect the /tidewave path to the backend server. This is necessary when the frontend and backend are served on different ports during development. It ensures that requests to /tidewave are correctly forwarded to the backend. ```javascript export default defineConfig({ // Works react() and vue() plugins: [tailwindcss(), react()], server: { port: 3001, // your frontend port proxy: { "/tidewave": `http://localhost:3000` // your backend port }, }, }); ``` -------------------------------- ### Configure FastAPI for SameSite=None Secure Cookies Source: https://hexdocs.pm/tidewave/subdomains.md This snippet demonstrates how to set cookies with `SameSite=None` and `Secure=True` in FastAPI for development. It shows both direct cookie setting and configuration via the SessionMiddleware. ```python response.set_cookie( key="your_session", value="your_value", samesite="none", secure=True, httponly=True, ) ``` ```python from starlette.middleware.sessions import SessionMiddleware app.add_middleware( SessionMiddleware, secret_key="your-secret-key", session_cookie="your_app_session", same_site="none", https_only=True, ) ``` -------------------------------- ### Configure HTTPS in Tidewave App Source: https://hexdocs.pm/tidewave/https.md Settings to enable HTTPS in the Tidewave desktop application configuration file. Requires providing paths to valid SSL certificate and key files. ```toml https_port = 9833 https_cert_path = "/path/to/cert.pem" https_key_path = "/path/to/key.pem" ``` -------------------------------- ### Configure Parcel Proxy for Tidewave Source: https://hexdocs.pm/tidewave/frontend.md Sets up a proxy configuration file for Parcel to redirect the /tidewave path to the backend server. This is required when the frontend and backend are hosted on different ports during development, facilitating communication. ```json { "/tidewave": { "target": "http://localhost:3000" } } ``` -------------------------------- ### Configure Remote Access via Tidewave CLI Source: https://hexdocs.pm/tidewave/remote_access.md This command enables remote access for the Tidewave CLI and specifies the allowed origin. It is essential to include the --allow-remote-access flag and define the --allowed-origins parameter to permit connections from specific remote addresses. ```bash tidewave --allow-remote-access --allowed-origins https://example.com:9898 ``` -------------------------------- ### Configure Custom Provider for Codex Source: https://hexdocs.pm/tidewave/codex.md Configure an OpenAI-compatible provider such as OpenRouter in the Codex configuration file. This requires defining the model, provider name, base URL, and authentication headers. ```toml model = "anthropic/claude-sonnet-4.5" model_provider = "openrouter" [model_providers.openrouter] name = "Openrouter" base_url = "https://openrouter.ai/api/v1" http_headers = { "Authorization" = "Bearer sk-or-v1-..." } wire_api = "chat" ``` -------------------------------- ### Configure Flask for SameSite=None Secure Cookies Source: https://hexdocs.pm/tidewave/subdomains.md This snippet shows how to configure Flask's session and remember cookies to use `SameSite=None` and `Secure=True` when the app is in debug mode. This enables cross-domain cookie functionality. ```python app = Flask(__name__) if app.debug: # Session configuration app.config['SESSION_COOKIE_SAMESITE'] = 'None' app.config['SESSION_COOKIE_SECURE'] = True # If using Flask-Login or other extensions, also set: app.config['REMEMBER_COOKIE_SAMESITE'] = 'None' app.config['REMEMBER_COOKIE_SECURE'] = True ``` -------------------------------- ### Authenticate OpenAI Codex CLI Source: https://hexdocs.pm/tidewave/codex.md Run the authentication process for the Codex CLI. This command initiates the interactive login flow required to link your OpenAI subscription. ```shell codex ``` -------------------------------- ### Configure Webpack Proxy for Tidewave Source: https://hexdocs.pm/tidewave/frontend.md Configures a proxy in Webpack's dev server settings to forward requests for the /tidewave path to the backend. This is essential when the frontend and backend run on separate ports during development, ensuring seamless communication. ```javascript module.exports = { devServer: { port: 3001, // your frontend port proxy: [ { context: ['/tidewave'], target: 'http://localhost:3000' // your backend port } ] } }; ``` -------------------------------- ### Configure Next.js for SameSite=None Secure Cookies Source: https://hexdocs.pm/tidewave/subdomains.md This snippet demonstrates how to set cookies in Next.js with `SameSite=None` and `Secure=True` specifically for development environments. This is crucial for cross-domain cookie handling. ```typescript response.cookies.set({ name: 'your-cookie-name', value: 'your-value', sameSite: (process.env.NODE_ENV === 'development' ? 'none' : 'lax'), secure: true, }) ``` -------------------------------- ### Dev Container Orchestration Script Source: https://hexdocs.pm/tidewave/containers.md A shell script to build and run the Tidewave development container with appropriate volume mounts and network port mappings. ```bash #!/bin/sh docker compose -f docker-compose.dev.yml up -d docker build -f Dockerfile.dev -t tidewave-devcontainer . docker run --rm -w $(pwd) \ -v $(pwd):$(pwd) \ --network my_app \ -p 127.0.0.1:3000:3001 \ -p 127.0.0.1:9000:9001 \ -it tidewave-devcontainer /run.sh ``` -------------------------------- ### Configure OpenRouter API Key in Tidewave Settings Source: https://hexdocs.pm/tidewave/openrouter.md This TOML configuration snippet shows how to set the OPENROUTER_API_KEY within the Tidewave settings file. Users must restart the application after modifying this file for changes to take effect. ```toml # This file is used to configure the Tidewave app. # If you change this file, you must restart Tidewave. [env] OPENROUTER_API_KEY = "sk-or-v1-..." ``` -------------------------------- ### Invoke MCP Proxy for Debugging Source: https://hexdocs.pm/tidewave/mcp.md Test the MCP proxy directly from the terminal by piping a JSON-RPC ping request. This confirms if the proxy is correctly forwarding requests to the Tidewave endpoint. ```bash echo '{"jsonrpc":"2.0","id":1,"method":"ping"}' | /path/to/mcp-proxy http://localhost:$PORT/tidewave/mcp ``` -------------------------------- ### Configure OpenCode for Tidewave MCP Source: https://hexdocs.pm/tidewave/mcp_opencode.md This JSON configuration snippet enables Tidewave MCP within OpenCode. It specifies the type, URL, and enabled status for the Tidewave MCP integration. Ensure to replace '$PORT' with your actual web application's port number. ```json { "mcp": { "tidewave": { "type": "remote", "url": "http://localhost:$PORT/tidewave/mcp", "enabled": true } } } ``` -------------------------------- ### Configure Phoenix for SameSite=None Secure Cookies Source: https://hexdocs.pm/tidewave/subdomains.md This snippet shows how to update the session options in a Phoenix application's endpoint to include `same_site: "None"` and `secure: true`. This is done within the `code_reloading?` block for development configurations. ```elixir if code_reloading? do @session_options Keyword.merge(@session_options, same_site: "None", secure: true) # here goes the remaining of the code reloading configuration end ``` -------------------------------- ### Configure Caddy as a Reverse Proxy for Tidewave Source: https://hexdocs.pm/tidewave/https.md This Caddyfile configuration proxies HTTPS traffic to the Tidewave service. It includes a header rewrite to ensure the Origin header is correctly handled for security. ```caddyfile https://localhost:9833 { # Uncommend if you want to use Caddy's own certificate # tls internal reverse_proxy http://localhost:9832 { header_up Origin "https://localhost:9833" "http://localhost:9832" } } ``` -------------------------------- ### Configure Django for SameSite=None Secure Cookies Source: https://hexdocs.pm/tidewave/subdomains.md This snippet configures Django's session and CSRF cookies to use `SameSite=None` and `Secure=True` in development environments. This is necessary for cross-domain cookie access when using multiple subdomains with Tidewave. ```python if DEBUG: SESSION_COOKIE_SAMESITE = 'None' SESSION_COOKIE_SECURE = True CSRF_COOKIE_SAMESITE = 'None' CSRF_COOKIE_SECURE = True ``` -------------------------------- ### Configure Ruby on Rails for SameSite=None Secure Cookies Source: https://hexdocs.pm/tidewave/subdomains.md This snippet configures the session store in Ruby on Rails to use `SameSite=None` and `Secure=True`, assuming SSL is enabled. It requires `rack-session` version 2.1.0 or later. ```ruby config.session_store :cookie_store, key: "__your_app_session", same_site: :none, secure: true, assume_ssl: true ``` -------------------------------- ### Configure Tidewave MCP Server in Zed Source: https://hexdocs.pm/tidewave/mcp_zed.md This JSON configuration defines the remote server endpoint for the Tidewave MCP. Users must replace the $PORT placeholder with the actual port number where their web application is hosted. ```json { "tidewave-mcp": { "url": "http://localhost:$PORT/tidewave/mcp" } } ``` -------------------------------- ### Configure Tidewave MCP in Cursor Source: https://hexdocs.pm/tidewave/mcp_cursor.md Defines the MCP server configuration for Cursor. This JSON structure specifies the URL endpoint for the Tidewave service, which should be placed in a .cursor/mcp.json file. ```json { "mcpServers": { "tidewave": { "url": "http://localhost:$PORT/tidewave/mcp" } } } ``` -------------------------------- ### Configure Tidewave Host Path in Docker Source: https://hexdocs.pm/tidewave/editors.md This command sets the TIDEWAVE_HOST_PATH environment variable to the current working directory, allowing Tidewave to correctly map file paths from inside a container to the host machine. ```bash docker run -e TIDEWAVE_HOST_PATH=$(pwd) ... ``` -------------------------------- ### Configure Remote Access and Allowed Origins Source: https://hexdocs.pm/tidewave/https.md Settings to permit remote access and define trusted origins for the Tidewave application. These settings should be used with caution on secure networks. ```toml # Allow access from other machines, only enable it in safe networks allow_remote_access = true # Use the addresses you will insert in the browser to actually open up Tidewave allowed_origins = ["https://example.com:9898"] ``` ```shell tidewave --allow-remote-access --allowed-origins https://example.com:9898 ``` -------------------------------- ### Verify Tidewave MCP Endpoint Connectivity Source: https://hexdocs.pm/tidewave/mcp.md Use curl to send a JSON-RPC ping request to the Tidewave MCP endpoint. This helps verify if the web server is correctly responding to MCP requests. ```bash curl -v http://localhost:4000/tidewave/mcp \ --header 'Content-Type: application/json' \ --header "Accept: application/json, text/event-stream" \ --data '{"jsonrpc":"2.0","id":1,"method":"ping"}' ``` -------------------------------- ### Generate Self-Signed SSL Certificate Source: https://hexdocs.pm/tidewave/https.md A shell command using OpenSSL to generate a self-signed certificate and key for local development purposes. ```shell openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365 -nodes \ -subj "/CN=localhost" \ -addext "subjectAltName=DNS:localhost,IP:127.0.0.1" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.