CLI for Aegro agricultural management API
Project description
Aegro CLI
Command-line interface for the Aegro agricultural management API.
Install
# pipx (recommended)
pipx install aegro
# uv
uv tool install aegro
# Homebrew (macOS)
brew tap aegro/tap
brew install aegro
# Windows — pipx (recommended)
pipx install aegro
# Windows — uv
uv tool install aegro
# Windows — pip
pip install aegro
Credentials are stored in
%LOCALAPPDATA%\aegro\.
WSL: Inside WSL, follow the Linux instructions. WSL and Windows credentials are stored separately — do not mix installations.
OneDrive/Dropbox: Avoid pointing
AEGRO_CONFIG_DIRto cloud-synced folders, as file locking may cause intermittent errors.
For development:
git clone https://github.com/aegro/tool-aegro-cli.git
cd tool-aegro-cli
uv sync
uv run aegro --help
Quick Start
# 1. Authenticate
aegro auth login --farm-name "Fazenda Sul" --api-key "aegro_abc123..."
# 2. Select a farm
aegro farms list
aegro farms select "Fazenda Sul"
# 3. Start working
aegro crops list --start-date 2025-01-01 --end-date 2025-12-31
aegro financial installments --status PENDING
aegro stock items --output table
Commands
| Group | Commands | Domain |
|---|---|---|
auth |
login, status, logout | Authentication |
farms |
list, select, info | Farm management |
crops |
get, list, prorate, harvest-discounts, prorates, glebes | Harvest management |
activities |
get, list, plan, realizations, get-plan, get-realization, create-plan | Activity planning |
financial |
bill, installment, installments, create/update/delete-installment, realize | Accounts payable/receivable |
stock |
item, location, items, locations, logs, log, transfer, entry, removal | Inventory |
elements |
get, list, create-defensive/fertilizer/item/seed/service, set-categories | Inputs/supplies |
assets |
get, list, create-machine/vehicle/garner/immobilized/pivot/weather-station | Equipment |
fuel-supplies |
get, list, create, update | Fuel management |
maintenances |
get, list, create, update | Maintenance records |
harvest-logs |
get, create | Harvest records |
bank-accounts |
get, list, create | Bank accounts |
companies |
get, list, create | Suppliers/vendors |
fin-categories |
get, list, create, subcategories | Chart of accounts |
catalogs |
list, element-keys, elements | Catalog lookups |
tags |
get, list, create | Tags/labels |
weather |
get, create | Weather data |
purchase-orders |
get, list, create | Purchase orders |
glebes |
get, list | Farm fields |
crop-glebes |
get, list | Crop fields |
Output Formats
All commands support three output formats:
aegro crops list --output json # JSON (default, for LLMs/scripts)
aegro crops list --output table # Rich table for humans
aegro crops list --output csv # CSV export
Usage Examples
Human workflow
# Morning overview
aegro farms select "Fazenda Norte"
aegro crops list --output table
aegro financial installments --status PENDING --due-date-start 2025-03-01 --output table
aegro stock items --output table
# Register a fuel supply
aegro fuel-supplies create --asset-key K --date 2025-03-13 --quantity 150 --unit L --cost 900
# Check harvest
aegro harvest-logs get <key>
LLM/Agent workflow
# Agents use JSON output (default) for structured data
aegro crops list --start-date 2025-01-01 --end-date 2025-12-31
aegro activities list --crop-key <key>
aegro stock items
aegro financial installments --status PENDING
AI Skills
The project includes guided workflows for AI assistants in .claude/skills/:
Domain skills (personas)
| Skill | Purpose |
|---|---|
aegro-agronomo |
Agronomic domain — crops, fields, activities, harvests, weather, inputs |
aegro-estoquista |
Stock domain — items, locations, movements, catalogs, elements |
aegro-financeiro |
Financial domain — bills, installments, categories, bank accounts, companies |
aegro-operacional |
Operational domain — farms, auth, tags, cross-domain orchestration |
aegro-patrimonial |
Asset domain — machines, vehicles, fuel supplies, maintenances |
Workflow skills
| Skill | Purpose |
|---|---|
aegro-visao-geral |
Farm overview dashboard |
aegro-fechamento-safra |
Crop season closing checklist |
aegro-lancamento-financeiro |
Financial entry guide |
aegro-reconciliacao-estoque |
Stock reconciliation |
aegro-monitoramento-pragas |
Pest monitoring |
aegro-analise-rentabilidade |
Profitability analysis |
aegro-cadastro-patrimonio |
Asset registration |
Configuration
Authentication
Credential resolution priority:
AEGRO_FARMSenv var (JSON) — for CI/CD and scriptsAEGRO_FARMS_FILEenv var (path) — for Docker/K8s secrets- Config directory (
~/.config/aegro/on Linux,~/Library/Application Support/aegro/on macOS,%LOCALAPPDATA%\aegro\on Windows) — interactive setup viaaegro auth login
# Option 1: Environment variable
export AEGRO_FARMS='{"Fazenda Norte": "aegro_key1", "Fazenda Sul": "aegro_key2"}'
# Option 2: Interactive login (saves to OS-native config directory)
aegro auth login --farm-name "Fazenda Norte" --api-key "aegro_key1"
Environment Variables
| Variable | Default | Purpose |
|---|---|---|
AEGRO_API_BASE_URL |
https://app.aegro.com.br |
Aegro API base URL |
AEGRO_FARMS |
— | JSON map of farm name → API key |
AEGRO_FARMS_FILE |
— | Path to JSON credentials file |
AEGRO_CONFIG_DIR |
— | Override config directory path |
Development
# Install dependencies
uv sync
# Run tests
uv run pytest -v
# Lint
uv run ruff check aegro/ tests/
# Format
uv run ruff format aegro/ tests/
Links
- Aegro — Agricultural management platform
- Typer — CLI framework
- PyPI: aegro — Package page
License
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aegro-0.4.0.tar.gz.
File metadata
- Download URL: aegro-0.4.0.tar.gz
- Upload date:
- Size: 78.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ac6683ce711b5d8892b0b396eae2cfa7a04842a27e0317bd175d694189fa636
|
|
| MD5 |
48d367023f4907afb11ba50440110e55
|
|
| BLAKE2b-256 |
8d223c15dea16c64e5d195973ffadb3496e1e80bff61dc81e9eb7e18e242402b
|
Provenance
The following attestation bundles were made for aegro-0.4.0.tar.gz:
Publisher:
publish.yml on aegro/tool-aegro-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aegro-0.4.0.tar.gz -
Subject digest:
1ac6683ce711b5d8892b0b396eae2cfa7a04842a27e0317bd175d694189fa636 - Sigstore transparency entry: 1123806126
- Sigstore integration time:
-
Permalink:
aegro/tool-aegro-cli@f78a296f45965bef449211a32f8a41658a2582dc -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/aegro
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f78a296f45965bef449211a32f8a41658a2582dc -
Trigger Event:
push
-
Statement type:
File details
Details for the file aegro-0.4.0-py3-none-any.whl.
File metadata
- Download URL: aegro-0.4.0-py3-none-any.whl
- Upload date:
- Size: 91.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5997c148157ddc67992ddd773d685c7f2b8b60a1134d56e0e63045b30ba5e81
|
|
| MD5 |
bb7622b15c721de38b4acfd54e6b71fb
|
|
| BLAKE2b-256 |
39cc907934f3cc18e4970aab2499f24b183e209251aa659b3a9acbd8df5af13a
|
Provenance
The following attestation bundles were made for aegro-0.4.0-py3-none-any.whl:
Publisher:
publish.yml on aegro/tool-aegro-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aegro-0.4.0-py3-none-any.whl -
Subject digest:
c5997c148157ddc67992ddd773d685c7f2b8b60a1134d56e0e63045b30ba5e81 - Sigstore transparency entry: 1123806189
- Sigstore integration time:
-
Permalink:
aegro/tool-aegro-cli@f78a296f45965bef449211a32f8a41658a2582dc -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/aegro
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f78a296f45965bef449211a32f8a41658a2582dc -
Trigger Event:
push
-
Statement type: