Template name (e.g. coder, assistant, researcher). If omitted, displays an interactive picker.
Behavior:
Templates are discovered from:
Repository agents/ directory (dev builds)
~/.openfang/agents/ (installed)
OPENFANG_AGENTS_DIR (environment override)
Each template is a directory containing an agent.toml manifest
In daemon mode: sends POST /api/agents with the manifest (agent is persistent)
In standalone mode: boots an in-process kernel (agent is ephemeral)
Example:
$ openfang agent new Select an agent template: > coder - Code generation and review assistant - General-purpose assistant researcher - Web research and analysis writer - Content creation analyst - Data analysis Use ↑↓ to navigate, Enter to select, Esc to cancel
Agents spawned in daemon mode persist across restarts. Agents spawned in standalone mode are ephemeral.
$ openfang agent list Active Agents ID NAME STATE PROVIDER MODEL a1b2c3d4-e5f6-7890-abcd-ef1234567890 coder idle anthropic claude-sonnet-4 e5f6g7h8-i9j0-k1l2-m3n4-o5p6q7r8s9t0 assistant processing groq llama-3.3-70b i9j0k1l2-m3n4-o5p6-q7r8-s9t0u1v2w3x4 researcher idle gemini gemini-2.5-flash Total: 3 agents
Example Output (In-Process Mode):
$ openfang agent list Active Agents (in-process kernel) ID NAME STATE CREATED a1b2c3d4-e5f6-7890-abcd-ef1234567890 coder idle 2025-03-06 10:30:15 Total: 1 agent hint: This agent is ephemeral. Start daemon for persistence: openfang start
Start an interactive chat session with a specific agent.
openfang agent chat <AGENT_ID>
Arguments:
Argument
Description
<AGENT_ID>
Agent UUID (obtain from openfang agent list)
Behavior:
Opens a REPL-style chat loop
Type messages at the you> prompt
Agent responses display at the agent> prompt
Shows token usage and iteration count after each response
Type exit, quit, or press Ctrl+C to end the session
Example Session:
$ openfang agent chat a1b2c3d4-e5f6-7890-abcd-ef1234567890 Chat with: coder Type 'exit' or 'quit' to end. Press Ctrl+C to interrupt.you> Write a function to calculate Fibonacci numbersagent> Here's an efficient implementation using dynamic programming:```pythondef fibonacci(n): if n <= 1: return n a, b = 0, 1 for _ in range(2, n + 1): a, b = b, a + b return b
This runs in O(n) time and O(1) space.[tokens: 245 | iterations: 1]you> Now optimize it with memoizationagent> Here’s the memoized version:
from functools import lru_cache@lru_cache(maxsize=None)def fibonacci(n): if n <= 1: return n return fibonacci(n-1) + fibonacci(n-2)
<Note> Chat sessions support multi-turn conversations with full context retention.</Note>### Quick Chat ShortcutFor convenience, you can use `openfang chat` as a shortcut:```bash# Chat with the default agentopenfang chat# Chat with a specific agent by nameopenfang chat coder# Chat with a specific agent by UUIDopenfang chat a1b2c3d4-e5f6-7890-abcd-ef1234567890
Modify agent properties (currently supports model changes).
openfang agent set <AGENT_ID> <FIELD> <VALUE>
Arguments:
Argument
Description
<AGENT_ID>
Agent UUID
<FIELD>
Field to set (currently only model)
<VALUE>
New value
Example:
# Switch agent to a different model$ openfang agent set a1b2c3d4 model gpt-4o[ok] Updated agent model to: gpt-4o# Verify the change$ openfang agent list ID NAME STATE PROVIDER MODEL a1b2c3d4... coder idle openai gpt-4o
$ openfang sessions coder Sessions for: coder SESSION ID STARTED MESSAGES LAST ACTIVITY s1a2b3c4-d5e6-f7g8-h9i0-j1k2l3m4n5o6 2025-03-06 10:30 45 2 hours ago s2b3c4d5-e6f7-g8h9-i0j1-k2l3m4n5o6p7 2025-03-05 14:20 12 1 day ago Total: 2 sessions
All Sessions:
$ openfang sessions All Sessions AGENT SESSION ID STARTED MESSAGES coder s1a2b3c4... 2025-03-06 10:30 45 coder s2b3c4d5... 2025-03-05 14:20 12 assistant s3c4d5e6... 2025-03-06 09:15 23 Total: 3 sessions