### Install Render CLI via Homebrew Source: https://context7.com/render-oss/cli/llms.txt Installs the Render CLI using the Homebrew package manager. Verify the installation by checking the CLI version. ```bash brew install render-oss/tap/render render --version ``` -------------------------------- ### Install Render CLI via Shell Script Source: https://context7.com/render-oss/cli/llms.txt Installs the latest version of the Render CLI using a shell script. Verify the installation by checking the CLI version. ```bash # Install latest version of Render CLI curl -fsSL https://raw.githubusercontent.com/render-oss/cli/bin/install.sh | sh # Verify installation render --version # Output: render v2.16.0 # You are using the latest version ``` -------------------------------- ### Configure CLI for Local Development API Source: https://github.com/render-oss/cli/blob/main/AGENTS.md Bash commands to set up the Render CLI to test against a local development API. Includes starting the API with tilt and configuring environment variables. ```bash # Start API tilt up api curl -k https://api.localhost.render.com:8443/health # Configure CLI export RENDER_HOST="https://api.localhost.render.com:8443/v1/" export RENDER_API_KEY="your-api-key" ./render services list ``` -------------------------------- ### Start local workflow development server Source: https://context7.com/render-oss/cli/llms.txt Starts a local workflow development server for testing Render Workflows. Runs your workflow process on a specified port and exposes a local API. ```bash # Start local dev server for a Python workflow render workflows dev -- "python main.py" # Workflow server listening on port 8120 # 3 tasks found in main.py # • process-order # • send-notification # • cleanup-temp-files # # To browse and run tasks, open another terminal and run: # render workflows tasks list --local # Start on a custom port render workflows dev --port 9000 -- "npm start" # In a second terminal: list tasks on the local server render workflows tasks list --local # Trigger a specific task directly with input render workflows tasks start process-order --local --input='["order-123"]' # Enable debug output for detailed execution events render workflows dev --debug -- "go run ./cmd/worker" ``` -------------------------------- ### Bubble Tea Elm Architecture Example Source: https://context7.com/render-oss/cli/llms.txt Implements the Elm Architecture for a TUI view. All I/O must be asynchronous via tea.Cmd; never block in Update(). ```go package views import ( tea "github.com/charmbracelet/bubbletea" "github.com/render-oss/cli/pkg/client" ) type LoadServicesMsg struct{} type ServicesLoadedMsg struct{ Services []client.Service } type ErrorMsg struct{ Err error } type ExampleModel struct { services []client.Service err error repo *service.Repo } func (m ExampleModel) Init() tea.Cmd { return func() tea.Msg { return LoadServicesMsg{} } } func (m ExampleModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { case LoadServicesMsg: return m, m.fetchServices() // async, never block here case ServicesLoadedMsg: m.services = msg.Services return m, nil case ErrorMsg: m.err = msg.Err return m, nil } return m, nil } func (m ExampleModel) fetchServices() tea.Cmd { return func() tea.Msg { svcs, err := m.repo.ListServices(context.Background(), nil) if err != nil { return ErrorMsg{Err: err} } return ServicesLoadedMsg{Services: svcs} } } func (m ExampleModel) View() string { if m.err != nil { return "Error: " + m.err.Error() } // render table of m.services ... return "" } ``` -------------------------------- ### Styling with Lipgloss Source: https://github.com/render-oss/cli/blob/main/pkg/tui/AGENTS.md Utilize `pkg/style/` for consistent styling and `lipgloss.Height`/`lipgloss.Width` for dynamic dimensions. ```go title := style.Title.Render("My Title") height := lipgloss.Height(rendered) ``` -------------------------------- ### Render CLI Environment Variables and Configuration Source: https://context7.com/render-oss/cli/llms.txt Demonstrates how to configure the Render CLI using environment variables and a configuration file. Useful for CI/CD pipelines. ```bash # Full environment variable reference export RENDER_API_KEY="rnd_xxxxxxxxxxxx" # API key (bypasses OAuth login) export RENDER_HOST="https://api.render.com/v1/" # API base URL export RENDER_WORKSPACE="ws-abc123" # Active workspace override export RENDER_CLI_CONFIG_PATH="~/.config/render/cli.yaml" # Config file path # Example: CI pipeline deploying to Render export RENDER_API_KEY="${RENDER_API_KEY}" export RENDER_WORKSPACE="${RENDER_WORKSPACE_ID}" render deploys create srv-abc123 --wait --confirm --output json # exits 0 on success, 1 on deploy failure # Config file structure (~/.render/cli.yaml) cat ~/.render/cli.yaml # version: 1 # workspace: ws-abc123 # workspace_name: My Team # user_email: alice@example.com # api: # key: rnd_xxxxxxxxxxxx # expires_at: 1893456000 # host: https://api.render.com/v1/ ``` -------------------------------- ### Create a New Service with `render services create` Source: https://context7.com/render-oss/cli/llms.txt Creates a new service on Render, either from scratch or by cloning an existing configuration. Requires flags for all configuration details and runs in non-interactive mode only. ```bash # Create a Node.js web service from a GitHub repo render services create \ --name my-api \ --type web_service \ --repo https://github.com/my-org/my-api \ --branch main \ --runtime node \ --build-command "npm ci" \ --start-command "node server.js" \ --region oregon \ --env-var "NODE_ENV=production" \ --env-var "PORT=10000" \ --output json # {"id":"srv-newxxx","name":"my-api","type":"web_service",...} # Clone an existing service and rename it render services create \ --from srv-abc123 \ --name my-api-staging \ --environment-id env-staging \ --output json ``` -------------------------------- ### Build Render CLI from Source Source: https://context7.com/render-oss/cli/llms.txt Builds the Render CLI from its source code. This involves cloning the repository, compiling the Go binary, and then running the executable to verify the version. ```bash git clone https://github.com/render-oss/cli.git cd cli go build -o render . ./render --version ``` -------------------------------- ### List Services with `render services` Source: https://context7.com/render-oss/cli/llms.txt Lists all services and datastores for the active workspace. Supports interactive TUI, structured table output, JSON, or YAML. Can filter by environment IDs and include preview environments. ```bash # Interactive TUI (default when stdout is a TTY) render services # Output all services as JSON render services --output json # [{"id":"srv-abc123","name":"my-api","type":"web_service","status":"live",...}, ...] # Filter by one or more environment IDs render services -e env-abc123,env-def456 --output yaml # Include preview environments render services --include-previews --output json ``` -------------------------------- ### Build and Test Commands for Render CLI Source: https://github.com/render-oss/cli/blob/main/AGENTS.md Standard bash commands for building the Render CLI binary and running tests. Includes commands for linting and formatting using prek. ```bash # Building go build -o render . # Testing go test ./... go test -run TestName ./pkg/... # Linting & Formatting golangci-lint run prek run --all-files ``` -------------------------------- ### Create a deploy with cache cleared Source: https://context7.com/render-oss/cli/llms.txt Creates a new deploy for a service, clearing the build cache before deployment. Use `--confirm` to skip the confirmation prompt. ```bash render deploys create srv-abc123 --clear-cache --confirm ``` -------------------------------- ### Service Data Access Pattern in Go Source: https://github.com/render-oss/cli/blob/main/AGENTS.md Illustrates a three-layer data access pattern in Go: Service, Repo, and Client. The service combines data from multiple repositories. ```go // Service combines data from multiple repos svc, _ := s.repo.ListServices(ctx, params) // calls client internally proj, _ := s.projectRepo.ListProjects(ctx) // different repo return s.enrich(svc, proj) // business logic ``` -------------------------------- ### render services create Source: https://context7.com/render-oss/cli/llms.txt Creates a new service on Render from scratch or by cloning an existing service configuration. Runs in non-interactive mode only; use flags to supply all configuration. ```APIDOC ## `render services create` ### Description Creates a new service on Render from scratch or by cloning an existing service configuration. Runs in non-interactive mode only; use flags to supply all configuration. ### Method CLI Command ### Parameters #### Flags - **--name** (string) - Required - The name of the new service. - **--type** (string) - Required - The type of service (e.g., `web_service`, `static_site`). - **--repo** (string) - Required if not cloning - The URL of the Git repository. - **--branch** (string) - Optional - The branch to build from. - **--runtime** (string) - Optional - The runtime environment (e.g., `node`, `python`). - **--build-command** (string) - Optional - The command to build the service. - **--start-command** (string) - Optional - The command to start the service. - **--region** (string) - Optional - The region to deploy the service in. - **--env-var** (string) - Optional - Environment variables to set (can be specified multiple times). - **--from** (string) - Optional - The ID of an existing service to clone configuration from. - **--environment-id** (string) - Optional - The environment ID to create the service in (when cloning). - **--output** (string) - Optional - Output format (`json`, `yaml`, `text`). ### Usage ```bash # Create a Node.js web service from a GitHub repo render services create \ --name my-api \ --type web_service \ --repo https://github.com/my-org/my-api \ --branch main \ --runtime node \ --build-command "npm ci" \ --start-command "node server.js" \ --region oregon \ --env-var "NODE_ENV=production" \ --env-var "PORT=10000" \ --output json # Output: {"id":"srv-newxxx","name":"my-api","type":"web_service",...} # Clone an existing service and rename it render services create \ --from srv-abc123 \ --name my-api-staging \ --environment-id env-staging \ --output json ``` ``` -------------------------------- ### Trigger a New Deploy with `render deploys create` Source: https://context7.com/render-oss/cli/llms.txt Triggers a new deploy for a service, optionally targeting a specific git commit or Docker image. Use `--wait` to block until the deploy finishes and exit non-zero on failure. ```bash # Trigger a deploy (interactive: streams logs in TUI) render deploys create srv-abc123 # Trigger a deploy for a specific commit (non-interactive) render deploys create srv-abc123 --commit 0a1b2c3d --output json # {"id":"dep-xxx","status":"build_in_progress","commitId":"0a1b2c3d",...} # Deploy and wait for completion; exit 1 on failure render deploys create srv-abc123 --wait --output text ``` -------------------------------- ### Running TUI Tests Source: https://github.com/render-oss/cli/blob/main/pkg/tui/AGENTS.md Execute TUI tests using the `go test` command with the appropriate package path. ```bash go test ./pkg/tui/... # Run TUI tests ``` -------------------------------- ### Create a one-off job for a service Source: https://context7.com/render-oss/cli/llms.txt Creates a one-off job for a service, streaming logs upon creation. Use `--output json` for non-interactive creation. A specific compute plan can be assigned using `--plan-id`. ```bash # Create a job for a service (non-interactive) render jobs create srv-abc123 \ --start-command "bundle exec rake db:migrate" \ --output json # {"id":"job-xxx","serviceId":"srv-abc123","status":"starting",...} ``` ```bash # Create a job with a specific compute plan render jobs create srv-abc123 \ --start-command "npm run heavy-task" \ --plan-id plan-srv-006 \ --output json ``` ```bash # Create a job interactively (select service, enter command in TUI) render jobs create ``` -------------------------------- ### Render CLI Output Formats Source: https://context7.com/render-oss/cli/llms.txt Demonstrates the different output formats supported by Render CLI commands: TUI, JSON, YAML, and text table. Includes piping to standard tools like jq. ```bash # Interactive TUI (default on TTY) render services # Structured JSON (machine-readable) render services --output json render services -o json # Structured YAML render deploys list srv-abc123 --output yaml # Human-readable text table (default on non-TTY / pipes) render services --output text render services | cat # auto-switches to text # Combine with standard tools render services -o json | jq '.[] | select(.status == "live") | .name' render deploys list srv-abc123 -o json | jq '.[0].id' ``` -------------------------------- ### List deploys for a service Source: https://context7.com/render-oss/cli/llms.txt Lists deploys for a specified service. Output can be formatted as JSON or a text table. In interactive mode, it allows further actions on deploys. ```bash # List deploys for a service as JSON render deploys list srv-abc123 --output json # [{"id":"dep-xxx","status":"live","commit":{"id":"0a1b2c3d"}, ...}, ...] ``` ```bash # List deploys as a text table render deploys list srv-abc123 --output text ``` ```bash # Browse deploys interactively (select service from list) render deploys list ``` -------------------------------- ### render services Source: https://context7.com/render-oss/cli/llms.txt Lists all services and datastores for the active workspace. In interactive mode, navigate to any resource and open a palette of context-sensitive actions. In non-interactive mode, outputs a structured table, JSON, or YAML. ```APIDOC ## `render services` ### Description Lists all services and datastores for the active workspace. In interactive mode, navigate to any resource and open a palette of context-sensitive actions (logs, restart, deploy, SSH, psql, etc.). In non-interactive mode, outputs a structured table, JSON, or YAML. ### Method CLI Command ### Parameters #### Query Parameters - **-e, --environment-id** (string) - Optional - Filter by one or more environment IDs. - **--include-previews** (boolean) - Optional - Include preview environments. - **--output** (string) - Optional - Output format (`interactive`, `json`, `yaml`, `text`). Defaults to `interactive` when stdout is a TTY. ### Usage ```bash # Interactive TUI (default when stdout is a TTY) render services # Output all services as JSON render services --output json # Output: [{"id":"srv-abc123","name":"my-api","type":"web_service","status":"live",...}, ...] # Filter by one or more environment IDs render services -e env-abc123,env-def456 --output yaml # Include preview environments render services --include-previews --output json ``` ``` -------------------------------- ### Handle Async Operations with Commands Source: https://github.com/render-oss/cli/blob/main/pkg/tui/AGENTS.md Never block the Update function. Use commands for I/O operations and return them to be executed asynchronously. ```go func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { case tea.KeyMsg: return m, m.fetchData() // Return command, don't block case DataLoadedMsg: m.data = msg.Data return m, nil } return m, nil } func (m Model) fetchData() tea.Cmd { return func() tea.Msg { data, err := m.repo.List() if err != nil { return ErrorMsg{Err: err} } return DataLoadedMsg{Data: data} } } ``` -------------------------------- ### Open interactive key-value CLI session Source: https://context7.com/render-oss/cli/llms.txt Opens an interactive `redis-cli` or `valkey-cli` session for a Render Key Value instance. Extra CLI arguments can be passed after `--`. ```bash # Open interactive key-value CLI session render kv-cli kv-abc123 ``` ```bash # Connect by name render kv-cli my-cache-instance ``` ```bash # Pass through redis-cli arguments (e.g., scan all keys) render kv-cli kv-abc123 -- --scan ``` ```bash # Use KEYS pattern via pass-through render kv-cli kv-abc123 -- --pattern "session:*" ``` -------------------------------- ### View logs for multiple services Source: https://context7.com/render-oss/cli/llms.txt Views logs from multiple services simultaneously. Use `--tail` to stream live logs and `--output text` for a combined table view. ```bash # View logs for multiple services simultaneously render logs --resources srv-abc123,srv-def456 --tail --output text ``` -------------------------------- ### List Render Workflow services Source: https://context7.com/render-oss/cli/llms.txt Lists Render Workflow services in the active workspace, with options for JSON or plain text table output. ```bash # List workflows as JSON render workflows list --output json # [{"id":"svc-wfxxx","name":"order-processor","status":"live",...}, ...] # List workflows as a text table render workflows list --output text ``` -------------------------------- ### render deploys create Source: https://context7.com/render-oss/cli/llms.txt Triggers a new deploy for a service. Optionally targets a specific git commit or Docker image. Use `--wait` to block until the deploy finishes and exit non-zero on failure. ```APIDOC ## `render deploys create` ### Description Triggers a new deploy for a service. Optionally targets a specific git commit or Docker image. Use `--wait` to block until the deploy finishes and exit non-zero on failure (useful in CI pipelines). ### Method CLI Command ### Parameters #### Path Parameters - **service_id** (string) - Required - The ID of the service to deploy. #### Flags - **--commit** (string) - Optional - The git commit SHA to deploy. - **--wait** (boolean) - Optional - Wait for the deploy to complete and exit non-zero on failure. - **--output** (string) - Optional - Output format (`json`, `yaml`, `text`). ### Usage ```bash # Trigger a deploy (interactive: streams logs in TUI) render deploys create srv-abc123 # Trigger a deploy for a specific commit (non-interactive) render deploys create srv-abc123 --commit 0a1b2c3d --output json # Output: {"id":"dep-xxx","status":"build_in_progress","commitId":"0a1b2c3d",...} # Deploy and wait for completion; exit 1 on failure render deploys create srv-abc123 --wait --output text ``` ``` -------------------------------- ### Manage Current Workspace with `render workspace` Source: https://context7.com/render-oss/cli/llms.txt Displays the currently active workspace and allows setting it persistently or overriding it for a single command using the RENDER_WORKSPACE environment variable. ```bash # Show active workspace render workspace current # Output: ws-abc123 (My Team) # Override workspace for a single command without changing config RENDER_WORKSPACE=ws-xyz789 render services --output json # Set active workspace persistently render workspace set ws-abc123 ``` -------------------------------- ### render login Source: https://context7.com/render-oss/cli/llms.txt Opens a browser-based OAuth flow against the Render Dashboard to authenticate the CLI. Credentials are stored in `~/.render/cli.yaml`. The login step is skipped if `RENDER_API_KEY` is set. ```APIDOC ## `render login` ### Description Opens a browser-based OAuth flow against the Render Dashboard to authenticate the CLI. Credentials (API key, refresh token, host) are stored in `~/.render/cli.yaml`. When `RENDER_API_KEY` is set as an environment variable, the login step is skipped and the env var takes precedence. ### Method CLI Command ### Usage ```bash # Authenticate interactively via browser render login # Use a static API key instead (CI/CD environments) export RENDER_API_KEY="rnd_xxxxxxxxxxxxxxxxxxxx" export RENDER_HOST="https://api.render.com/v1/" # optional, defaults to this value render services --output json ``` ``` -------------------------------- ### Open interactive psql session Source: https://context7.com/render-oss/cli/llms.txt Opens an interactive `psql` session to a Render Postgres database. Can also execute a single SQL command using `--command` with JSON or text output. ```bash # Open interactive psql session render psql pg-abc123 ``` ```bash # Execute a SQL query and return JSON results render psql pg-abc123 --command "SELECT id, email FROM users LIMIT 5;" --output json # [{"id":1,"email":"alice@example.com"}, ...] ``` ```bash # Execute SQL and get plain text output render psql pg-abc123 --command "SELECT COUNT(*) FROM orders;" --output text ``` ```bash # Pass extra psql flags after -- render psql pg-abc123 --command "SELECT 1;" --output json -- --csv -q ``` ```bash # Connect by database name render psql my-production-db --command "SHOW server_version;" --output text ``` -------------------------------- ### Push to Stack Navigation Source: https://github.com/render-oss/cli/blob/main/pkg/tui/AGENTS.md Use `stack.Push` to add a new model to the navigation stack. Return the generated command from the Update function. ```go // Push returns a tea.Cmd - must be returned from Update() cmd := stack.Push(ModelWithCmd{ Model: myModel, Cmd: "render services list", // For clipboard Breadcrumb: "Services", }) return m, cmd ``` -------------------------------- ### SSH into a service instance Source: https://context7.com/render-oss/cli/llms.txt Opens an interactive SSH session into a running service instance. Can connect to a specific instance or an ephemeral one using `--ephemeral`. Arguments for SSH can be forwarded after `--`. ```bash # SSH into a service (prompts to select instance if multiple) render ssh srv-abc123 ``` ```bash # Connect to an ephemeral instance render ssh srv-abc123 --ephemeral ``` ```bash # SSH using service name instead of ID render ssh my-api-service ``` ```bash # Forward a local port through SSH (tunnel to a private DB) render ssh srv-abc123 -- -L 5432:my-db.internal:5432 ``` ```bash # SSH into a specific instance directly render ssh srv-abc123--instance-id-xyz ``` -------------------------------- ### Authenticate Render CLI with `render login` Source: https://context7.com/render-oss/cli/llms.txt Authenticates the Render CLI using an interactive OAuth flow via the Render Dashboard. Alternatively, use environment variables for authentication, which takes precedence. ```bash # Authenticate interactively via browser render login # Use a static API key instead (CI/CD environments) export RENDER_API_KEY="rnd_xxxxxxxxxxxxxxxxxxxx" export RENDER_HOST="https://api.render.com/v1/" # optional, defaults to this value render services --output json ``` -------------------------------- ### List jobs for a service Source: https://context7.com/render-oss/cli/llms.txt Lists one-off jobs for a service, with options for JSON or plain text output. Interactive browsing is also supported. ```bash # List jobs for a service as JSON render jobs list srv-abc123 --output json # [{"id":"job-xxx","status":"succeeded","startCommand":"rake db:migrate",...}, ...] # List as plain text table render jobs list srv-abc123 --output text # Browse jobs interactively render jobs list ``` -------------------------------- ### Conditional Output Format Logic Source: https://github.com/render-oss/cli/blob/main/AGENTS.md Go code demonstrating how to conditionally run TUI or non-interactive output based on context. Uses command.IsInteractive(ctx). ```go if command.IsInteractive(ctx) { return runTUI(deps) } return runNonInteractive(ctx, deps) // JSON, YAML, TEXT ``` -------------------------------- ### Tail live logs for a service Source: https://context7.com/render-oss/cli/llms.txt Streams live logs for a specified service. Requires the `--resources` flag. Use `--tail` to continuously follow new log entries. ```bash # Tail live logs for a service render logs --resources srv-abc123 --tail ``` -------------------------------- ### Generate CLI Client Types Source: https://github.com/render-oss/cli/blob/main/AGENTS.md Bash commands to generate CLI client types from a public API schema. Requires setting the RENDER_API_PATH environment variable. ```bash # Type Generation (from public-api-schema) export RENDER_API_PATH=/path/to/api cd ../public-api-schema && ./generate-cli.sh ``` -------------------------------- ### Bubble Tea TUI Update Function Source: https://github.com/render-oss/cli/blob/main/AGENTS.md Illustrates common patterns for Bubble Tea TUI applications, specifically handling asynchronous operations with tea.Cmd and exit conditions. ```go // Don't block in Update() - use tea.Cmd for async work // Handle tea.KeyCtrlC and tea.KeyCtrlD for proper exit // Push() returns a tea.Cmd that must be returned from Update() ``` -------------------------------- ### Message Naming Convention Source: https://github.com/render-oss/cli/blob/main/pkg/tui/AGENTS.md Follow the convention of naming messages with an Action and Msg suffix. ```go // Name messages with Action + Msg suffix type LoadingDataMsg struct{} type DataLoadedMsg struct{ Data []Item } type ErrorMsg struct{ Err error } ``` -------------------------------- ### Logging for Debugging Source: https://github.com/render-oss/cli/blob/main/pkg/tui/AGENTS.md Log TUI output to a file for debugging purposes, as stdout is occupied by the TUI. ```go // Log to file (stdout is occupied by TUI) f, _ := tea.LogToFile("debug.log", "debug") defer f.Close() ``` -------------------------------- ### Validate a render.yaml blueprint Source: https://context7.com/render-oss/cli/llms.txt Validates a render.yaml Infrastructure-as-Code blueprint file against the Render API schema. Outputs success or validation errors. ```bash # Validate a blueprint in the current directory render blueprints validate ./render.yaml # Validate a blueprint in a subdirectory render blueprints validate ./infra/render.yaml # ✓ Blueprint is valid # (or outputs validation errors with details) ``` -------------------------------- ### TUI Test Pattern Source: https://github.com/render-oss/cli/blob/main/pkg/tui/AGENTS.md Implement table-driven tests using `stretchr/testify` and manual fakes in `testhelper/`. ```go func TestMyView(t *testing.T) { fake := &testhelper.FakeDimensionModel{Value: "test"} model := NewMyModel(fake) // Assert on View() output or model state } ``` -------------------------------- ### Interactive vs. Non-Interactive Command Branching Source: https://context7.com/render-oss/cli/llms.txt Commands branch on output format. Use command.IsInteractive(ctx) or command.NonInteractive() to decide between launching the TUI and printing structured output. ```go // cmd/mycommand.go myCmd.RunE = func(cmd *cobra.Command, args []string) error { var input MyInput if err := command.ParseCommand(cmd, args, &input); err != nil { return err } // Non-interactive path: returns true if output != interactive if nonInteractive, err := command.NonInteractive(cmd, func() ([]MyResult, error) { return deps.MyRepo().List(cmd.Context(), input) }, text.MyResultTable); err != nil { return err } else if nonInteractive { return nil // already printed JSON/YAML/text } // Interactive path: push TUI view onto the stack InteractiveMyView(cmd.Context(), input, "My View") return nil } ``` -------------------------------- ### Restart a service interactively Source: https://context7.com/render-oss/cli/llms.txt Restarts a service. In interactive mode, it confirms the action and streams logs post-restart. Use `--confirm` for scripting. ```bash # Restart a service interactively (confirms and streams logs) render restart srv-abc123 ``` -------------------------------- ### Push New View onto Stack Source: https://context7.com/render-oss/cli/llms.txt Manages a breadcrumb navigation stack. Push new views by returning the result of stack.Push() from Update(). ```go // Push a new view onto the navigation stack func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { case tea.KeyMsg: if msg.String() == "enter" { // Navigate deeper — must return the cmd return m, command.AddToStackFunc( m.ctx, myCobraCmd, "Deploy Details", // breadcrumb label &myInput, views.NewDeployDetailView(m.ctx, myInput), ) } } return m, nil } ``` -------------------------------- ### render workspace current Source: https://context7.com/render-oss/cli/llms.txt Displays the currently active workspace. All CLI operations run against the active workspace. The workspace can be overridden per-session with the `RENDER_WORKSPACE` environment variable. ```APIDOC ## `render workspace current` ### Description Displays the currently active workspace. All CLI operations run against the active workspace. The workspace can be overridden per-session with the `RENDER_WORKSPACE` environment variable. ### Method CLI Command ### Usage ```bash # Show active workspace render workspace current # Output: ws-abc123 (My Team) # Override workspace for a single command without changing config RENDER_WORKSPACE=ws-xyz789 render services --output json # Set active workspace persistently render workspace set ws-abc123 ``` ``` -------------------------------- ### Watching Log Files Source: https://github.com/render-oss/cli/blob/main/pkg/tui/AGENTS.md Use `tail -f` in a separate terminal to monitor the debug log file. ```bash tail -f debug.log # Watch logs in another terminal ``` -------------------------------- ### Restart a service without confirmation Source: https://context7.com/render-oss/cli/llms.txt Restarts a service without prompting for confirmation, suitable for CI/scripting. Output can be formatted as JSON or plain text. ```bash # Restart without confirmation (CI/scripting) render restart srv-abc123 --confirm --output text # Restarted srv-abc123 ``` ```bash # Restart and output result as JSON render restart srv-abc123 --confirm --output json # "Restarted srv-abc123" ``` -------------------------------- ### Query logs within a time window Source: https://context7.com/render-oss/cli/llms.txt Queries logs for a service within a specific time range. Supports JSON output and filtering by various criteria. Ensure `--resources` is provided for non-interactive mode. ```bash # Query logs in a specific time window, output as JSON render logs \ --resources srv-abc123 \ --start 2026-04-01T00:00:00Z \ --end 2026-04-01T01:00:00Z \ --output json # [{"timestamp":"2026-04-01T00:00:01Z","message":"Server started","level":"info"}, ...] ``` -------------------------------- ### Filter request logs by HTTP method and path Source: https://context7.com/render-oss/cli/llms.txt Filters request logs by HTTP method and path. Useful for debugging specific API endpoints. Supports JSON output for structured results. ```bash # Filter request logs by HTTP method and path render logs \ --resources srv-abc123 \ --type request \ --method POST \ --path "/api/users" \ --output json ``` -------------------------------- ### Filter logs by level, type, and limit Source: https://context7.com/render-oss/cli/llms.txt Filters logs based on log level, type, and limits the number of results. Useful for isolating specific types of log messages. Use `--output text` for a human-readable table. ```bash # Filter by log level and type, limit results render logs \ --resources srv-abc123 \ --level error,critical \ --type app \ --limit 50 \ --output text ``` -------------------------------- ### Delegate Updates to Subcomponents Source: https://github.com/render-oss/cli/blob/main/pkg/tui/AGENTS.md Always delegate update messages to child components to ensure proper state management. ```go func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { var cmds []tea.Cmd var cmd tea.Cmd m.table, cmd = m.table.Update(msg) cmds = append(cmds, cmd) m.input, cmd = m.input.Update(msg) cmds = append(cmds, cmd) return m, tea.Batch(cmds...) } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.