### Configure Frontend and Backend Repositories
Source: https://docs.roocode.com/roo-code-cloud/environments
Define repositories, their commands for installation, building, and starting development servers, including detached processes and log files.
```yaml
repositories:
- repository: myorg/frontend
commands:
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Start dev server
run: npm run dev
detached: true
logfile: /tmp/frontend.log
- repository: myorg/backend
commands:
- name: Install dependencies
run: npm install
- name: Run migrations
run: npm run db:migrate
- name: Start server
run: npm run start
detached: true
logfile: /tmp/backend.log
```
--------------------------------
### Build and Start Project
Source: https://docs.roocode.com/advanced-usage/available-tools/execute-command
Chain build and start commands to compile assets and then launch the application. This is common in web development workflows.
```xml
npm run build && npm start
```
--------------------------------
### Execute Built-in Initialization Command
Source: https://docs.roocode.com/advanced-usage/available-tools/run-slash-command
This example shows how to execute the built-in `/init` command using the `` tag.
```xml
init
```
--------------------------------
### Example Search Files Output
Source: https://docs.roocode.com/advanced-usage/available-tools/search-files
This example demonstrates the typical output format for the search_files tool, showing relative file paths, context lines, and line numbers. It also illustrates how nearby matches are merged into a single block for readability.
```text
# rel/path/to/app.ts
11 | // Some processing logic here
12 | // TODO: Implement error handling
13 | return processedData;
----
# Showing first 300 of 300+ results. Use a more specific search if necessary.
```
```text
# rel/path/to/auth.ts
13 | // Some code here
14 | // TODO: Add proper validation
15 | function validateUser(credentials) {
16 | // TODO: Implement rate limiting
17 | return checkDatabase(credentials);
----
```
--------------------------------
### Write to File Tool Example
Source: https://docs.roocode.com/basic-usage/how-tools-work
This example demonstrates the `write_to_file` tool, used to create a new file named `greeting.js` with a JavaScript function to log a greeting message. It includes the file path, content, and line count as parameters.
```xml
greeting.js
function greet(name) {
console.log(`Hello, ${name}!`);
}
greet('World');
5
```
--------------------------------
### Complete Full-Stack Application Example
Source: https://docs.roocode.com/roo-code-cloud/environments
A comprehensive example of a full-stack application including frontend, API, and worker configurations.
```yaml
name: E-Commerce Platform
description: Full stack with frontend, API, and worker
repositories:
- repository: acme/storefront
commands:
- name: Install
run: npm install
- name: Build
run: npm run build
env:
VITE_API_URL: ${ROO_API_HOST}
- name: Serve
run: npx serve -s dist -l 3000
detached: true
logfile: /tmp/storefront.log
- repository: acme/api
tool_versions:
node: "20.11.0"
commands:
- name: Install
run: npm install
- name: Migrate
run: npm run db:push
- name: Start
run: npm run start
detached: true
logfile: /tmp/api.log
env:
ALLOWED_ORIGINS: ${ROO_WEB_HOST}
- repository: acme/worker
branch: main
commands:
- name: Install
run: npm install
- name: Start
run: npm run start
detached: true
logfile: /tmp/worker.log
ports:
- name: WEB
port: 3000
- name: API
port: 3001
- name: WORKER
port: 3002
services:
- postgres16
- redis7
env:
NODE_ENV: production
LOG_LEVEL: info
```
--------------------------------
### Ollama Modelfile Example
Source: https://docs.roocode.com/providers/ollama
An example Modelfile demonstrating how to set parameters such as `num_ctx` and `temperature` for a custom Ollama model.
```text
# Example Modelfile for reduced context
FROM qwen2.5-coder:32b
# Set context window to 32K tokens (reduced from default)
PARAMETER num_ctx 32768
# Optional: Adjust temperature for more consistent output
PARAMETER temperature 0.7
# Optional: Set repeat penalty
PARAMETER repeat_penalty 1.1
```
--------------------------------
### Create Simple HTML File
Source: https://docs.roocode.com/advanced-usage/available-tools/write-to-file
This example demonstrates how to create a basic HTML file. Provide the desired path and the HTML structure.
```xml
src/index.htmlMy Application13
```
--------------------------------
### Install Dependencies with pnpm
Source: https://docs.roocode.com/advanced-usage/local-development-setup
Install all necessary project dependencies using pnpm. This command should be run after cloning the repository.
```bash
pnpm install
```
--------------------------------
### Create Directories and Files
Source: https://docs.roocode.com/advanced-usage/available-tools/execute-command
Run multiple commands in sequence to create directories and files. This is useful for project setup or scaffolding.
```xml
mkdir -p src/components && touch src/components/App.js
```
--------------------------------
### Install Git on macOS with Xcode Command Line Tools
Source: https://docs.roocode.com/features/checkpoints
Install Git on macOS by installing the Xcode Command Line Tools. This is an alternative method if Homebrew is not used.
```bash
xcode-select --install
```
--------------------------------
### Example .tool-versions File for Mise/asdf
Source: https://docs.roocode.com/roo-code-cloud/environments
A sample `.tool-versions` file used by mise or asdf to manage runtime versions within a repository.
```plaintext
# .tool-versions
node 20.11.0
python 3.12.1
```
--------------------------------
### Install Git on Arch Linux
Source: https://docs.roocode.com/features/checkpoints
Install Git on Arch Linux distributions using the pacman package manager.
```bash
sudo pacman -S git
```
--------------------------------
### Install Git on Fedora Linux
Source: https://docs.roocode.com/features/checkpoints
Install Git on Fedora Linux distributions using the dnf package manager.
```bash
sudo dnf install git
```
--------------------------------
### Example list_files Output with .rooignore
Source: https://docs.roocode.com/advanced-usage/available-tools/list-files
This example demonstrates the output format when .rooignore files are used and showRooIgnoredFiles is enabled, marking ignored files with a lock symbol.
```text
src/
src/components/
src/components/Button.tsx
src/components/Header.tsx
🔒 src/secrets.json
src/utils/
src/utils/helpers.ts
src/index.ts
```
--------------------------------
### Example Prompt Template for Code Explanation
Source: https://docs.roocode.com/features/code-actions
This template shows how to use placeholders like ${filePath} and ${selectedText} to customize prompts for code actions.
```text
Please explain the following code from ${filePath}:
${selectedText}
```
--------------------------------
### Install Git on macOS with Homebrew
Source: https://docs.roocode.com/features/checkpoints
Use Homebrew to install Git on macOS. This is the recommended method for macOS users.
```bash
brew install git
```
--------------------------------
### Serve Ollama Models
Source: https://docs.roocode.com/providers/ollama
Start the Ollama server to make models available for use. This command should be run in your terminal.
```bash
ollama serve
```
--------------------------------
### Download Qwen2.5-Coder Model
Source: https://docs.roocode.com/providers/ollama
Example of downloading a specific model, qwen2.5-coder:32b, from the Ollama library.
```bash
ollama pull qwen2.5-coder:32b
```
--------------------------------
### Request Technical Clarification
Source: https://docs.roocode.com/advanced-usage/available-tools/ask-followup-question
This example demonstrates how to use the tool to request technical clarifications, like choosing a database system. It provides a question and multiple database suggestions.
```xml
What database should this application use for storing user data?MongoDB for flexible schema and document-based storagePostgreSQL for relational data with strong consistency guaranteesFirebase for real-time updates and simplified backend managementSQLite for lightweight local storage without external dependencies
```
--------------------------------
### Setup .env File for Tool Environment Variables
Source: https://docs.roocode.com/features/experimental/custom-tools
Illustrates the setup for using environment variables within custom tools. A .env file is placed next to the tool, which Roo copies to the tool's cache directory. The tool must load these variables itself.
```plaintext
.roo/tools/
├── my-tool.ts
├── .env # Copied to cache dir at load time
└── package.json
```
--------------------------------
### Install VSIX Package via Command Line
Source: https://docs.roocode.com/advanced-usage/local-development-setup
Install the generated VSIX package into VS Code using the command line. Replace `` with the actual version number.
```bash
code --install-extension bin/roo-cline-.vsix
```
--------------------------------
### Install Project Dependencies
Source: https://docs.roocode.com/advanced-usage/available-tools/execute-command
Install project dependencies using npm. This command is typically run after cloning a project or when adding new packages.
```xml
npm install express mongodb mongoose dotenv
```
--------------------------------
### Run a Simple Command
Source: https://docs.roocode.com/advanced-usage/available-tools/execute-command
Execute a single command in the current directory. This is useful for starting development servers or running scripts.
```xml
npm run dev
```
--------------------------------
### Codebase Search for Configuration and Environment Setup
Source: https://docs.roocode.com/advanced-usage/available-tools/codebase-search
Find code related to environment variables and application configuration. This is essential for understanding how the application bootstraps.
```xml
environment variables and application configuration
```
--------------------------------
### Install Git on Debian/Ubuntu Linux
Source: https://docs.roocode.com/features/checkpoints
Install Git on Debian-based or Ubuntu Linux distributions using the apt package manager.
```bash
sudo apt update
sudo apt install git
```
--------------------------------
### Diff Format Example
Source: https://docs.roocode.com/advanced-usage/available-tools/apply-diff
Illustrates the required format for the `` parameter, showing how to define search and replace blocks with line number hints for applying changes.
```diff
<<<<<<< SEARCH
:start_line:10
:end_line:12
-------
// Old calculation logic
const result = value * 0.9;
return result;
=======
// Updated calculation logic with logging
console.log(`Calculating for value: ${value}`);
const result = value * 0.95; // Adjusted factor
return result;
>>>>>>> REPLACE
<<<<<<< SEARCH
:start_line:25
:end_line:25
-------
const defaultTimeout = 5000;
=======
const defaultTimeout = 10000; // Increased timeout
>>>>>>> REPLACE
```
--------------------------------
### Example list_files Output Format
Source: https://docs.roocode.com/advanced-usage/available-tools/list-files
This shows the standard output format for the list_files tool, including directories marked with a trailing slash and a note when the file listing is truncated.
```text
src/
src/components/
src/components/Button.tsx
src/components/Header.tsx
src/utils/
src/utils/helpers.ts
src/index.ts
...
File listing truncated (showing 200 of 543 files). Use list_files on specific subdirectories for more details.
```
--------------------------------
### Example Usage of run_slash_command
Source: https://docs.roocode.com/advanced-usage/available-tools/run-slash-command
This snippet demonstrates how to invoke the run_slash_command tool with a specific command and arguments. Ensure the 'Run Slash Command' experimental feature is enabled in settings.
```json
{
"tool": "run_slash_command",
"args": {
"command": "generate_component",
"args": {
"component_name": "new_button",
"type": "react"
}
}
}
```
--------------------------------
### Install Nightly VSIX Builds with pnpm
Source: https://docs.roocode.com/update-notes/v3.43.0
Use this command to easily install nightly VSIX builds of Roo Code. Ensure you have pnpm installed.
```bash
pnpm install:vsix:nightly
```
--------------------------------
### Run Custom Deployment Command with Arguments
Source: https://docs.roocode.com/advanced-usage/available-tools/run-slash-command
Demonstrates executing a custom command, such as 'deploy', and passing arguments to specify the target environment and deployment strategy.
```xml
deployproduction environment with zero-downtime strategy
```
--------------------------------
### Install npm Dependencies for Custom Tools
Source: https://docs.roocode.com/features/experimental/custom-tools
Demonstrates how to install npm packages like axios and lodash within your tool directory to use them in your custom tools. Imports will resolve normally after installation.
```bash
# From your tool directory
cd .roo/tools/
npm init -y
npm install axios lodash
```
--------------------------------
### Verify Git Installation on macOS
Source: https://docs.roocode.com/features/checkpoints
Verify that Git has been successfully installed on macOS by checking its version in the Terminal.
```bash
git --version
```
--------------------------------
### Query and Store Database Records
Source: https://docs.roocode.com/advanced-usage/available-tools/use-mcp-tool
This example shows how to query a database and store the results using the 'database-connector' server. The 'query_and_store' tool requires database details, query type, fields, and optional 'where' conditions, along with a 'store_as' name for the result.
```xml
database-connectorquery_and_store
{
"database": "users",
"type": "select",
"fields": ["name", "email", "last_login"],
"where": {
"status": "active"
},
"store_as": "active_users"
}
```
--------------------------------
### Run Project-Specific Build Command
Source: https://docs.roocode.com/advanced-usage/available-tools/run-slash-command
Illustrates executing a 'build' command with arguments tailored for a specific build environment, such as production optimization.
```xml
buildoptimized for production with source maps
```
--------------------------------
### Ask About Implementation Preferences
Source: https://docs.roocode.com/advanced-usage/available-tools/ask-followup-question
Use this snippet to ask users about their preferred implementation choices, such as styling frameworks. It includes a question and several suggested answers.
```xml
Which styling approach would you prefer for this web application?Use Bootstrap for rapid development with consistent componentsUse Tailwind CSS for utility-first styling with maximum flexibilityUse vanilla CSS with custom styling for complete control and minimal dependencies
```
--------------------------------
### Refactor with Diagnostics Context
Source: https://docs.roocode.com/features/diagnostics-integration
Leverage diagnostics to guide safe refactoring by mentioning current issues.
```text
I want to refactor this function. @problems shows current issues to address.
```
--------------------------------
### Run Ollama Model Interactively
Source: https://docs.roocode.com/providers/ollama
Start an interactive session with a specified Ollama model. This is useful for testing and configuration.
```bash
ollama run qwen2.5-coder:32b
```
--------------------------------
### Codebase Search for Testing Utilities in Specific Directory
Source: https://docs.roocode.com/advanced-usage/available-tools/codebase-search
Search for test setup and mock data creation patterns within the `tests` directory. This aids in understanding testing strategies.
```xml
test setup and mock data creationtests
```
--------------------------------
### Create Initial Todo List
Source: https://docs.roocode.com/advanced-usage/available-tools/update-todo-list
Use this snippet to create a new todo list for a development task. It initializes tasks for analysis, design, implementation, testing, and documentation.
```xml
[ ] Analyze requirements
[ ] Design architecture
[ ] Implement core logic
[ ] Write tests
[ ] Update documentation
```
--------------------------------
### Execute a terminal command
Source: https://docs.roocode.com/basic-usage/typing-your-requests
Instruct Roo Code to run a specific command in the terminal. This is useful for package installations or other command-line operations.
```text
run the command `npm install` in the terminal
```
--------------------------------
### Search for Specific Import Patterns
Source: https://docs.roocode.com/advanced-usage/available-tools/search-files
Find all import statements that match a given pattern, for example, imports from a specific component directory.
```xml
.import\s+. *\s+from\s+['"]@components/
```
--------------------------------
### Debug with Workspace Problems
Source: https://docs.roocode.com/features/diagnostics-integration
When starting a debugging session, include `@problems` to provide Roo Code with full context of current issues.
```text
@problems Help me debug why my application is crashing
```