Build agent-native Python CLIs with progressive discovery
Project description
pypith
Decorator-based library for building agent-native Python CLIs with progressive discovery.
- Define commands with
@app.command()and attach intents and hints - Auto-generated
pithdiscovery subcommand with tiers 0-3 - Built-in core schema, rendering, and optional semantic search
- Schema export compatible with
pypith-cli
Installation
pip install pypith
# With semantic search support
pip install pypith[semantic]
Quick Start
from pith import Pith, Argument, Option
from pathlib import Path
app = Pith(name="fileops", pith="File manipulation utilities")
@app.command()
@app.intents("copy files", "duplicate", "backup files")
def copy(
src: Path = Argument(..., pith="Source file or directory"),
dest: Path = Argument(..., pith="Destination path"),
recursive: bool = Option(False, "-r", "--recursive", pith="Copy directories recursively"),
):
"""Copy files or directories to a destination."""
import shutil
if src.is_dir() and recursive:
shutil.copytree(src, dest)
else:
shutil.copy2(src, dest)
if __name__ == "__main__":
app.run()
Core Module
The library includes the core schema and rendering utilities:
from pith.core import PithSchema, Command, Tier1, Tier2, Tier3
from pith.core import render_tier0, build_run_line, search_commands
Project details
Release history Release notifications | RSS feed
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 pypith-0.1.2.tar.gz.
File metadata
- Download URL: pypith-0.1.2.tar.gz
- Upload date:
- Size: 18.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5efef8c892fcd5e2c9a636ca0466d93ec6916b51343637bfa0bf6bbbb5050ff
|
|
| MD5 |
e72c646390b63b06990d685daaa0bd81
|
|
| BLAKE2b-256 |
ba7f52661763779b8b2e0cf99da6db20b7b17497db91110a715774e072d37017
|
Provenance
The following attestation bundles were made for pypith-0.1.2.tar.gz:
Publisher:
release.yml on ThomasRohde/pith
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pypith-0.1.2.tar.gz -
Subject digest:
b5efef8c892fcd5e2c9a636ca0466d93ec6916b51343637bfa0bf6bbbb5050ff - Sigstore transparency entry: 748366222
- Sigstore integration time:
-
Permalink:
ThomasRohde/pith@6df8591e8938d0445ea4b8978fff7144119da2d8 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/ThomasRohde
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6df8591e8938d0445ea4b8978fff7144119da2d8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pypith-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pypith-0.1.2-py3-none-any.whl
- Upload date:
- Size: 24.0 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 |
37693e9f6c354bbbe4e769e10fb727e19bdc45eaf031b7459ea4dfbd4562fdb5
|
|
| MD5 |
6b6c36c8cd37126faf8ceaa60f09ac2b
|
|
| BLAKE2b-256 |
ad98ef2ba7a55a28e2239b973a6ae16d4685769d73013bba497b30f85e6b6ab4
|
Provenance
The following attestation bundles were made for pypith-0.1.2-py3-none-any.whl:
Publisher:
release.yml on ThomasRohde/pith
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pypith-0.1.2-py3-none-any.whl -
Subject digest:
37693e9f6c354bbbe4e769e10fb727e19bdc45eaf031b7459ea4dfbd4562fdb5 - Sigstore transparency entry: 748366241
- Sigstore integration time:
-
Permalink:
ThomasRohde/pith@6df8591e8938d0445ea4b8978fff7144119da2d8 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/ThomasRohde
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6df8591e8938d0445ea4b8978fff7144119da2d8 -
Trigger Event:
push
-
Statement type: