magehand 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ __pycache__/
2
+ *.egg-info/
3
+ dist/
4
+ build/
5
+ .venv/
magehand-0.3.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 David Larrimore
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,75 @@
1
+ Metadata-Version: 2.5
2
+ Name: magehand
3
+ Version: 0.3.0
4
+ Summary: The developer CLI for building apps on davidlarrimore's homelab
5
+ Project-URL: Source, https://github.com/davidlarrimore/magehand
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ Classifier: Environment :: Console
9
+ Classifier: Operating System :: MacOS
10
+ Classifier: Operating System :: POSIX :: Linux
11
+ Classifier: Programming Language :: Python :: 3
12
+ Requires-Python: >=3.9
13
+ Requires-Dist: pyyaml>=6.0
14
+ Description-Content-Type: text/markdown
15
+
16
+ # magehand
17
+
18
+ The developer CLI for building apps on [davidlarrimore](https://github.com/davidlarrimore)'s
19
+ homelab, the same way on the owner's MacBook (Claude Code) and in OpenClaw's
20
+ VM (its coding workers). It reads platform state and runs apps locally. It
21
+ never deploys: changes go through pull requests.
22
+
23
+ It is public because it holds nothing sensitive. Every command needs access
24
+ that only the owner has: the private homelab repos on GitHub, the private
25
+ `*.lab` network, and an authentik passkey for
26
+ OpenBao.
27
+
28
+ ## Install
29
+
30
+ ```sh
31
+ brew install uv # once
32
+ uv tool install magehand
33
+ magehand setup # once per machine
34
+ ```
35
+
36
+ `magehand setup` checks GitHub (`gh auth login` first) and Docker (Docker
37
+ Desktop or OrbStack, for database blocks), makes sure the homelab's `*.lab`
38
+ names resolve (if they don't, it asks for the homelab's DNS address, your home
39
+ gateway, and points only `*.lab` lookups at it; `magehand setup --undo`
40
+ reverses that), then signs you in and installs the `homelab-app` skill for Claude Code (and Codex). Every other command assumes this is done.
41
+ Upgrade with `magehand upgrade` (any command says, at most once a day, when a new version is out).
42
+
43
+ ## Commands
44
+
45
+ | Command | What it does |
46
+ | --- | --- |
47
+ | `magehand guide [topic ["section"]]` | The app platform guide, live from homelab-apps `docs/platform/`; `magehand guide catalog` for blocks and models |
48
+ | `magehand guide search WORDS` | The guide sections (homelab-apps `docs/platform/` and `AGENTS.md`) that best match a question, e.g. `magehand guide search web search` |
49
+ | `magehand app [name]` | The app's blocks, every env var its pod gets and where it comes from, its URLs. In an app repo the name is the repo's |
50
+ | `magehand check [name] [--code DIR] [--apps-dir DIR] [--manifests-only]` | The platform's rules for the app's code and its homelab-apps deployment: block keys and options, `optional: true` keys, Secrets that aren't blocks, the image, env the code reads but the pod doesn't set, direct AI/search provider calls, own login, database files. Each finding names the guide section; exit 1 on errors. Run before every push; CI (homelab-apps `build-app.yaml`) runs it too, with `--apps-dir` |
51
+ | `magehand login` | Sign in to OpenBao through authentik (passkey) with role `dev`: read-only access to agent apps' LiteLLM keys, 1h (8h max). The token is kept in the macOS Keychain |
52
+ | `magehand dev up\|down\|status` | Docker containers for the app's `postgres`/`redis` blocks (the blocks' own pinned images) on a per-app network, and local values for `secret` blocks |
53
+ | `magehand run [--no-proxy] -- CMD` | Runs CMD with the env the app's pod gets: values from its Deployment, the LLM key from OpenBao, databases from `dev up`. Precedence: manifest < the repo's `.magehand.env` (committed, non-secret overrides such as `WEB_DIR=./web`) < your shell < secrets. A proxy on `127.0.0.1:8080` adds the `X-authentik-*` headers Traefik would, as you |
54
+ | `magehand run --container [--no-build] [-- CMD]` | Builds the repo's Dockerfile and runs the image as its pod runs: read-only, `/tmp` tmpfs, the pod's user, no capabilities, exactly the pod's env. Secrets go in as `-e NAME` only, never in the image, argv or on disk |
55
+ | `magehand setup [--undo] [--dns ADDRESS]` | Once per machine: GitHub, Docker, `*.lab` name resolution (the only step that may ask for your password), sign-in |
56
+ | `magehand skill [--install]` | The `homelab-app` skill: tells Claude Code and Codex to use `app`, `guide search` and `check` while working on app code. `setup` installs it (`$CLAUDE_CONFIG_DIR` or `~/.claude`, and `$CODEX_HOME` or `~/.codex` if Codex is installed) |
57
+ | `magehand doctor` | Checks GitHub access, that `openbao.lab` is reachable, the sign-in and Docker |
58
+ | `magehand upgrade` | Upgrades magehand the way it was installed (`uv tool upgrade`, `pipx upgrade` or pip in its venv) and refreshes the `homelab-app` skill if you installed it. Never automatic: a release runs on your Mac, so you run it. Every other command prints a one-line notice (stderr, at most once a day, never in CI or scripts) when a newer version is tagged on GitHub; `MAGEHAND_NO_UPDATE_CHECK=1` turns it off. OpenClaw's VM refuses it: its version is pinned in homelab `platform/openclaw/vm/versions.env` |
59
+ | `magehand version` | The installed version, and whether a newer one exists |
60
+
61
+ ## Development
62
+
63
+ ```sh
64
+ uv venv && uv pip install -e .
65
+ .venv/bin/python -m unittest discover -s tests
66
+ ```
67
+
68
+ Python 3.9+ (the Mac's system Python works). Stdlib plus PyYAML. Releases:
69
+ bump `version` in `pyproject.toml`, merge, then tag `vX.Y.Z`. The release
70
+ workflow builds and publishes to PyPI through trusted publishing (no stored
71
+ token). OpenClaw's VM installs a pinned version from homelab
72
+ `platform/openclaw/vm/versions.env`.
73
+
74
+ Never commit secrets, tokens, IP addresses or email addresses: this repo is
75
+ public.
@@ -0,0 +1,60 @@
1
+ # magehand
2
+
3
+ The developer CLI for building apps on [davidlarrimore](https://github.com/davidlarrimore)'s
4
+ homelab, the same way on the owner's MacBook (Claude Code) and in OpenClaw's
5
+ VM (its coding workers). It reads platform state and runs apps locally. It
6
+ never deploys: changes go through pull requests.
7
+
8
+ It is public because it holds nothing sensitive. Every command needs access
9
+ that only the owner has: the private homelab repos on GitHub, the private
10
+ `*.lab` network, and an authentik passkey for
11
+ OpenBao.
12
+
13
+ ## Install
14
+
15
+ ```sh
16
+ brew install uv # once
17
+ uv tool install magehand
18
+ magehand setup # once per machine
19
+ ```
20
+
21
+ `magehand setup` checks GitHub (`gh auth login` first) and Docker (Docker
22
+ Desktop or OrbStack, for database blocks), makes sure the homelab's `*.lab`
23
+ names resolve (if they don't, it asks for the homelab's DNS address, your home
24
+ gateway, and points only `*.lab` lookups at it; `magehand setup --undo`
25
+ reverses that), then signs you in and installs the `homelab-app` skill for Claude Code (and Codex). Every other command assumes this is done.
26
+ Upgrade with `magehand upgrade` (any command says, at most once a day, when a new version is out).
27
+
28
+ ## Commands
29
+
30
+ | Command | What it does |
31
+ | --- | --- |
32
+ | `magehand guide [topic ["section"]]` | The app platform guide, live from homelab-apps `docs/platform/`; `magehand guide catalog` for blocks and models |
33
+ | `magehand guide search WORDS` | The guide sections (homelab-apps `docs/platform/` and `AGENTS.md`) that best match a question, e.g. `magehand guide search web search` |
34
+ | `magehand app [name]` | The app's blocks, every env var its pod gets and where it comes from, its URLs. In an app repo the name is the repo's |
35
+ | `magehand check [name] [--code DIR] [--apps-dir DIR] [--manifests-only]` | The platform's rules for the app's code and its homelab-apps deployment: block keys and options, `optional: true` keys, Secrets that aren't blocks, the image, env the code reads but the pod doesn't set, direct AI/search provider calls, own login, database files. Each finding names the guide section; exit 1 on errors. Run before every push; CI (homelab-apps `build-app.yaml`) runs it too, with `--apps-dir` |
36
+ | `magehand login` | Sign in to OpenBao through authentik (passkey) with role `dev`: read-only access to agent apps' LiteLLM keys, 1h (8h max). The token is kept in the macOS Keychain |
37
+ | `magehand dev up\|down\|status` | Docker containers for the app's `postgres`/`redis` blocks (the blocks' own pinned images) on a per-app network, and local values for `secret` blocks |
38
+ | `magehand run [--no-proxy] -- CMD` | Runs CMD with the env the app's pod gets: values from its Deployment, the LLM key from OpenBao, databases from `dev up`. Precedence: manifest < the repo's `.magehand.env` (committed, non-secret overrides such as `WEB_DIR=./web`) < your shell < secrets. A proxy on `127.0.0.1:8080` adds the `X-authentik-*` headers Traefik would, as you |
39
+ | `magehand run --container [--no-build] [-- CMD]` | Builds the repo's Dockerfile and runs the image as its pod runs: read-only, `/tmp` tmpfs, the pod's user, no capabilities, exactly the pod's env. Secrets go in as `-e NAME` only, never in the image, argv or on disk |
40
+ | `magehand setup [--undo] [--dns ADDRESS]` | Once per machine: GitHub, Docker, `*.lab` name resolution (the only step that may ask for your password), sign-in |
41
+ | `magehand skill [--install]` | The `homelab-app` skill: tells Claude Code and Codex to use `app`, `guide search` and `check` while working on app code. `setup` installs it (`$CLAUDE_CONFIG_DIR` or `~/.claude`, and `$CODEX_HOME` or `~/.codex` if Codex is installed) |
42
+ | `magehand doctor` | Checks GitHub access, that `openbao.lab` is reachable, the sign-in and Docker |
43
+ | `magehand upgrade` | Upgrades magehand the way it was installed (`uv tool upgrade`, `pipx upgrade` or pip in its venv) and refreshes the `homelab-app` skill if you installed it. Never automatic: a release runs on your Mac, so you run it. Every other command prints a one-line notice (stderr, at most once a day, never in CI or scripts) when a newer version is tagged on GitHub; `MAGEHAND_NO_UPDATE_CHECK=1` turns it off. OpenClaw's VM refuses it: its version is pinned in homelab `platform/openclaw/vm/versions.env` |
44
+ | `magehand version` | The installed version, and whether a newer one exists |
45
+
46
+ ## Development
47
+
48
+ ```sh
49
+ uv venv && uv pip install -e .
50
+ .venv/bin/python -m unittest discover -s tests
51
+ ```
52
+
53
+ Python 3.9+ (the Mac's system Python works). Stdlib plus PyYAML. Releases:
54
+ bump `version` in `pyproject.toml`, merge, then tag `vX.Y.Z`. The release
55
+ workflow builds and publishes to PyPI through trusted publishing (no stored
56
+ token). OpenClaw's VM installs a pinned version from homelab
57
+ `platform/openclaw/vm/versions.env`.
58
+
59
+ Never commit secrets, tokens, IP addresses or email addresses: this repo is
60
+ public.
@@ -0,0 +1,28 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.26"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "magehand"
7
+ version = "0.3.0"
8
+ description = "The developer CLI for building apps on davidlarrimore's homelab"
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ license-files = ["LICENSE"]
12
+ requires-python = ">=3.9"
13
+ dependencies = ["PyYAML>=6.0"]
14
+ classifiers = [
15
+ "Environment :: Console",
16
+ "Operating System :: MacOS",
17
+ "Operating System :: POSIX :: Linux",
18
+ "Programming Language :: Python :: 3",
19
+ ]
20
+
21
+ [project.urls]
22
+ Source = "https://github.com/davidlarrimore/magehand"
23
+
24
+ [project.scripts]
25
+ magehand = "magehand.cli:main"
26
+
27
+ [tool.hatch.build.targets.sdist]
28
+ include = ["src", "tests", "README.md", "LICENSE"]
@@ -0,0 +1 @@
1
+ """magehand: the developer CLI for building apps on the homelab."""
@@ -0,0 +1,3 @@
1
+ from magehand.cli import main
2
+
3
+ main()