Everything you need to get up and running with A Nice Terminal.
Run ANT directly with npx -- no global install required:
npx a-nice-terminal Or install globally:
npm install -g a-nice-terminal
ant ANT starts a local server on $ANT_HOST:$ANT_PORT (defaults to localhost:3000).
Configure ANT with environment variables or a .env file:
# Server configuration
ANT_PORT=3000 # Server port (default: 3000)
ANT_HOST=localhost # Bind address (default: localhost)
ANT_API_KEY=mySecret # Optional API key for authentication
# Client configuration (set in .env)
VITE_ANT_API_KEY=mySecret # Must match ANT_API_KEY ANT_PORT default: 3000The port ANT listens on.
ANT_HOST default: localhostBind address. Set to 0.0.0.0 to listen on all interfaces (e.g. for Tailscale access).
ANT_API_KEY optionalWhen set, all REST and WebSocket requests must include this key via X-API-Key header or Socket.IO auth.
VITE_ANT_API_KEY optionalClient-side API key. Must match ANT_API_KEY if set.
ANT provides real shell access via PTY sessions. It is designed for local or trusted-network use only.
ANT binds to localhost by default. Connections from other hosts are rejected unless you change ANT_HOST.
Set ANT_API_KEY to require authentication on all endpoints. Requests without a valid key receive a 401 response.
For secure remote access (e.g. from your phone), use Tailscale to create a private network. Set ANT_HOST=0.0.0.0 and use your Tailscale IP to connect.
All endpoints are available at /api.
Responses are JSON.
/api/sessionsList all sessions (terminal and conversation).
/api/sessionsCreate a new session.
{
"type": "terminal" | "conversation",
"name": "My Session"
}/api/sessions/:idGet a single session by ID.
/api/sessions/:idUpdate a session (e.g. rename it).
{
"name": "New Name"
}/api/sessions/:idDelete a session and all its messages.
/api/sessions/:id/messagesList all messages in a conversation session.
/api/sessions/:id/messagesSend a message to a conversation session.
{
"role": "human" | "agent" | "system",
"content": "Hello from my agent!"
}/api/sessions/:id/messages/:messageIdDelete a specific message.
Connect via Socket.IO for real-time updates.
errorGeneric error event emitted for invalid payloads, type mismatches, or access failures.
join_sessionJoin a room for a session ID. Terminal sessions also initialise PTY streams.
session_joinedServer confirms a successful room join and returns session type.
terminal_inputWrite input to a terminal session.
terminal_resizeResize a terminal PTY.
{ "cols": 120, "rows": 40 }terminal_outputServer-side terminal stream output for a session.
stream_chunkEmit partial message content for a conversation message.
stream_endFinalise streaming and persist the final message content.
message_created / message_updated / message_deletedConversation message lifecycle events emitted to active session rooms.
ANT includes a Model Context Protocol (MCP) server that exposes terminal and conversation capabilities to any MCP-compatible AI client.
Add the ANT MCP server to your client configuration:
{
"mcpServers": {
"ant": {
"command": "npx",
"args": ["-y", "@ant/mcp"]
}
}
} The MCP server exposes tools for session management, message sending, and terminal interaction. Your AI client can use these to: