### Build and start a project
Source: https://roocodeinc.github.io/Roo-Code/advanced-usage/available-tools/execute-command
Chains build and start commands to execute sequentially.
```xml
npm run build && npm start
```
--------------------------------
### Install project dependencies
Source: https://roocodeinc.github.io/Roo-Code/advanced-usage/available-tools/execute-command
Runs a package manager command to install multiple dependencies.
```xml
npm install express mongodb mongoose dotenv
```
--------------------------------
### System Prompt Context Example
Source: https://roocodeinc.github.io/Roo-Code/features/settings-management
Example of the system prompt output when time and cost context toggles are enabled.
```text
# Current Time
Current time in ISO 8601 UTC format: 2025-10-28T23:06:08.458Z
User time zone: America/Edmonton, UTC-6:00
# Current Cost
$0.14
```
--------------------------------
### Install LiteLLM Proxy
Source: https://roocodeinc.github.io/Roo-Code/providers/litellm
Install the LiteLLM package with proxy support enabled.
```bash
pip install 'litellm[proxy]'
```
--------------------------------
### Start LiteLLM Server
Source: https://roocodeinc.github.io/Roo-Code/providers/litellm
Launch the proxy server using a configuration file or a single model command.
```bash
# Using configuration file (recommended)
litellm --config config.yaml
# Or quick start with a single model
export ANTHROPIC_API_KEY=your-anthropic-key
litellm --model anthropic/claude-model-id
```
--------------------------------
### Install Nightly VSIX Build
Source: https://roocodeinc.github.io/Roo-Code/update-notes/v3.43.0
Use this command to simplify the installation of nightly VSIX builds.
```bash
pnpm install:vsix:nightly
```
--------------------------------
### Start Ollama Server
Source: https://roocodeinc.github.io/Roo-Code/providers/ollama
Command to initialize the Ollama service on your local machine.
```bash
ollama serve
```
--------------------------------
### Install Git on Linux
Source: https://roocodeinc.github.io/Roo-Code/features/checkpoints
Install Git using the package manager specific to your Linux distribution.
```bash
sudo apt update
sudo apt install git
```
```bash
sudo dnf install git
```
```bash
sudo pacman -S git
```
--------------------------------
### Example .worktreeinclude configuration
Source: https://roocodeinc.github.io/Roo-Code/features/worktrees
A sample configuration file using .gitignore syntax to specify untracked files that should be copied to new worktrees.
```text
node_modules
.env.local
.cache
dist
```
--------------------------------
### WSL Shell Integration Setup
Source: https://roocodeinc.github.io/Roo-Code/features/shell-integration
Command to manually source the shell integration path within a WSL environment.
```bash
source "$(code --locate-shell-integration-path )"
```
--------------------------------
### Ask Follow-up Question Examples
Source: https://roocodeinc.github.io/Roo-Code/advanced-usage/available-tools/ask-followup-question
Examples of using the tag to solicit user input on implementation preferences, technical choices, and ambiguous requirements.
```xml
Which styling approach would you prefer for this web application?
Use Bootstrap for rapid development with consistent components
Use Tailwind CSS for utility-first styling with maximum flexibility
Use vanilla CSS with custom styling for complete control and minimal dependencies
```
```xml
What database should this application use for storing user data?
MongoDB for flexible schema and document-based storage
PostgreSQL for relational data with strong consistency guarantees
Firebase for real-time updates and simplified backend management
SQLite for lightweight local storage without external dependencies
```
```xml
How should the application handle user authentication?
Implement email/password authentication with account verification
Use social login providers (Google, GitHub, etc.) for quick signup
Implement both email/password and social login options
```
--------------------------------
### Initialize npm dependencies for custom tools
Source: https://roocodeinc.github.io/Roo-Code/features/experimental/custom-tools
Commands to set up a project directory for custom tools and install required npm packages.
```bash
# From your tool directory
cd .roo/tools/
npm init -y
npm install axios lodash
```
--------------------------------
### Analyze URL Documentation
Source: https://roocodeinc.github.io/Roo-Code/providers/gemini
Example prompt for instructing the model to analyze external documentation and generate a client library.
```text
Please analyze the documentation at https://example.com/api-docs and create a TypeScript client library based on the API specification.
```
--------------------------------
### Apply Diff Format Example
Source: https://roocodeinc.github.io/Roo-Code/advanced-usage/available-tools/apply-diff
Demonstrates the required structure for the block, including SEARCH and REPLACE sections with mandatory start_line hints.
```text
<<<<<<< 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
```
--------------------------------
### Install Git on macOS
Source: https://roocodeinc.github.io/Roo-Code/features/checkpoints
Use Homebrew or Xcode Command Line Tools to install Git on macOS systems.
```bash
brew install git
```
```bash
xcode-select --install
```
--------------------------------
### Configure Legacy SSE MCP Server
Source: https://roocodeinc.github.io/Roo-Code/features/mcp/using-mcp-in-roo
Example configuration for an SSE-based MCP server using a base URL and custom authentication headers.
```json
{
"mcpServers": {
"legacy-remote-server": {
"type": "sse", // Explicitly define as SSE
"url": "https://your-legacy-server-url.com/mcp-base", // Base URL
"headers": {
"Authorization": "Bearer your-legacy-token"
},
"alwaysAllow": ["oldToolX"],
"disabled": false
}
}
}
```
--------------------------------
### Define environment variables for tools
Source: https://roocodeinc.github.io/Roo-Code/features/experimental/custom-tools
Example content for a .env file used by a custom tool.
```text
# .roo/tools/.env
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/XXX
API_SECRET=your-secret-key
```
--------------------------------
### Complete a task with a result and demonstration command
Source: https://roocodeinc.github.io/Roo-Code/advanced-usage/available-tools/attempt-completion
Include a command tag to execute a specific instruction, such as starting a development server, to demonstrate the completed work.
```xml
I've created a simple React application with the following features:
1. A responsive landing page with the requested hero section
2. A working contact form with validation
3. Navigation between all three requested pages
4. Styling that matches the provided design mockup
npm start
```
--------------------------------
### Combined Search and Analysis
Source: https://roocodeinc.github.io/Roo-Code/providers/gemini
Example prompt demonstrating the use of both search grounding and file analysis in a single workflow.
```text
Search for the latest Node.js security vulnerabilities and then analyze my package.json file to see if I'm affected. Also check the official Node.js security page for recommendations.
```
--------------------------------
### Search for Best Practices
Source: https://roocodeinc.github.io/Roo-Code/providers/gemini
Example prompt for utilizing Google Search grounding to retrieve current information on a specific technical topic.
```text
What are the latest best practices for React Server Components in 2025? Please search for the most recent information.
```
--------------------------------
### Manually Install Shell Integration
Source: https://roocodeinc.github.io/Roo-Code/features/shell-integration
Add these lines to your shell configuration file if automatic integration fails.
```bash
[[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --locate-shell-integration-path bash)"
```
```zsh
[[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --locate-shell-integration-path zsh)"
```
```powershell
if ($env:TERM_PROGRAM -eq "vscode") { . "$(code --locate-shell-integration-path pwsh)" }
```
```fish
string match -q "$TERM_PROGRAM" "vscode"; and . (code --locate-shell-integration-path fish)
```
--------------------------------
### Custom Code Action Prompt Template
Source: https://roocodeinc.github.io/Roo-Code/features/code-actions
Example template demonstrating the use of ${filePath} and ${selectedText} placeholders for customizing AI prompts.
```text
Please explain the following code from ${filePath}:
${selectedText}
```
--------------------------------
### Configure STDIO Transport for Local Servers
Source: https://roocodeinc.github.io/Roo-Code/features/mcp/using-mcp-in-roo
An example configuration for a local server using the STDIO transport, including optional working directory and environment settings.
```json
{
"mcpServers": {
"local-server": {
"command": "node",
"args": ["server.js"],
"cwd": "/path/to/project/root", // Optional: Specify working directory
"env": {
"API_KEY": "your_api_key"
},
"alwaysAllow": ["tool1", "tool2"],
"disabled": false
}
}
}
```
--------------------------------
### Unified Diff Patch Format Example
Source: https://roocodeinc.github.io/Roo-Code/advanced-usage/available-tools/apply-patch
Demonstrates the required patch format using custom headers for file operations followed by standard unified diff blocks.
```text
*** Add File: src/utils/newHelper.ts
--- /dev/null
+++ b/src/utils/newHelper.ts
@@ -0,0 +1,5 @@
+export function helperFunction(value: string): string {
+ return value.toUpperCase();
+}
*** Update File: src/main.ts
--- a/src/main.ts
+++ b/src/main.ts
@@ -10,7 +10,7 @@
import { config } from './config';
-const timeout = 5000;
+const timeout = 10000;
function main() {
*** Delete File: src/deprecated/oldUtil.ts
```
--------------------------------
### Configure Automatic Settings Import
Source: https://roocodeinc.github.io/Roo-Code/features/settings-management
Examples for setting the auto-import path in VS Code settings.json using absolute paths, home directory shortcuts, or disabling the feature.
```json
{
"roo-cline.autoImportSettingsPath": "/Users/your-username/Documents/dev-configs/roo-code.json"
}
```
```json
{
"roo-cline.autoImportSettingsPath": "~/roo-code-settings.json"
}
```
```json
{
"roo-cline.autoImportSettingsPath": ""
}
```
--------------------------------
### Initialize Skill Directory
Source: https://roocodeinc.github.io/Roo-Code/features/skills
Commands to create the directory and empty SKILL.md file for a new skill.
```bash
# Example: PDF processing skill
mkdir -p ~/.roo/skills/pdf-processing
touch ~/.roo/skills/pdf-processing/SKILL.md
```
--------------------------------
### Create Command Directories
Source: https://roocodeinc.github.io/Roo-Code/advanced-usage/available-tools/run-slash-command
Set up the directory structure for project-specific or global custom commands.
```bash
# For project-specific commands
mkdir -p .roo/commands
# For global commands
mkdir -p ~/.roo/commands
```
--------------------------------
### Native Tool Definition Example
Source: https://roocodeinc.github.io/Roo-Code/providers/openai-compatible
Example of the JSON structure for a file-reading tool using the OpenAI native tools schema.
```json
{
"tools": [
{
"type": "function",
"function": {
"name": "read_file",
"description": "Read a file from the workspace with line numbers.",
"parameters": {
"type": "object",
"properties": {
"path": { "type": "string", "description": "Relative file path" },
"start_line": { "type": "integer", "nullable": true },
"end_line": { "type": "integer", "nullable": true }
},
"required": ["path"]
}
}
}
]
}
```
--------------------------------
### Add to Context Chat Input Example
Source: https://roocodeinc.github.io/Roo-Code/features/code-actions
Example of how code added via the 'Add to Context' action appears in the chat interface with file and line number references.
```text
Can you explain this function?
@myFile.js:15:25
```
--------------------------------
### Test Skill Activation
Source: https://roocodeinc.github.io/Roo-Code/features/skills
Example user prompt to trigger the skill based on its description.
```text
"Can you help me extract tables from this PDF file?"
```
--------------------------------
### Run Qdrant with Docker
Source: https://roocodeinc.github.io/Roo-Code/features/codebase-indexing
Deploy a local Qdrant vector database instance using the official Docker image.
```bash
docker run -d \
--name qdrant \
--restart unless-stopped \
-p 6333:6333 \
-v qdrant_data:/qdrant/storage \
qdrant/qdrant
```
--------------------------------
### Define Mode-Specific TypeScript Rules
Source: https://roocodeinc.github.io/Roo-Code/features/custom-instructions
Example content for a mode-specific rule file for TypeScript.
```markdown
# TypeScript Code Mode Rules
1. Use strict mode in tsconfig.json
2. Prefer interfaces over type aliases for object shapes
3. Always specify return types for functions
```
--------------------------------
### Handle Blocked File
Source: https://roocodeinc.github.io/Roo-Code/advanced-usage/available-tools/read-file
Example of the error output when a file is excluded by .rooignore rules.
```xml
.env
```
--------------------------------
### Create a documentation task
Source: https://roocodeinc.github.io/Roo-Code/advanced-usage/available-tools/new-task
Initiates a task for generating documentation after implementation is complete.
```xml
docs
Create comprehensive API documentation for the authentication service we just built.
```
--------------------------------
### Handle Non-Existent File
Source: https://roocodeinc.github.io/Roo-Code/advanced-usage/available-tools/read-file
Example of the error output when attempting to read a file that does not exist.
```xml
non_existent_file.txt
```
--------------------------------
### Response Format Example
Source: https://roocodeinc.github.io/Roo-Code/advanced-usage/available-tools/ask-followup-question
The standard format for user answers, wrapped in tags.
```xml
Use Tailwind CSS for utility-first styling with maximum flexibility
```
--------------------------------
### Create Custom Model via Modelfile
Source: https://roocodeinc.github.io/Roo-Code/providers/ollama
Configuration file and command to define custom model parameters like context window and temperature.
```bash
# 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
```
```bash
ollama create qwen-32k -f Modelfile
```
--------------------------------
### Define Global Coding Standards
Source: https://roocodeinc.github.io/Roo-Code/features/custom-instructions
Example content for a global coding standards rule file.
```markdown
# Global Coding Standards
1. Always use TypeScript for new projects
2. Write unit tests for all new functions
3. Use descriptive variable names
4. Add JSDoc comments for public APIs
```
--------------------------------
### Execute initialization command
Source: https://roocodeinc.github.io/Roo-Code/advanced-usage/available-tools/run-slash-command
Triggers the built-in initialization process for a project.
```xml
init
```
--------------------------------
### Create Global Rules Directory
Source: https://roocodeinc.github.io/Roo-Code/features/custom-instructions
Commands to initialize the global rules directory on different operating systems.
```bash
# Linux/macOS
mkdir -p ~/.roo/rules
# Windows
mkdir %USERPROFILE%\.roo\rules
```
--------------------------------
### Structure tool directory with environment variables
Source: https://roocodeinc.github.io/Roo-Code/features/experimental/custom-tools
Recommended file structure for a tool directory containing a .env file.
```text
.roo/tools/
├── my-tool.ts
├── .env # Copied to cache dir at load time
└── package.json
```
--------------------------------
### Effective Query Patterns
Source: https://roocodeinc.github.io/Roo-Code/advanced-usage/available-tools/codebase-search
Examples of well-structured search queries focusing on concepts, features, and problems, contrasted with a generic query.
```xml
user authentication and password validation
```
```xml
database connection pool setup
```
```xml
error handling for API requests
```
```xml
function
```
--------------------------------
### Run a simple command
Source: https://roocodeinc.github.io/Roo-Code/advanced-usage/available-tools/execute-command
Executes a basic command in the current working directory.
```xml
npm run dev
```
--------------------------------
### Define When to Use
Source: https://roocodeinc.github.io/Roo-Code/features/custom-modes
Guidance for automated mode selection and task orchestration.
```yaml
whenToUse: This mode is best for refactoring Python code.
```
```json
"whenToUse": "This mode is best for refactoring Python code."
```
--------------------------------
### Preload an Ollama model
Source: https://roocodeinc.github.io/Roo-Code/providers/ollama
Start a model manually in the terminal to avoid cold-start memory spikes during the first request from Roo Code.
```bash
ollama run
```
--------------------------------
### Create Command File
Source: https://roocodeinc.github.io/Roo-Code/advanced-usage/available-tools/run-slash-command
Initialize a new command file within the designated commands directory.
```bash
# Create a deployment command
touch .roo/commands/deploy.md
```
--------------------------------
### Define a custom tool with npm dependencies
Source: https://roocodeinc.github.io/Roo-Code/features/experimental/custom-tools
Example of a custom tool definition using external npm packages like axios.
```typescript
import { parametersSchema as z, defineCustomTool } from "@roo-code/types"
import axios from "axios"
export default defineCustomTool({
name: "fetch_api",
description: "Fetch data from an API endpoint",
parameters: z.object({
url: z.string().describe("API endpoint URL"),
}),
async execute({ url }) {
const response = await axios.get(url)
return JSON.stringify(response.data, null, 2)
},
})
```