Files
AIPass/src/aipass/cli
d7f2587465 feat(cli): 100% seedgo compliance — all 24 standards (#66)
* fix(ai_mail): resolve relative mailbox_path bug + archive dead handlers

Fix get_user_by_email() and get_all_users() returning relative mailbox_path
values from registry instead of absolute paths (causing doubled paths in reply).
Added path resolution matching get_current_user() pattern.

Archive 7 unused handler files to apps/.archive/ (gitignored):
- pending_work.py — planned feature, never wired
- lock_utils.py — superseded by inbox_lock.py
- data_ops.py — consumer (error_monitor) was archived
- config_generator.py, users/load.py, registry/validate.py — scaffolded, never used
- trigger/error_handler.py — superseded by trigger branch's event system

Added test_user_paths.py (13 tests) covering absolute path resolution.

Co-Authored-By: @ai_mail <ai_mail@aipass>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(cli): achieve 100% seedgo compliance across all 24 standards

Clean up json_handler (remove prax dependency, use portable Path resolution),
wire json_handler into display.py, templates.py, and init_project.py using
module import pattern. Restructure handle_command() with seedgo-compliant
no-args introspection gate. Update README with init commands and architecture.

Co-Authored-By: @cli <cli@aipass>

---------

Co-authored-by: @ai_mail <ai_mail@aipass>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: @cli <cli@aipass>
2026-03-17 16:44:37 -07:00
..
2026-03-07 22:13:52 +00:00
2026-03-06 20:40:16 +00:00

CLI

Purpose: Display and output formatting service for AIPass modules. Provides consistent terminal output — headers, success/error/warning messages, section breaks, and operation templates — so every module looks the same without duplicating Rich formatting code. Module: aipass.cli Last Updated: 2026-03-17

Usage

from aipass.cli import header, success, error, warning, section

header("Creating Branch", {"Name": "feature", "Type": "module"})
success("Files created", items=12, time="2.3s")
error("Path not found", suggestion="Check spelling")
warning("Config missing, using defaults")
section("Results")

Operation Templates

from aipass.cli import operation_start, operation_complete

operation_start("Processing", count=10)
# ... do work ...
operation_complete(created=5, skipped=3, failed=0)

Direct Console Access

from aipass.cli import console

console.print("[bold cyan]Custom Rich output[/bold cyan]")

Architecture

cli/
├── apps/
│   ├── cli.py                  # Entry point
│   ├── modules/
│   │   ├── display.py          # header, success, error, warning, section
│   │   ├── templates.py        # operation_start, operation_complete
│   │   └── init_project.py     # aipass init command routing
│   └── handlers/
│       ├── init/               # Project bootstrap logic
│       │   └── bootstrap.py
│       └── json/               # JSON file management
│           └── json_handler.py
├── cli_json/                   # Auto-created JSON output (three-file pattern)
├── dropbox/                    # Inbound file drop
├── logs/                       # Branch-level logs
└── tests/
  • apps/modules/ — Public API. Import from here.
  • apps/handlers/ — Internal implementation. Don't import directly.

Commands / Usage

drone @cli --help                        # Show services and Rich formatting showcase
drone @cli --version                     # Show version
drone @cli help                          # Same as --help
drone @cli aipass                        # Show aipass subcommands
drone @cli aipass init                   # Bootstrap AIPass project in current dir
drone @cli aipass init /path             # Bootstrap in target directory
drone @cli aipass init /path MyProject   # Bootstrap with custom name
drone @cli aipass init --help            # Detailed init usage

Integration Points

Depends On

  • aipass.prax — Logging via system_logger
  • rich — Rich library for terminal formatting (Table, Panel, Columns, Text)
  • Python stdlib (sys, importlib, pathlib)

Provides To

  • All modules — display formatting (headers, success/error/warning, section breaks)
  • All modules — operation templates (operation_start, operation_complete)
  • All modules — Rich console access
  • All users — aipass init project bootstrap command

Last Updated: 2026-03-17