Tools
Calliope CLI includes built-in tools for executing shell commands, reading and writing files, code execution, web search, git operations, and more.
Available Tools
| Tool | Description | Use Case |
|---|---|---|
shell | Execute shell commands | Running programs, git, npm, etc. |
read_file | Read file contents | Examining code, configs, logs |
write_file | Create or overwrite files | Creating code, configs, docs |
list_files | List directory contents | Exploring project structure |
think | Chain-of-thought reasoning | Complex problem solving |
execute_code | Sandboxed code execution | Running Python, Node.js, Bash safely |
web_search | Search the web | Finding documentation, solutions |
git | Git operations | Version control tasks |
mermaid | Generate diagrams | Flowcharts, sequence diagrams, ERDs |
Shell Tool
Execute any shell command and receive the output.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
command | string | Yes | The shell command to execute |
Examples
Running a program:
User: Run the tests
Calliope: Let me run the tests.
[shell] $ npm testGit operations:
User: Show me the recent commits
Calliope: I'll check the git history.
[shell] $ git log --oneline -10Checking system state:
User: What's using port 3000?
Calliope: Let me check.
[shell] $ lsof -i :3000Execution Details
- Working directory: Commands run in your current directory
- Shell: Uses bash (or sh if bash unavailable)
- Timeout: 60 seconds by default
- Environment: Inherits your shell environment
Output Handling
- Standard output and errors are combined
- Exit codes are reported for non-zero exits
- Large outputs are truncated for display
Read File Tool
Read the contents of any file.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | Yes | Path to the file (relative or absolute) |
Examples
Reading source code:
User: Show me the main entry point
Calliope: Let me read the main file.
[read_file] src/index.tsChecking configuration:
User: What's in the package.json?
Calliope: I'll check the package configuration.
[read_file] package.jsonLimitations
- Maximum file size: 1 MB
- Binary files: Not supported (use shell with
filecommand to check type) - Path security: Restricted to current directory and home folder
Write File Tool
Create new files or overwrite existing ones.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | Yes | Path for the file |
content | string | Yes | Content to write |
Examples
Creating a new file:
User: Create a config file
Calliope: I'll create a configuration file.
[write_file] config.json
{"port": 3000, "debug": true}Updating code:
User: Add error handling to the API
Calliope: I'll update the API code with error handling.
[write_file] src/api.ts
// Updated content with error handlingBehavior
- Create: Makes new files if they don’t exist
- Overwrite: Replaces existing file contents entirely
- Directories: Creates parent directories if needed
- Path security: Restricted to current directory and home folder
List Files Tool
List the contents of a directory.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | No | Directory to list (default: current) |
recursive | boolean | No | List subdirectories (default: false) |
Examples
List current directory:
User: What files are here?
Calliope: Let me list the files.
[list_files]
π src/
π tests/
π package.json
π README.mdList with recursion:
User: Show me the full project structure
Calliope: I'll list all files recursively.
[list_files] recursive=true
π src/
π index.ts
π components/
π Button.tsx
π Form.tsx
...Limitations
- Max depth: 5 levels for recursive listing
- Max entries: 100 files per directory
- Hidden files: Excluded from recursive listings
Think Tool
Structured chain-of-thought reasoning for complex problems.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
thought | string | Yes | Reasoning and thought process |
Purpose
The think tool allows Calliope to:
- Break down complex problems into steps
- Reason through trade-offs before making decisions
- Plan multi-step operations before executing
- Document reasoning in the conversation
Examples
Planning a refactor:
User: Refactor this monolith into microservices
Calliope: This is a complex task. Let me think through it.
[think] I need to:
1. Identify bounded contexts in the existing code
2. Map dependencies between modules
3. Design service boundaries
4. Plan the data migration strategy
5. Create an incremental migration planDebugging:
User: The app crashes on startup
Calliope: Let me analyze the possible causes.
[think] Potential causes:
- Missing environment variables
- Database connection failure
- Port already in use
- Missing dependencies
I'll check each of these systematically.When It’s Used
Calliope automatically uses the think tool when:
- Facing complex, multi-step tasks
- Needing to compare multiple approaches
- Planning before executing destructive operations
- Debugging non-obvious issues
Path Security
All file operations are restricted to safe directories:
Allowed Paths
- Current working directory and subdirectories
- Home directory (
~) and subdirectories
Blocked Paths
- System directories (
/etc,/usr,/var, etc.) - Other users’ directories
- Path traversal attempts (
../../../etc/passwd)
Example
User: Read /etc/passwd
Calliope: Error: Access denied - /etc/passwd is outside allowed directoriesTool Permissions
Normal Mode
In normal mode, you’ll see tool calls before they execute:
[shell] $ rm -rf node_modules
Execute? (y/n)God Mode
In god mode (-g flag), tools execute without confirmation:
calliope -gTimeouts
| Tool | Default Timeout |
|---|---|
| shell | 60 seconds |
| read_file | 10 seconds |
| write_file | 10 seconds |
| list_files | 10 seconds |
| think | (instant) |
Long-running shell commands will timeout:
[shell] $ npm install
Error: Command timed out after 60 secondsFor longer operations, the AI may need to run commands differently or in chunks.
Execute Code Tool
Run code in a sandboxed environment using Docker (when available).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
language | string | Yes | Programming language (python, node, bash) |
code | string | Yes | The code to execute |
Supported Languages
- Python - Full Python 3 environment
- Node.js - JavaScript/TypeScript runtime
- Bash - Shell scripts
Examples
Running Python:
User: Calculate the first 10 Fibonacci numbers
Calliope: I'll execute that in Python.
[execute_code] python
def fib(n):
a, b = 0, 1
result = []
for _ in range(n):
result.append(a)
a, b = b, a + b
return result
print(fib(10))Running Node.js:
User: Parse this JSON and extract names
Calliope: I'll process that with Node.js.
[execute_code] node
const data = [{"name": "Alice"}, {"name": "Bob"}];
console.log(data.map(d => d.name).join(", "));Sandbox Details
When Docker is available:
- Code runs in isolated containers
- Resource limits enforced (memory, CPU)
- Timeout protection
- Network isolation (configurable)
- Working directory mounted read-only
When Docker is unavailable:
- Falls back to local execution
- Shows
[unsandboxed]warning - Still applies timeout limits
Web Search Tool
Search the web for information and documentation.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Search query |
num_results | number | No | Number of results (default: 5) |
Examples
Finding documentation:
User: How do I use React hooks?
Calliope: Let me search for that.
[web_search] "React hooks tutorial"Debugging errors:
User: I'm getting ECONNREFUSED on port 3000
Calliope: Let me look that up.
[web_search] "ECONNREFUSED port 3000 Node.js"Notes
- Results include titles, URLs, and snippets
- Useful for finding current documentation
- Can help debug unfamiliar error messages
Git Tool
Perform common Git operations safely.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
operation | string | Yes | Git operation to perform |
args | string | No | Additional arguments |
Supported Operations
| Operation | Description |
|---|---|
status | Show working tree status |
diff | Show changes (staged and unstaged) |
log | View commit history |
branch | List or create branches |
add | Stage files for commit |
commit | Create a commit |
push | Push to remote |
pull | Pull from remote |
stash | Stash changes |
Examples
Check status:
User: What's the git status?
Calliope: Let me check.
[git] statusView recent commits:
User: Show me the last 5 commits
Calliope: I'll check the history.
[git] log --oneline -5Stage and commit:
User: Commit these changes
Calliope: I'll stage and commit the files.
[git] add .
[git] commit -m "Add new feature"Safety
- Dangerous operations (force push, hard reset) require confirmation
- Read-only operations (status, diff, log) execute immediately
- Working directory must be a git repository
Mermaid Tool
Generate diagrams using Mermaid syntax.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Diagram type |
content | string | Yes | Mermaid diagram content |
title | string | No | Optional diagram title |
Supported Diagram Types
| Type | Description |
|---|---|
flowchart | Process flows and decision trees |
sequence | Interaction sequences |
class | Class diagrams (UML) |
state | State machine diagrams |
er | Entity-relationship diagrams |
gantt | Gantt charts |
pie | Pie charts |
Examples
Flowchart:
User: Create a flowchart for user login
Calliope: I'll generate that diagram.
[mermaid] flowchart
flowchart TD
A[Start] --> B{Has account?}
B -->|Yes| C[Enter credentials]
B -->|No| D[Sign up]
C --> E{Valid?}
E -->|Yes| F[Dashboard]
E -->|No| CSequence diagram:
User: Show the API request flow
Calliope: Here's a sequence diagram.
[mermaid] sequence
sequenceDiagram
Client->>API: POST /login
API->>DB: Query user
DB-->>API: User data
API-->>Client: JWT tokenOutput
Diagrams are rendered as:
- ASCII preview in terminal
- SVG/PNG file saved to disk (optional)
- Mermaid code for embedding in documentation
Parallel Tool Execution
Calliope automatically parallelizes independent tool calls for better performance.
How It Works
- Dependency Analysis - Calliope analyzes which tools depend on each other
- Grouping - Independent operations are grouped together
- Parallel Execution - Groups execute simultaneously
- Sequential Fallback - Dependent operations wait for prerequisites
Example
When asked to “check the project status”, Calliope might run in parallel:
git statusnpm testread_file package.json
This provides 2-5x speedup compared to sequential execution.
Visualization
During parallel execution, you’ll see:
[Executing 3 tools in parallel]
βββ [git] status
βββ [shell] npm test
βββ [read_file] package.jsonRisk Assessment
All tool operations are classified by risk level:
| Level | Description | Examples |
|---|---|---|
| none | Read-only, no side effects | list_files, read_file |
| low | Safe information gathering | git status, npm list |
| medium | Modifiable but recoverable | git add, npm install |
| high | Potentially destructive | rm, git push, chmod |
| critical | System-level danger | sudo, dd, format |
Higher-risk operations trigger confirmation prompts (unless god-mode is enabled).