Skip to main content

Agent First Interface — scaffold CLI, MCP, and HTTP interfaces for agent-first tools.

Project description

afi-cli

Agent First Interface — scaffold tools whose primary consumer is an AI agent, not a human.

From a single source of truth, afi-cli generates three interface surfaces, each shaped by a different agent-ergonomic principle:

  • CLI — with a learn affordance so an agent can introspect the tool and author its own usage skill (not just read --help).
  • MCP server — a deliberately minimal menu, tuned for low surface area over maximal API coverage.
  • HTTP site — markdown pages plus a sitemap, navigable by any agent with a fetch tool.

Part of the AgentCulture OSS org — see docs/agentculture.md for the org, its paradigm, and how afi-cli is foundational to it. The design brief is in docs/agent-first.md; the concrete rubric that afi cli verify enforces is in docs/rubric.md.

Install

uv tool install afi-cli

Then afi --version should work on your PATH. uv tool install is the supported path — not pip install.

Usage

Every afi command supports --json where it produces a listing or report, and respects the exit-code policy (0 success / 1 user error / 2 env error).

Introspect

afi learn                         # structured self-teaching prompt for an agent
afi learn --json                  # same, as a JSON payload
afi explain cli cite              # markdown docs for any noun/verb path
afi explain afi                   # top-level map

CLI scaffolding

afi cli cite [path]               # emit the agent-first reference tree into
                                  # <path>/.afi/reference/python-cli/ (tokens left literal,
                                  # adds `.afi/` to .gitignore)
afi cli verify [path]             # audit a CLI at <path> against the five-bundle rubric
afi cli verify . --json           # full structured report
afi cli verify . --strict         # treat warnings as failures

afi cli cite writes only under .afi/ plus one line in .gitignore — it never modifies the rest of the target project. The emitted tree has literal {{project_name}}, {{slug}}, {{module}} tokens; an agent reads the accompanying AGENT.md and applies the pattern to the host project on its own terms.

afi cli verify is a hybrid auditor: static checks for repo structure (pyproject.toml, tests/) and black-box subprocess probes for behavior (learn, --json, error discipline, explain). Every failure includes a concrete remediation pointer.

MCP / HTTP

Not implemented yet. Planned for v0.4 / v0.5.

Develop

uv sync                          # install + dev deps
uv run pytest -n auto -v         # tests (includes the self-verify acceptance gate)
uv run afi cli verify .          # same gate, interactive
uv run pre-commit install        # enable lint hooks

The tests/test_self_verify.py acceptance gate runs the rubric in-process against the repo root; any regression that breaks a bundle blocks the commit.

See CLAUDE.md for design intent and full command reference.

License

MIT. © 2026 Ori Nachum / AgentCulture.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

afi_cli-0.5.0.tar.gz (115.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

afi_cli-0.5.0-py3-none-any.whl (68.9 kB view details)

Uploaded Python 3

File details

Details for the file afi_cli-0.5.0.tar.gz.

File metadata

  • Download URL: afi_cli-0.5.0.tar.gz
  • Upload date:
  • Size: 115.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for afi_cli-0.5.0.tar.gz
Algorithm Hash digest
SHA256 21276f48ed9cd6e738fec7d0b9465f613ef7141240994359e06bab6d7a9c705a
MD5 016dcc8979516bb7ec97f6d53e9b8f04
BLAKE2b-256 db2edc92231301b5dbaa59dd375393d078cc1507f3222cbfedb6f41f1005f3c8

See more details on using hashes here.

File details

Details for the file afi_cli-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: afi_cli-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 68.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for afi_cli-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a3eea3efbcc3ec741fba56cb3fc0702c93cc5f49d3d07d303e1949fc2590f30a
MD5 9060597a6aff8e4dd424ece0e82a76fd
BLAKE2b-256 8d3872410241d3929615ccf55ed441673b460a88c4a94ad92c6710ae864a55b5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page