Metadata-Version: 2.5
Name: fastaxi
Version: 0.1.0
Summary: Build AXI (Agent eXperience Interface) CLIs from typed Python functions
Project-URL: Homepage, https://github.com/nerd-smith/fastaxi
Author-email: Nerd Smith <32527006+nerd-smith@users.noreply.github.com>
License-Expression: MIT
License-File: LICENSE.md
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Framework :: Pydantic
Classifier: Framework :: Pydantic :: 2
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Internet
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# fastaxi

Build [AXI](https://axi.md) (Agent eXperience Interface) command-line tools from typed Python
functions.

**Documentation: [nerd-smith.github.io/fastaxi](https://nerd-smith.github.io/fastaxi/)**

AXI is a set of principles for CLIs that AI agents use: compact output, a few fields by
default, totals and next-step hints, explicit empty states, structured errors and a live home
view. With fastaxi you write ordinary functions that return Pydantic models, and it takes care
of all of that. The same commands can also be handed to agent frameworks (PydanticAI,
LangChain, the OpenAI Agents SDK, ...) as tools.

## Install

```
uv add fastaxi
```

fastaxi needs Python 3.10 or later.

## Example

```python
from typing import Annotated

from pydantic import BaseModel

from fastaxi import AXI, Default

app = AXI("todo-axi", description="Track todos for the current project")


class Todo(BaseModel):
    id: Annotated[int, Default]  # shown in lists by default
    title: Annotated[str, Default]
    status: Annotated[str, Default]
    assignee: str | None = None  # available with --fields


@app.command(name="list", next_steps=["{bin} view <id>"])
def list_todos(status: str = "open") -> list[Todo]:
    """List todos.

    Args:
        status: Filter by status.
    """
    return db.query(status)
```

```
$ todo-axi list
id,title,status
41,Fix login redirect,open
42,"Write docs, examples",open
count: 2 of 2 total
help[1]: todo-axi view <id>

$ todo-axi list --state done
error: unknown flag --state
hint: did you mean --status?
flags[3]: "--status","--fields","--format"
```

A complete version lives in [examples/todo_axi](examples/todo_axi).

## Learn more

- [Quickstart](https://nerd-smith.github.io/fastaxi/quickstart/): a complete small tool, and
  how to run it.
- [Building AXIs](https://nerd-smith.github.io/fastaxi/building-axis/): return types, output,
  flags, errors and help text.
- [Connecting to coding agents](https://nerd-smith.github.io/fastaxi/coding-agents/): session
  hooks and Agent Skills for Claude Code, Codex and OpenCode.
- [Agent-framework tools](https://nerd-smith.github.io/fastaxi/tools/): the same commands as
  PydanticAI, LangChain or OpenAI Agents SDK tools.
- [API reference](https://nerd-smith.github.io/fastaxi/reference/)

## Development

See [Development](https://nerd-smith.github.io/fastaxi/development/) for setup, tests and
conventions. To preview the docs locally:

```
uv run --group docs mkdocs serve
```
