-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Motivation
Today Deft is typically consumed via git clone, which makes installation and updates heavier than they need to be (especially across many repos/machines). Publishing Deft as package-manager CLIs provides:
- Easy install (
npm i -g ...,npx ...,pipx install ...,uv tool install ...) - Version pinning (package version == Deft version)
- Consistent entrypoint (
deft ...) regardless of environment - No git workflow friction (no submodules, no clone required)
Desired user experience
Users should be able to install Deft with either ecosystem:
NPM (global / one-off / pinned via Volta)
Global install
npm i -g <pkg>deft --version
One-off execution
npx <pkg> <command>
Project dev dependency
npm i -D <pkg>npx deft <command>
Volta (pinned, per-user)
volta install <pkg>deft --version
Volta (pinned, per-project)
- Add to
package.json:"volta": { "node": "x.y.z", "npm": "a.b.c" }
npm i -D <pkg>npx deft <command>
Note: If we want “pin Deft CLI version” via Volta specifically, we can recommend
volta install <pkg>@<version>.
PIP (recommended via uv tool / pipx)
uv tool install (pinned, per-user)
uv tool install <pkg>deft --version
pipx install (pinned, per-user)
pipx install <pkg>deft --version
pip install (fallback)
pip install <pkg>deft --version
In all cases, users get a deft command with the same behavior.
Example CLI usage (what users would actually run)
Assuming the project-local layout and behavior is already solved (see #4), the CLI should support workflows like:
Install / initialize in a repo
deft install- Copies the Deft core assets into
./.deft/coreat the pinned version (or latest if unpinned) - Ensures
./.deft/cacheexists (gitignored) - Ensures
./deft/exists for project overrides
- Copies the Deft core assets into
Bootstrap first-time files
deft bootstrap- Creates
./deft/project.mdif missing - Creates
~/.deft/user.mdif missing - Does not modify anything inside the packaged assets
- Creates
Update Deft core version
deft update- Updates
./.deft/coreto a newer pinned version (or latest, depending on the repo’s pinning strategy)
- Updates
Inspect / verify what’s in use
deft doctor- Prints the CLI version (and optionally the core assets version installed in
./.deft/core) - Prints which override files were discovered (project + user)
- Validates expected directories exist and that
.deft/cacheis ignored
- Prints the CLI version (and optionally the core assets version installed in
Optional additional “quality of life” examples (if we want them):
deft resolve- Writes a merged bundle to
./.deft/cache/deft.context.mdfor tools that prefer a single file
- Writes a merged bundle to
deft --help- Lists commands and describes where files are written
Requirements
- Ship a
deftCLI in both NPM and PIP distributions. - Include Deft core assets in both package artifacts (markdown directories, templates, etc.).
- No writes to packaged assets (packages are read-only by design). All output is written to project/user locations as defined in make /deft read-only #4
- Versioning
- Package versions should track Deft releases (e.g.
deft-cli@0.4.2corresponds to Deft core0.4.2). - The CLI should be able to report its version (
deft --version) and optionally “core asset version” (deft doctoror similar).
- Package versions should track Deft releases (e.g.
- Parity
- The NPM and PIP CLIs should expose the same command surface area and flags (as much as practical).
Packaging approach
Maintain two small CLIs (Node + Python) that follow the same behavior spec and test fixtures.
- Pros: best native experience in each ecosystem
- Cons: two implementations to maintain
Implementation notes
NPM packaging
- Ensure markdown assets are published (use
filesinpackage.json). - Provide
binentry sodeftis available on PATH. - Support
npxusage cleanly. - Consider scoped package naming (e.g.
@visionik/deftor@visionik/deft-cli). - Document Volta install/pinning workflows (examples above).
PIP packaging
- Include markdown assets as package data (pyproject config).
- Provide a console script entrypoint (
deft). - Confirm install flows for
uv tool installandpipx install. - Consider naming conflicts on PyPI (
deft,deft-cli, etc.).
Acceptance criteria
deftcan be installed via NPM and PIP using common workflows (global + one-off + tool install + Volta).- Packaged artifacts include the required Deft asset directories.
deft --versionworks and matches the package version.- Running the CLI does not require a git clone of the Deft repo.
- Docs updated to recommend package-based install paths and show both NPM + PIP commands (including Volta + uv).
Deliverables / tasks
- Decide naming for NPM + PyPI packages
- Create NPM package + publish workflow
- Create PIP package + publish workflow
- Ensure assets are included in both distributions
- Provide release process (tag -> publish NPM/PIP)
- Update README with NPM + PIP install instructions (include Volta + uv examples)