apix is a CLI tool for importing, browsing, searching, and calling API endpoint documents stored as local markdown vaults.
Before using apix, verify if it is installed:
apix --version
If it is not installed, install it using Homebrew (macOS/Linux):
brew tap apix-sh/tap
brew install apix
Or via the curl installer:
curl -fsSL https://apix.sh/install | sh
When an API task is requested, follow this general workflow:
```bash
apix search "create pet"
# Or list available APIs: apix ls
```
```bash
apix peek petstore/v1/pets/{petId}/GET
```
_Note: Only use apix show if you need the full, detailed documentation, as it can be long._
```bash
apix call demo/v1/items/{id}/POST -p id=item_123 -d '{"name":"item"}'
```
apix search apix lsapix ls / (e.g., apix ls petstore/v1)apix grep Routes follow the format: (e.g., petstore/v1/pets/GET).
apix peek — Outputs the YAML frontmatter and condensed required input fields.apix show — Outputs the full markdown documentation for the route or type.apix call automatically resolves the URL, method, and auth requirements from the route's markdown frontmatter.
```bash
apix call demo/v1/items/item_123/GET
```
_(apix automatically maps item_123 to the {id} parameter if the defined route is demo/v1/items/{id}/GET)_
```bash
apix call demo/v1/items/{id}/POST \
-p id=item_123 \
-q expand=full \
-H "Authorization: Bearer
-d '{"name":"item"}'
```
-p = : Path parameter-q = : Query parameter-H ": " : HTTP Header-d '' or -d @file.json: Request bodyIf the required API is not in the public registry, you can import an OpenAPI 3.x spec locally:
apix import /path/to/openapi.json --name myapi
apix commands via the shell, it detects that stdout is piped and will automatically emit raw markdown, which is perfectly structured for you to read.apix routes are standard strings. If a route matches multiple sources, apix will throw an ambiguity error. In that case, prefix the route with the source (e.g., core/petstore/v1/pets/GET).peek over show to avoid flooding your context window with redundant schemas.共 1 个版本