Build and publish CMDOP skills
Project description
cmdop-skill
Build and publish CMDOP skills.
Install
pip install cmdop-skill
Quick Start
Scaffold a new skill
cmdop-skill init
Interactive wizard: name (with PyPI availability check), description, author.
Or write from scratch
from cmdop_skill import Skill, Arg
skill = Skill() # name, version, description from pyproject.toml
@skill.command
async def greet(name: str = Arg(help="Who to greet", required=True)) -> dict:
"""Say hello."""
return {"message": f"Hello, {name}!"}
if __name__ == "__main__":
skill.run()
Skill() auto-resolves name, version, description from the nearest pyproject.toml. Explicit arguments still win.
Core Features
| Feature | Description |
|---|---|
@skill.command |
Turn async/sync functions into CLI subcommands |
Arg() |
Declarative arguments: help, required, default, choices, nargs, action |
@skill.setup / @skill.teardown |
Lifecycle hooks (run before/after every command) |
SkillCache |
Typed disk cache with TTL, scoped per skill — docs |
TestClient |
Test harness: client.run("cmd", key=val) / client.run_cli("cmd --flag") |
| JSON output | All commands return {"ok": true, ...} — exit 0 on success, exit 1 on error |
Auto src/ path |
src/ added to sys.path automatically |
| Single source of truth | name, version, description from pyproject.toml, no duplication |
SkillCache
Built-in typed disk cache — no extra dependencies, platform-aware paths:
from cmdop_skill import SkillCache
cache = SkillCache("my-skill")
cache.set("data", payload, ttl=86400) # 24 hours
data = cache.get("data") # None if missing or expired
Paths: ~/Library/Caches/cmdop/skills/<skill>/ (macOS), ~/.cache/cmdop/skills/<skill>/ (Linux).
Full reference → @docs/cache.md
Skill Structure
my-skill/
├── pyproject.toml
├── Makefile
├── README.md
├── skill/
│ ├── config.py # SkillConfig manifest (required)
│ └── readme.md # description shown in marketplace
├── src/my_skill/
│ ├── __init__.py
│ └── ...
└── tests/
skill/config.py — minimal manifest:
from cmdop_skill import SkillConfig
config = SkillConfig() # all fields auto-resolved from pyproject.toml
CLI
| Command | Description |
|---|---|
init [path] |
Scaffold a new skill project |
install <path> |
Symlink skill into system skills directory |
uninstall <name> |
Remove skill |
bump [--minor|--major] |
Bump version in pyproject.toml |
check-name <name> |
Check PyPI availability |
release [--no-bump|--no-publish] |
Bump + build + PyPI + CMDOP |
publish [--path] |
Publish to CMDOP marketplace |
list |
List your published skills |
config set-key / show / reset |
Manage API key |
API key resolution order: --api-key flag → CMDOP_API_KEY env → saved config → interactive prompt.
Python API
| Export | Description |
|---|---|
Skill |
Main class — registers commands, runs CLI |
Arg |
Argument descriptor |
SkillConfig |
Typed skill manifest (Pydantic model) |
SkillCache |
Disk cache — see @docs/cache.md |
CacheEntry |
Pydantic model for a cached value with metadata |
TestClient |
Test harness |
resolve_project_meta |
Resolve name/version/description from pyproject.toml |
generate_manifest |
Generate skill/config.py content |
publish_skill |
Programmatic publish |
json_output / wrap_result / format_error |
Output helpers |
scaffold.ScaffoldConfig / scaffold.scaffold_skill |
Programmatic scaffolding |
Developer Docs
Deep-dive references in @docs/:
- Architecture — system diagram, components, data flow
- Publish Flow — CLI → Django → DB
- Install Flow — deep link → Go loader → validation
- Package Environment — venv, PATH enrichment
- Skill Format — skill.md frontmatter rules
- SkillCache — cache API, paths, testing
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 cmdop_skill-2026.3.18.tar.gz.
File metadata
- Download URL: cmdop_skill-2026.3.18.tar.gz
- Upload date:
- Size: 52.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b25cafdb5d9ab0b98d5528f12b4725379353f4cce353cb2bd0c1a0e981b7c0b
|
|
| MD5 |
460d794e9abba3c75f7446a5d0fd0b35
|
|
| BLAKE2b-256 |
e6c293b4d04e7baf55329717d6d2334a994dbf660866d1dfcd5c5c1f7bfa2688
|
File details
Details for the file cmdop_skill-2026.3.18-py3-none-any.whl.
File metadata
- Download URL: cmdop_skill-2026.3.18-py3-none-any.whl
- Upload date:
- Size: 73.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54002a0b4ca5e513f89a55147a763060070ba9cd77e26bddaae0a158e830646f
|
|
| MD5 |
cca6486428a5c138bb615b9c38087515
|
|
| BLAKE2b-256 |
62376131471e55efc2b92389421f2add042f005c2b6dea8694bd43d9dccce58c
|