Show HN: Aclif – Agent CLI framework: one grammar, canonical names across SaaS

Hacker News by 8 min read 91x views
Show HN: Aclif – Agent CLI framework: one grammar, canonical names across SaaS

Share Post

aclif builds command-line devices for AI agents. An supplier gets a azygous instrumentality that provides a unified abstraction crossed each SaaS provider: 1 grammar, and canonical names that scope the aforesaid grounds by the aforesaid name on immoderate platform.

Try it now

Install the binary, database the providers, and publication a command's schema, examples, and information metadata.

npm instal -g @aclif/core aclif observe --json aclif study salesforce --json aclif study servicenow --json aclif salesforce information query --schema aclif salesforce information query --examples aclif salesforce information query --query "SELECT Id FROM Account LIMIT 3" --dry-run aclif servicenow information query --table incident --query "active=true^priority=1" --dry-run

Getting started GitHub

Why agents request their ain CLI

An MCP server publishes a fixed database of tools, and every tool connected the database occupies the agent's discourse connected each turn. The server's writer trades sum for costs erstwhile the server is built. Publishing each cognition (a emblematic API has hundreds of definitions) keeps the full API reachable and consumes tokens for each of it connected each turn. Publishing a handful of wide operations keeps the token count small, and any cognition the writer near disconnected the database is retired of the agent's reach. An supplier that spans respective platforms needs a server, a login, a grammar, an correction format, and a group of names for each.

aclif loads a command's meaning only erstwhile the agent asks for it, truthful the full API of each supplier is reachable at nary opinionated costs successful context. One grammar, 1 envelope, and 1 correction vocabulary screen each provider, truthful the agent's discourse stays astir the aforesaid size whether it reaches one level aliases five.

An supplier that runs a defined workflow tin time off the model out of the telephone altogether. A personification aliases an authoring tool works retired the nonstop bid astatine creation clip and embeds it in the workflow arsenic a string. At tally clip the supplier executes that drawstring arsenic mean code, pinch nary instrumentality meaning loaded and nary inference. The bid is chosen astatine creation time, and the authority to tally it, the credential, the acting identity, and the policy, is supplied astatine tally clip by whatever runs it. Neither broadside ever holds both.

What each bid gives you

One grammar

One bid structure, 1 JSON envelope, and one correction vocabulary crossed each provider. An supplier learns the instrumentality once, and a caller level adds commands without adding grammar. A JSON manifest adds a bid complete one HTTP endpoint successful the aforesaid grammar, pinch nary code.

Canonical names

Alias sets representation customer to Account successful 1 Salesforce lawsuit and core_company successful ServiceNow. A tenant catalog, captured from each lawsuit astatine deploy time, teaches the CLI each instance's civilization objects and fields pinch nary alteration to the provider.

Errors an supplier tin enactment on

An supplier recovers successful 1 turn. Every correction names the failure, the bid that fixes it, and, wherever the provider's classifier has a rewrite norm for the mistake, the corrected input fresh to resend. The classifier is plain codification pinch nary exemplary down it. A bid validated successful a ammunition astatine creation clip returns the aforesaid correction astatine tally clip nether immoderate host, because the same bid classes tally successful both.

Introspection without execution

--schema, --examples, --shape, and 4 much flags return before the bid runs, request nary credentials, and count against nary API quota. An supplier tin discover, learn, introspect, and preview against a rate-limited lawsuit and spend nothing.

An embeddable runtime

The aforesaid bid classes tally in-process wrong a host that supplies credentials, identity, and argumentation per request, keeps connections warm, and caches expensive logins per instance. A gateway built connected it useful with the enterprise's ain personality supplier and secrets vault.

Declared safety

Mutability, blast radius, reversibility, and idempotency are declared connected each command. A policy check tin garbage it earlier its codification loads. Every mutation accepts --dry-run, demands --confirm wherever its metadata says so, and writes an audit statement aft each run.

The introspection-first workflow

An supplier needs nary archiving beyond the binary, and nothing earlier the past measurement touches the API.

aclif observe --json # each provider, its tier, whether credentials are configured aclif study salesforce --json # a briefing: topics, cardinal fields, query syntax, auth paths aclif salesforce information query --schema # flags, args, information metadata, nary execution aclif salesforce information query --examples # runnable examples pinch the responses they produce aclif salesforce information query --query "SELECT Id, Name FROM Account LIMIT 5" --dry-run aclif salesforce information query --query "SELECT Id, Name FROM Account LIMIT 5" --json

The envelope's _context artifact holds pagination pinch the nonstop adjacent command, the fields available, and related commands worthy running. Exit codes are 0, 1 (API), 2 (usage), 3 (authentication). The contract and its JSON Schemas are in CONTRACT.md.

Three ways to tally it

A vendor CLI is built for 1 deployment: installed connected a machine, logged successful by the personification astatine the keyboard, one process per command. Behind a gateway that fails. Every call spawns a process and logs successful again, the acting user's identity cannot beryllium forwarded, thing declares what a command will do, and thing is azygous to audit. aclif's command classes tally unchanged successful 3 places, and whoever runs them decides who supplies credentials, enforces policy, and keeps the audit trail.

  • Run by the agent. The supplier process spawns the binary, executes the command, and sounds the JSON it returns. Credentials travel from flags, environment variables, aliases a floor plan successful the agent's ain environment. Use this erstwhile 1 agent, 1 operator, and 1 group of credentials stock a spot boundary.
  • Run by a big application, the design-time case. An exertion sits betwixt the exemplary and aclif and holds the credentials. The exemplary calls a tool the exertion defines, and the exertion executes the command, in-process aliases by passing a bid drawstring to the CLI. A personification aliases an authoring instrumentality uses this to fto a exemplary observe providers, introspect commands, and validate the nonstop bid it will constitute into an agent. Use this erstwhile the exemplary must ne'er clasp credentials and instrumentality definitions must enactment retired of its context.
  • Run by a gateway, the runtime case. A deployed supplier submits commands, and 1 long-lived process serves galore specified agents. The gateway resolves credentials from the endeavor vault per request, checks argumentation against the acting user, records each call, and keeps connections warm. The agents clasp nary provider credentials and cannot widen their ain scope. Use this erstwhile galore agents stock providers and 1 spot must hold argumentation and audit.
Run by the agentRun by a host applicationRun by a gateway
Credentialsflags, env, config.yamlhost-supplied resolvervault-backed resolver, per request
Policyconfig.yamlcapabilityGate hookcapabilityGate positive the host's middleware
Identity--identity-token or envthe acting personification connected the invocationthe acting personification and SSO claims from the request
Auditstderr statement per runreporter eventsreporter events, recorded by the host
Connectionsfile convention cacheruntime poolruntime pool, keyed per lawsuit and identity

Details connected the Embedding page.

Gateway deployments

Long-lived, embeddable deployment enables a gateway topology wherever further information argumentation tin beryllium applied. One process the endeavor operates executes each bid for every agent, and the statement provides:

  • Credentials successful 1 place. Resolved wrong the gateway, per request, from the enterprise's vault. Agents clasp none.
  • Enterprise-wide canonical names. Tenant catalogs and othername sets are held by the gateway, so each supplier uses the aforesaid names for the aforesaid records crossed each supplier and instance.
  • Every telephone attributed to a person. The acting user's personality travels pinch each telephone into the argumentation cheque and the audit record, moreover done a shared work account.
  • Policy enforced once. Every command declares what it will do, and the gateway checks that declaration earlier the command's codification loads. Agents cannot widen their ain scope.
  • One audit trail. The aforesaid arena for each bid from each agent, naming the user, the command, and the outcome.

Install, aliases build your own

npm instal -g @aclif/core # Your org's My Domain URL, nary trailing slash export SF_INSTANCE_URL=https://example.my.salesforce.com # A convention token from the Salesforce CLI (sf org login web first if needed) export SF_ACCESS_TOKEN=$(sf org auth show-access-token -o [email protected] --json | jq -r .result.accessToken) aclif salesforce information query --query "SELECT Id, Name FROM Account LIMIT 3" --json

Without the Salesforce CLI, usage an API user. Salesforce emails the information token erstwhile the password is group aliases reset:

export SF_INSTANCE_URL=https://example.my.salesforce.com [email protected] SF_PASSWORD=... SF_SECURITY_TOKEN=... aclif salesforce information query --query "SELECT Id, Name FROM Account LIMIT 3" --json

The aclif binary ships pinch each built-in provider and needs Node 22 aliases later. The binary you vessel is yours: 1 scaffold bid produces a CLI pinch its own name, its ain config directory, its ain environment variables, and only the providers it chose. See Getting started and Build a CLI.

Providers

Salesforce, ServiceNow, DocuSign, and Agentforce are native and are included successful each release. Google Workspace (Gmail, Calendar) is contributed. A backstage tier holds providers a fork keeps to itself, nether a way upstream never commits to. Writing a supplier takes small effort: it is a nonstop translator of the platform's API specification onto the bid surface, a coding supplier does it from a sample punctual successful the repository, and the conformance suite checks the result. See Providers.

aclif is MIT licensed. Contributions follow CONTRIBUTING.md; the guideline for group and coding agents changing the framework is AGENTS.md.

Other Article Hacker News
Close Right Ads
Close Left Ads