Internal dev CLI
Terminal-local Agentastic automation commands for agents and in-app shells
Overview#
The internal dev CLI is injected into terminals opened inside Agentastic. It gives agents and users terminal-local control over the app: notifications, panes, sessions, browser tabs, scheduled tasks, and repository packing. Worktree commands use the same JSON-RPC implementation as the system-wide CLI.
This CLI is not installed globally. Agentastic creates a temporary shim directory, prepends it to PATH, and injects context for the current terminal.
Injected context#
Agentastic terminals receive environment variables like:
| Variable | Purpose |
|---|---|
AGENTASTIC_TERMINAL_ID | The owning terminal session ID |
AGENTASTIC_SOCKET_PATH | Local Unix socket for JSON-RPC requests |
AGENTASTIC_BROWSER_ID | Current browser tab ID, when a browser tab is active |
AGENTASTIC_APP_INSTANCE_ID | Running app instance ID |
AGENTASTIC_APP_BUNDLE_PATH | App bundle path for URL-scheme fallbacks |
AGENTASTIC_SHIM_DIR | Temporary directory containing the injected shims |
The internal CLI uses this context to route commands to the right window, worktree, terminal, and browser tab.
Terminal control#
Use terminal commands to create tabs, split panes, and address sessions:
dev newtab
dev split
dev vsplit
dev hsplit
dev resume
dev ls
dev remote sessions
dev remote kill <session_id>
dev remote sessions close --orphansFor scripts that need an addressable pane, create a session split:
dev session split output --vertical
dev session run --session <session_id> "npm test"
dev session focus <session_id>
dev session close --session <session_id>dev split creates a pane near the current terminal. dev session split output also prints the new session ID so a script or agent can run commands in it later.
Remote SSH session commands are forwarded to the system-wide dev shim from
inside Agentastic terminals. They list server-side Remote SSH PTYs and can kill
individual sessions or orphaned sessions that no longer have matching local app
state.
Notifications#
Agents can use dev notify to surface state through Agentastic's notification system:
dev notify --title "Need approval" \
--subtitle "auth-codex" \
--body "The migration changes two existing columns."
dev notify --clearFor simple messages, dev notify "Need approval" "The migration changes two existing columns." is also accepted.
Notifications are tied to the terminal/worktree context, retained in the
durable inbox, and shown with a pane attention ring until the terminal actually
receives focus or the item is marked read. dev notify returns only after its
inbox mutation is durably committed.
Agent display names#
Set the sidebar name for the current agent directly from its terminal:
dev agent rename "Checkout reviewer"
dev agent rename --clear
# Backward-compatible aliases:
dev rename "Checkout reviewer"
dev rename --clearYou can also target another open agent with --worktree <path> or
--terminal <id>. An explicit selector takes precedence over the current
terminal's workspace, including when the target is in another open workspace.
If the selector exists in more than one workspace window, add
--workspace <workspace_id> to disambiguate it. This is a display-only
setting: the Git branch, worktree directory, terminal, and underlying agent
process are never renamed.
Worktrees#
Worktree commands are handled by Agentastic over JSON-RPC, using the same bundled client and command syntax as the system-wide CLI:
dev list
dev create checkout-flow main
dev status /absolute/path/to/checkout-flow
dev open /absolute/path/to/checkout-flow
dev remove /absolute/path/to/checkout-flow falseThe app owns branch and worktree creation, status, activation, and removal. The old terminal-only git backend and its .agentastic/ metadata commands have been removed, so commands such as dev matrix, dev archive, dev snapshot, and dev link are no longer part of this CLI.
dev rename is a backward-compatible alias for canonical dev agent rename.
It updates the persisted agent display name only; it does not move the
worktree directory or rename the branch. Use dev rename --clear to restore
the directory-based name.
dev cd <worktree-name> remains a shell-local convenience because an external process cannot change its parent shell's working directory.
Browser automation#
dev browser controls Agentastic's built-in browser over the local socket:
dev browser list
dev browser navigate "http://localhost:3000"
dev browser wait load
dev browser snapshot
dev browser click "@e5"
dev browser fill "input[name=email]" "user@example.com"
dev browser console errors
dev browser screenshot -o ./screenshot.pngUse this when an agent needs to verify UI behavior, inspect console errors, test forms, or capture screenshots without leaving the terminal.
See Browser CLI Reference for the full command surface.
Repomix#
dev repomix packs repository context for AI consumption:
dev repomix
dev repomix --style markdown --editor
dev repomix --include "CodeEdit/Features/IPC/**,CodeEdit/ShellIntegration/**"
dev repomix --ignore "Tests/**" --max-tokens 128000 --copy
dev repomix --stdoutIt can write to a file, print to stdout, copy to the clipboard, or open the output in an editor tab.
Scheduled tasks#
dev task manages Agentastic scheduled tasks:
dev task list
dev task history
dev task run <task-id>
dev task pause <task-id>
dev task resume <task-id>
dev task delete <task-id>Create tasks from the terminal:
dev task create \
--name "Nightly tests" \
--command "npm test" \
--schedule daily \
--hour 2 \
--minute 0See Task CLI Reference for schedule formats.
Sidebar agent tasks#
Submit work directly to the Agent sidebar without opening a terminal UI:
dev agent task "Fix the failing checkout test"
dev agent task --agent codex --model o3 "Review this worktree"The injected workspace and worktree identifiers keep the new chat attached to the caller's active worktree. Each generated session ID creates a parallel tab. An explicit UUID continues an open tab or creates a tab with that ID when it is unknown:
dev agent submit --session <uuid> "Run the focused test again"The response acknowledges that the task was queued. Its created field means
the request reserved a new tab; provider/model validation and agent launch
complete asynchronously and surface errors inside that chat.
Use dev agent task --help for provider, model, thinking-level, run-mode, and
working-directory options.
Internal vs system-wide#
Internal dev | System-wide dev | |
|---|---|---|
| Where it runs | Agentastic terminals | Any terminal or local process |
| Targeting | Current terminal/worktree/browser context | Discovered app instance, or --instance |
| Setup | Automatic shell integration | Install from Agentastic -> Install Shell Integration |
| Best for | Agents controlling their own workspace | Users, scripts, schedulers, bots, and external controllers |
| Extra context | AGENTASTIC_TERMINAL_ID, AGENTASTIC_BROWSER_ID, current worktree | Instance registry and JSON output |
Use the internal CLI when an agent is operating from inside Agentastic. Use the system-wide dev CLI when something outside the app needs to launch, inspect, or message agents.
Troubleshooting#
dev: browser script not foundordev: repomix script not found- restart the Agentastic terminal so the shim directory is recreated.AGENTASTIC_SOCKET_PATH is not set- the command is not running in an Agentastic-injected terminal. Use the system-wide CLI or open a new Agentastic terminal.- Browser commands target the wrong tab - pass
--browser-id <id>or rundev browser listto inspect tabs. - A worktree path is not found - use
dev listto get the absolute path known to the active Agentastic workspace, then pass that path todev status,dev open, ordev remove.