ag-bash

v6.0.4
io.github.sairam0424/ag-bash Checked 3 days ago Published 5 months ago

Sandboxed AI-native bash with 70 agentic tools: run_bash, code edit/diff, WASM Python/JS.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

run_bash

Run a bash script in a persistent sandboxed environment. State (cwd, variables, functions) persists between calls.

ParameterTypeDescription
script *stringThe bash script to execute.

get_state

Retrieve the current state of the shell (CWD and Environment Variables).

snapshot

Capture a complete binary snapshot of the current shell state (filesystem + environment).

restore

Restore the shell to a previously captured state via a snapshot.

ParameterTypeDescription
snapshot *stringThe base64 encoded snapshot state to restore.

create_delta

Create a differential delta between a base snapshot and current state for efficient sync.

ParameterTypeDescription
baseSnapshot *stringThe base64 encoded base snapshot.

apply_delta

Apply a differential delta to the current shell state.

ParameterTypeDescription
delta *stringThe base64 encoded delta to apply.

fork_speculate

Fork-speculation: copy-on-write branch the sandbox into N isolated children, run a candidate script sequence in each branch in parallel, and report each branch's output + exit code so you can pick a winner. Branch mutations (env, cwd, files) are invisible to the persistent shell and to each other. Optionally pass keepWinner to commit exactly one winning branch's scripts onto the persistent shell; otherwise the persistent shell is left untouched (all branches discarded).

ParameterTypeDescription
branches *arrayCandidate branches to try. Each branch is an array of bash scripts run in order within its own isolated fork.
keepWinnernumberOptional 0-based index of the branch to commit onto the persistent shell. Omit to keep none (pure speculation).

search_tools

Discover which agentic tools are available for a free-text task description (Code Mode). Returns the best-matching tools by relevance so an agent can pick a tool without pre-loading the full catalog.

ParameterTypeDescription
query *stringFree-text description of the task or capability you need.
limitnumberMaximum number of matches to return (1-25, default 5).

add_todo

Add a new todo item.

ParameterTypeDescription
task *stringThe task description.
statusstringInitial status.

ag_convert

Convert documents (PDF, Docx, Xlsx) and images to Markdown with AI-powered visual intelligence and OCR.

ParameterTypeDescription
filePath *stringPath to the file to convert.
describeImagesbooleanUse AI to describe images (default: false).
enginestringEngine override (default: auto).
highFidelitybooleanFavor precision over speed (default: false).
llmModelstringSpecific model for vision tasks.
llmProviderstringLLM provider for vision tasks.
visionModestringPrompt template for image analysis.
visionPromptstringCustom vision prompt (overrides visionMode).

ag_edit

Advanced line-based file editor. Supports multiple non-contiguous edits in a single call and protects against stale writes using content hashes.

ParameterTypeDescription
edits *stringList of edits to apply sequentially.
filePath *stringAbsolute path to the file to edit.
expectedHashstringThe expected SHA-256 hash of the file content before applying edits. If it doesn't match, the edit will fail.

ag_explain

Parse and explain a shell command string, showing its structure and components.

ParameterTypeDescription
command *stringThe shell command string to explain.

ag_find_files

Find files by name or glob pattern recursively.

ParameterTypeDescription
pattern *stringThe filename or glob pattern to search for.
pathstringThe directory to start searching from (default: current directory).

ag_find_symbol

Search for symbols (functions, variables, classes) by name or pattern across the workspace.

ParameterTypeDescription
query *stringThe symbol name or search pattern.
typestringFilter by symbol type.

ag_grep

High-performance recursive pattern search within files.

ParameterTypeDescription
query *stringThe pattern or string to search for.
ignoreCasebooleanWhether to ignore case when searching.
pathstringThe directory or file to search in (default: current directory).

ag_hover

Get semantic information about a symbol at a specific line and character position.

ParameterTypeDescription
character *number1-indexed character position.
filePath *stringPath to the file containing the symbol.
line *number1-indexed line number.

ag_lsp

Advanced code intelligence: goToDefinition, findReferences, hover, etc.

ParameterTypeDescription
filePath *stringPath to the file.
operation *stringThe LSP operation to perform.
characternumber1-based character position.
linenumber1-based line number.
symbolNamestringName of the symbol (optional if position is provided).

ag_multi_edit

Apply multiple non-contiguous text replacements to a file in a single operation.

ParameterTypeDescription
chunks *stringList of replacement chunks.
path *stringAbsolute path to the file to edit.

ag_todo

Manage project tasks and todos. Support for listing, adding, updating, and removing tasks.

ParameterTypeDescription
operation *stringThe operation to perform.
idstringThe todo ID (required for 'update' and 'rm').
statusstringThe status to set (required for 'update').
taskstringThe task description (required for 'add').

ag_web_fetch

Fetch the content of a web page and convert it to clean markdown. Results are cached for 15 minutes.

ParameterTypeDescription
url *stringThe URL of the page to fetch.
noCachebooleanIf true, bypass the cache and fetch fresh content.

agent_memory_read

Read a memory entry for an agent type.

ParameterTypeDescription
agentType *stringAgent type identifier.
key *stringMemory key.
scope *stringMemory scope: user, project, or local.

agent_memory_write

Write a memory entry for an agent type.

ParameterTypeDescription
agentType *stringAgent type identifier.
key *stringMemory key.
scope *stringMemory scope: user, project, or local.
value *stringMemory value.

analyze_code

Perform semantic analysis on a source file.

ParameterTypeDescription
path *stringAbsolute path to the file to analyze.

check_destructive

Check if a command contains destructive patterns (rm -rf, DROP TABLE, git reset --hard, etc.). Returns warning or null.

ParameterTypeDescription
command *stringThe command to analyze for destructive patterns.

check_environment

Get diagnostics about the sandboxed environment.

close_session

Terminate a persistent session and release its resources.

ParameterTypeDescription
sessionId *stringThe ID of the session to close.

cron_create

Schedule a recurring or one-shot prompt using a cron expression.

ParameterTypeDescription
cron *string5-field cron expression (e.g., "*/5 * * * *").
prompt *stringThe prompt/command to run at each fire time.
durablebooleanTrue = persisted, false = session-only (default).
recurringbooleanTrue = repeating (default), false = one-shot.

cron_delete

Delete a scheduled cron job.

ParameterTypeDescription
id *stringThe cron job ID to delete.

cron_list

List all scheduled cron jobs.

diff_files

Generate a unified diff between two files.

ParameterTypeDescription
file1 *stringPath to the first file.
file2 *stringPath to the second file.

edit_file

Apply a text patch to a file (simple find and replace).

ParameterTypeDescription
path *stringAbsolute path to the file to edit.
replacement *stringThe new text to insert instead.
target *stringThe exact text block to be replaced.
replace_allbooleanIf true, replaces all occurrences instead of just the first one.

enter_worktree

Create and enter an isolated virtual worktree for independent development.

ParameterTypeDescription
name *stringWorktree name.
branchstringBranch name (default: worktree/<name>).

exit_worktree

Exit the active worktree and restore the original working directory.

explain_command

Parse and explain a shell command.

ParameterTypeDescription
command *stringThe shell command to explain.

find_files

Search for files by name or glob pattern.

ParameterTypeDescription
path *stringThe directory to start searching from.
pattern *stringThe filename pattern or glob (e.g., '*.ts').

find_symbols

Search for symbols (functions, variables) across the workspace.

ParameterTypeDescription
querystringQuery to filter symbol names.

get_definition

Find the definition of a symbol.

ParameterTypeDescription
name *stringThe name of the symbol to find.

get_references

Find all references to a function or variable.

ParameterTypeDescription
characternumber1-based character position
linenumber1-based line number
namestringThe name of the symbol to find
pathstringPath to the file where the symbol is referenced

git_audit_log

Get the git operations audit log, optionally filtered to destructive operations only.

ParameterTypeDescription
destructiveOnlybooleanIf true, return only destructive operations.

git_track

Record and classify a git operation. Returns classification (safe/mutating/destructive) and audit entry.

ParameterTypeDescription
command *stringThe git command to classify and record.

glob_files

Fast glob pattern matching over the filesystem. Returns matching file paths sorted by name or mtime.

ParameterTypeDescription
pattern *stringGlob pattern (e.g., "**/*.ts", "src/**/*.{ts,tsx}").
limitnumberMax results (default: 1000).
pathstringRoot directory (default: cwd).
sortstring"alpha" (default) or "mtime".

help_builtin

Get detailed help for a shell builtin command.

ParameterTypeDescription
command *stringThe name of the builtin command.

hover_info

Get information about a symbol at a specific position.

ParameterTypeDescription
character *number1-based character position
line *number1-based line number
path *stringPath to the file

index_workspace

Trigger a full scan and indexing of all supported files in the workspace.

ParameterTypeDescription
pathstringRoot directory to scan. Defaults to /.

list_dir

List contents of a directory.

ParameterTypeDescription
path *stringAbsolute path to the directory to list.

list_mcp_tools

List all tools available via connected MCP servers.

list_todos

List all todo items.

plan_enter

Enter plan mode to design an approach before making changes.

plan_exit

Exit plan mode and return to execution mode.

query_json

Run a jq query against a JSON file or string.

ParameterTypeDescription
query *stringThe jq filter/query string.
jsonstringOptional JSON string to query directly.
pathstringOptional path to a JSON file to query.

read_file

Read the contents of a file from the virtual filesystem.

ParameterTypeDescription
path *stringAbsolute path to the file to read.

run_command

Execute a shell command in the sandbox.

ParameterTypeDescription
command *stringThe shell command to execute.

run_js

Execute JavaScript code in the sandbox. For persistent state, use run_js_session.

ParameterTypeDescription
code *stringThe JS code to execute.

run_js_session

Execute JavaScript code in a persistent session (stateful REPL). Maintains variables and modules between calls.

ParameterTypeDescription
code *stringThe JS code to execute.
sessionId *stringSession identifier (e.g., 'main', 'test').

run_python

Execute Python code in the sandbox. For persistent state, use run_python_session.

ParameterTypeDescription
code *stringThe Python code to execute.

run_python_session

Execute Python code in a persistent session (stateful REPL). Maintains variables and imports between calls.

ParameterTypeDescription
code *stringThe Python code to execute.
sessionId *stringSession identifier (e.g., 'data-analysis').

search_tools

Search for available tools by keyword, or select by exact name with 'select:Name1,Name2'.

ParameterTypeDescription
query *stringKeyword query or "select:Name1,Name2" for exact lookup.
limitnumberMax results (default: 10).

send_message

Send a message from one agent to another.

ParameterTypeDescription
content *stringMessage content.
from *stringSender agent ID.
to *stringRecipient agent ID.

sync_mcp_tools

Synchronize and register all MCP tools into the central toolbox.

task_create

Create a new tracked task with subject, description, owner, and progress text.

ParameterTypeDescription
description *stringWhat needs to be done.
subject *stringBrief title for the task.
activeFormstringSpinner text when in_progress (e.g., "Running tests").
ownerstringAgent ID that owns this task.

task_get

Get full details of a specific task by ID.

ParameterTypeDescription
taskId *stringThe task ID.

task_list

List all tracked tasks, optionally filtered by status or owner.

ParameterTypeDescription
ownerstringFilter by owner agent ID.
statusstringFilter by status.

task_stop

Stop (fail) a running task.

ParameterTypeDescription
taskId *stringThe task ID to stop.

task_update

Update a task's status, subject, description, owner, or dependencies.

ParameterTypeDescription
taskId *stringThe task ID to update.
addBlockedBystringTask IDs that block this task.
addBlocksstringTask IDs that this task blocks.
descriptionstringNew description.
ownerstringNew owner agent ID.
statusstringNew status: pending, in_progress, completed, failed, blocked.
subjectstringNew subject.

team_create

Create a new agent team for coordinated multi-agent work.

ParameterTypeDescription
name *stringTeam name.
descriptionstringTeam purpose.

team_delete

Delete an agent team.

ParameterTypeDescription
name *stringTeam name or ID.

update_todo

Update the status of a todo item.

ParameterTypeDescription
id *stringThe ID of the todo to update.
status *stringNew status.

write_file

Create or overwrite a file in the virtual filesystem.

ParameterTypeDescription
content *stringThe content to write to the file.
path *stringAbsolute path to the file to write.