-
Notifications
You must be signed in to change notification settings - Fork 0
Available Tools
andershsueh edited this page Feb 10, 2026
·
2 revisions
Complete reference for all 7 builtin tools in ALICE.
Read the contents of a file.
| Parameter | Type | Required | Description |
|---|---|---|---|
path |
string | ✅ | File path (relative or absolute) |
encoding |
string | ❌ | File encoding (default: utf-8) |
-
utf-8/utf8(default) asciibase64
# Simple file read
> You: What's in package.json?
[📄 readFile] Reading package.json...
[✅ readFile] Success (1024 bytes)
# Specific file with path
> You: Show me the README
[📄 readFile] Reading README.md...
[✅ readFile] Success (5000 bytes){
"success": true,
"data": {
"path": "package.json",
"content": "{ \"name\": \"alice-cli\" ... }",
"size": 1024,
"encoding": "utf-8"
}
}- File not found
- Permission denied
- Invalid encoding
List files and directories in a directory.
| Parameter | Type | Required | Description |
|---|---|---|---|
directory |
string | ❌ | Directory path (default: .) |
detailed |
boolean | ❌ | Include size & timestamps (default: false) |
# List current directory
> You: What files are here?
[📁 listFiles] Scanning .
[✅ listFiles] Found 23 items (16 files, 7 directories)
# List specific directory with details
> You: Show me files in src/ with details
[📁 listFiles] Scanning src/ with details
[✅ listFiles] Complete{
"success": true,
"data": {
"directory": ".",
"total": 23,
"files": 16,
"directories": 7,
"items": [
{
"name": "package.json",
"type": "file",
"size": 1024, // if detailed=true
"modified": "2026-02-10T12:00:00Z" // if detailed=true
},
{
"name": "src",
"type": "directory"
}
]
}
}Search for files using glob patterns.
| Parameter | Type | Required | Description |
|---|---|---|---|
pattern |
string | ✅ | Glob pattern (e.g., **/*.ts) |
directory |
string | ❌ | Search root (default: .) |
ignore |
string[] | ❌ | Patterns to ignore |
-
*.js- All JS files in current directory -
**/*.ts- All TS files recursively -
src/**/*.tsx- All TSX files in src/ -
**/*.{js,ts}- All JS and TS files -
!**/node_modules/**- Exclude node_modules
Automatically ignored:
node_modules/**.git/**dist/**
# Find TypeScript files
> You: How many TypeScript files are there?
[🔍 searchFiles] Searching **/*.ts
[✅ searchFiles] Found 25 files
# Find in specific directory
> You: Find all markdown files in docs/
[🔍 searchFiles] Searching docs/**/*.md
[✅ searchFiles] Found 8 files{
"success": true,
"data": {
"pattern": "**/*.ts",
"directory": ".",
"count": 25,
"files": [
"src/index.ts",
"src/core/llm.ts",
...
]
}
}Get the current working directory.
None.
> You: Where am I?
[📂 getCurrentDirectory] Getting current directory
[✅ getCurrentDirectory] Success
Alice: You're in D:\projects\Alice
Platform: Windows (win32){
"success": true,
"data": {
"path": "D:\\projects\\Alice",
"platform": "win32" // or "darwin" (macOS) or "linux"
}
}Get information about the Git repository.
| Parameter | Type | Required | Description |
|---|---|---|---|
directory |
string | ❌ | Git repo path (default: .) |
> You: What branch am I on?
[🌿 getGitInfo] Fetching Git information
[✅ getGitInfo] Success
Alice: You're on the "master" branch.
You have 3 uncommitted changes.
> You: Show me recent commits
[🌿 getGitInfo] Fetching Git information
[✅ getGitInfo] Success
Alice: Recent commits:
- eba23ee: docs: add v0.2.0 release notes (2 hours ago)
- a65ad43: chore: prepare for v0.2.0 release (3 hours ago){
"success": true,
"data": {
"currentBranch": "master",
"branches": ["master", "develop", "feature/tools"],
"status": {
"modified": ["src/cli/app.tsx"],
"created": ["src/tools/newTool.ts"],
"deleted": [],
"staged": ["README.md"],
"ahead": 2,
"behind": 0
},
"remotes": [
{
"name": "origin",
"url": "https://github.com/AndersHsueh/Alice.git"
}
],
"recentCommits": [
{
"hash": "eba23ee",
"message": "docs: add v0.2.0 release notes",
"author": "Anders",
"date": "2026-02-10T12:00:00Z"
}
]
}
}- Not a Git repository
- Git not installed
Get the current date and time with timezone information.
None.
> You: What time is it?
[⏰ getCurrentDateTime] Getting current time
[✅ getCurrentDateTime] Success
Alice: It's currently 10:15 PM, Tuesday, February 10, 2026.
Timezone: Asia/Shanghai (UTC+8)
> You: What's today's date?
[⏰ getCurrentDateTime] Getting current time
[✅ getCurrentDateTime] Success
Alice: Today is February 10, 2026, Tuesday.{
"success": true,
"data": {
"iso8601": "2026-02-10T14:15:30.123Z",
"local": "2026/2/10 22:15:30",
"unix": 1770730530,
"timezone": "Asia/Shanghai",
"platform": "win32",
"date": {
"year": 2026,
"month": 2,
"day": 10,
"weekday": "星期二"
},
"time": {
"hour": 22,
"minute": 15,
"second": 30
}
}
}Execute system shell commands.
| Parameter | Type | Required | Description |
|---|---|---|---|
command |
string | ✅ | Command to execute |
cwd |
string | ❌ | Working directory (default: current) |
timeout |
number | ❌ | Timeout in ms (default: 30000) |
The following patterns trigger confirmation:
-
rm -rf/del /s- Recursive deletion -
format- Disk formatting -
dd if=- Direct disk operations -
shutdown/reboot- System power -
mkfs- Filesystem formatting - Fork bombs and similar
> You: Show me the current directory listing
[🔧 executeCommand] Executing: ls -la
[✅ executeCommand] Command completed
Alice: Here's the directory listing:
total 156
drwxr-xr-x 10 user staff 320 Feb 10 22:15 .
drwxr-xr-x 20 user staff 640 Feb 10 12:00 ..
-rw-r--r-- 1 user staff 1024 Feb 10 22:15 package.json
...> You: Delete the node_modules folder
[🔧 executeCommand] Preparing: rm -rf node_modules
┌─────────────────────────────────────┐
│ ⚠️ Dangerous Command Warning │
│ │
│ Command: rm -rf node_modules │
│ │
│ This command may cause data loss. │
│ │
│ Confirm execution? (y/N): y │
│ │
│ Tip: Set "dangerous_cmd": false │
│ in settings to skip confirmation │
└─────────────────────────────────────┘
[🔧 executeCommand] Executing...
[✅ executeCommand] Command completed
Alice: node_modules has been deleted.
Run 'npm install' to reinstall dependencies.| Platform | Shell | Example |
|---|---|---|
| Windows | PowerShell | Get-ChildItem |
| macOS | Bash | ls -la |
| Linux | Bash | ls -la |
{
"success": true,
"data": {
"command": "ls -la",
"stdout": "total 156\ndrwxr-xr-x ...",
"stderr": "",
"exitCode": 0,
"platform": "darwin"
}
}- Command not found
- Permission denied
- Timeout (> 30 seconds)
- Exit code non-zero
- Confirmation Dialog - Required for dangerous commands
- Timeout Protection - Max 30 seconds
- Platform Detection - Uses appropriate shell
- Error Handling - Captures and reports errors
- Configurable - Can disable confirmations
Learn more about dangerous commands →
| Tool | Read | Write | Search | Execute |
|---|---|---|---|---|
| readFile | ✅ | ❌ | ❌ | ❌ |
| listFiles | ✅ | ❌ | ❌ | ❌ |
| searchFiles | ✅ | ❌ | ✅ | ❌ |
| getCurrentDirectory | ✅ | ❌ | ❌ | ❌ |
| getGitInfo | ✅ | ❌ | ❌ | ❌ |
| getCurrentDateTime | ✅ | ❌ | ❌ | ❌ |
| executeCommand | ✅ | ✅ | ✅ | ✅ |
{ // Skip dangerous command confirmation "dangerous_cmd": false }