Show HN: Aclif – Agent CLI framework: one grammar, canonical names across SaaS
Aclif: The Unified Agent CLI Framework
Aclif is a specialized framework designed to construct command-line interfaces specifically for AI agents. Rather than forcing an agent to learn a dozen different APIs, Aclif provides a single, unified abstraction across all SaaS providers. This means one consistent grammar and canonical names that ensure the same record is accessed by the same name, regardless of the underlying platform.
🚀 Quick Start
You can begin exploring Aclif by installing the binary and utilizing the discovery and learning commands:
# Install the core framework
npm install -g @aclif/core
# Explore available providers
aclif discover --json
# Learn about specific platform capabilities
aclif learn salesforce --json
aclif learn servicenow --json
# Introspect a specific command
aclif salesforce data query --schema
aclif salesforce data query --examples
# Execute with a safety check
aclif salesforce data query --query "SELECT Id FROM Account LIMIT 3" --dry-run
aclif servicenow data query --table incident --query "active=true^priority=1" --dry-run
🧠 Why Agents Need a Dedicated CLI
Traditional MCP (Model Context Protocol) servers publish a static list of tools. This creates a significant trade-off for the developer:
The Coverage vs. Cost Dilemma: If a server publishes every single API operation (which can number in the hundreds), the agent's context window is flooded, consuming massive amounts of tokens on every single turn. Conversely, if the author only publishes a few broad tools to save tokens, the agent loses access to the full power of the API.
Aclif solves this by loading command definitions on-demand.
Context Efficiency
In a standard MCP setup, the token cost is: With Aclif, the cost is reduced to:
By utilizing one grammar, one envelope, and one error vocabulary, the agent's context remains stable whether it is interacting with one SaaS platform or five.
Workflow Optimization
For predefined workflows, the LLM can be bypassed entirely. A developer can embed a specific command string into a workflow at design time. At runtime, the agent executes this string as standard code—no inference required—meaning no tool definitions are loaded and no tokens are spent on decision-making.
🛠️ Core Capabilities
1. Unified Grammar & Canonicalization
Aclif ensures that adding a new platform doesn't mean learning a new language.
| Feature | Description | Benefit |
|---|---|---|
| One Grammar | Unified JSON envelope and error vocabulary. | Agents learn the tool once; new platforms are "plug-and-play." |
| Canonical Names | Alias sets map Customer Account (Salesforce) core_company (ServiceNow). | Consistent naming across disparate data models. |
| Tenant Catalog | Captures custom objects/fields at deployment. | Supports instance-specific customizations without provider changes. |
2. Advanced Introspection
Agents can "study" a command before executing it. Using flags like --schema, --examples, and --shape, an agent can:
- Discover capabilities.
- Learn syntax.
- Preview responses.
- All without consuming API quotas or requiring active credentials.
3. Declared Safety
Every command includes explicit metadata regarding its impact:
- Mutability: Is it a read or write operation?
- Blast Radius: How much data is affected?
- Reversibility & Idempotency: Can it be undone or repeated safely?
Safety Mechanisms:
-
--dry-run: Validates the command without executing changes. -
--confirm: Mandatory prompt for high-risk mutations. - Audit Logging: Every execution writes a permanent audit line.
🏗️ Architecture & Runtime
Aclif's command classes are embeddable, allowing them to run in-process within a host that manages identity and policy.
Three Deployment Models
- Direct Binary: The agent spawns the binary and reads the JSON output. Credentials are provided via environment variables or flags. Best for: Single operator/agent trust boundaries.
- Application-Mediated: An app sits between the model and Aclif. The model calls a tool, and the app executes the Aclif command. Best for: Keeping credentials away from the LLM and reducing context load.
- Deployed Gateway: A long-lived process serves as a centralized hub, integrating with enterprise identity providers and secrets vaults to maintain warm connections and cached logins.
🔄 The Introspection-First Workflow
The agent follows a logical path from discovery to execution:
aclif discover --jsonIdentify available providers.aclif learn [provider] --jsonUnderstand topics and auth paths.aclif [provider] [cmd] --schemaCheck flags and safety metadata.aclif [provider] [cmd] --examplesSee expected input/output.aclif [provider] [cmd] --dry-runValidate the specific query.aclif [provider] [cmd] --jsonFinal execution.
The resulting JSON envelope includes a _context block, providing pagination details, available fields, and suggestions for the next logical command.