Skip to content

Commit 63f955c

Browse files
committed
Initial JMAP read-only CLI
0 parents  commit 63f955c

8 files changed

Lines changed: 716 additions & 0 deletions

File tree

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Python-generated files
2+
__pycache__/
3+
*.py[oc]
4+
build/
5+
dist/
6+
wheels/
7+
*.egg-info
8+
9+
# Virtual environments
10+
.venv

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

AGENTS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Tooling Convention
2+
3+
- Use `uv` directly for Python environment and package tasks; do **not** use `uv pip` or `uv venv`.

README.md

Whitespace-only changes.

fastmail_cli.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env python3
2+
"""
3+
fastmail-cli: thin wrapper around jmapc-cli with Fastmail defaults.
4+
"""
5+
import os
6+
import sys
7+
8+
DEFAULT_HOST = "api.fastmail.com"
9+
DEFAULT_TOKEN_ENV = "FASTMAIL_READONLY_API_TOKEN"
10+
11+
12+
def main(argv=None) -> int:
13+
# Set default host if not provided
14+
os.environ.setdefault("JMAP_HOST", DEFAULT_HOST)
15+
# Promote FASTMAIL_READONLY_API_TOKEN to JMAP_API_TOKEN if not already set
16+
if "JMAP_API_TOKEN" not in os.environ and DEFAULT_TOKEN_ENV in os.environ:
17+
os.environ["JMAP_API_TOKEN"] = os.environ[DEFAULT_TOKEN_ENV]
18+
from jmapc_cli import main as jmap_main
19+
return jmap_main(argv)
20+
21+
22+
if __name__ == "__main__":
23+
sys.exit(main())

jmapc_cli.py

Lines changed: 429 additions & 0 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[project]
2+
name = "fm"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
requires-python = ">=3.13"
7+
dependencies = [
8+
"jmapc>=0.2.23",
9+
]
10+
11+
[project.scripts]
12+
jmapc-cli = "jmapc_cli:main"
13+
fastmail-cli = "fastmail_cli:main"

uv.lock

Lines changed: 237 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)