| name | aiase-cli-first |
| description | CLI-first architecture principle for AI-era software — why all business logic must be reachable via CLI/headless interfaces before adding UI; how Skill/MCP/A2A/CLI map to OS IPC primitives; Agentic OS concept and UI decoupling. Load when designing software architecture, choosing interface layers, discussing agent interoperability, or asking why GUI-first apps fail in agentic pipelines. |
CLI-First Architecture
"CLI 才是未來 Programming 的核心溝通介面"
— 莊坤達教授, AIASE 2026 W1
Core Principle
Every piece of business logic must be callable from CLI before any UI is added.
UI is just one more interface on top — not the product itself. In an agentic world, the callers are agents, not humans, so the interface must be machine-composable.
Business Logic
└── CLI / API ← agents call here
└── MCP wrapper ← optional discovery layer
└── GUI / Web ← optional for humans
Why this order matters: if you build GUI-first, your logic is entangled in event handlers and cannot be composed by agents without re-writing it.
The OS Analogy (Agentic OS)
Every "new" agent communication pattern maps directly to OS IPC primitives:
| Agentic term | OS concept | When to use |
|---|
| Skill / Extension | Shared-memory function call (intra-process) | Same process, deterministic — default choice |
| MCP tool | IPC / local socket (inter-process, same machine) | Separate process, needs isolation or reusability across agents |
| A2A protocol | Network service (RPC, REST) | Different organizations / cross-machine |
| CLI agent | Shell fork / exec | Spawning a sub-process to do a bounded task |
The naming chaos is temporary — every vendor is racing to claim "Agentic OS." Underneath, it's all process communication you already know.
Why CLI-First for AI-Readable Code
- AI agents call CLI natively. Claude Code, Codex, any agent harness can invoke
command arg1 arg2 without additional glue.
- Composability by pipes.
generate | review | commit is a multi-agent pipeline without orchestration framework.
- No coordinate-system mismatch. GUI click targets break between OS versions, resolutions, themes. CLI args are stable.
- Headless = free. No display server, no browser, no human in the loop.
Design Checklist
Before writing any UI, verify:
Anti-Patterns
GUI-first trap: Building a rich dashboard before the underlying operations are CLI-accessible. Agents cannot drive this; every integration requires a browser driver or screen scraper.
MCP-first over-engineering: Wrapping everything in MCP before validating the core logic works as a plain function. Start with Skill (intra-process call), promote to MCP only when cross-process isolation is needed.
UI as the spec: Designing workflows by sketching screens. Design workflows as command sequences; screens are a rendering of those sequences.
Agentic OS Convergence
The OS is being redesigned for agent-native workloads:
- Kernel / Runtime → agent execution harness (Claude Code, Codex CLI)
- Process → any agent (LLM-backed or deterministic)
- IPC → Skill / MCP / A2A depending on boundary
- Memory → context window, with same pressure as RAM — manage it consciously
- Fork → spawn sub-agent
Future OS courses will include agentic primitives. Engineers who understand this mapping navigate tool proliferation without being confused by marketing names.
Practical Starting Point
myapp init --config ./config.json
myapp run --input data.csv --output result.json
myapp validate --schema schema.json result.json
Build the CLI. Test it. Then (optionally) wrap it in MCP so agents can discover it. Then (optionally) build a UI for humans who need one.
References
- AIASE 2026 W1 live archive: CLI as core interface (01:41–01:48)
- AIASE 2026 W8 live archive: Agentic OS concept, IPC mapping (00:51–01:12, 01:35–01:44)
- AIASE 2026 W4 live archive: autoresearch / gstack CLI-first design (01:35–02:05)
See also: [[aiase-harness]] for harness structure that enforces CLI-first, [[aiase-sdd]] for spec writing before adding interfaces, [[aiase-multi-agent]] for the full 4-layer agentic stack.