Skip to content

The installers take --base, --team and --personal: a layer is registered when given, named as skipped when not — the script never asks #950

Closed

Description

@David-Noble-at-work

#798's ruling 2 (2026-09-04), not started in either script at d54626d2: install.sh knows --prefix alone, install.ps1 -Prefix and -Help.

Each of --base, --team, --personal (-Base, -Team, -Personal) takes a working-tree path or a repository URL, the writ repo set grammar, and registers that layer after writ is installed. A layer not given is skipped, and the summary's last lines name it with the writ repo set command that registers it. The installers never ask, with or without a terminal: the prompting half of ruling 2 was reversed on 2026-09-26 (#798 comment). Each flag has an environment variable, DEVLORE_BASE, DEVLORE_TEAM and DEVLORE_PERSONAL, because irm … | iex takes no parameters. The URL given is used as given: an SSH URL clones over SSH (personal#224 found writ's clones on HTTPS because that is what they were given).

Plan and design documents

Kind Document
Plan docs/plans/feature/950-installers-take-base-team-and.md
Design #798

Activity

  1. changed the title [-]The installers take --base, --team and --personal: a layer is registered when given, asked for once on a TTY, skipped and said so without one[/-] [+]The installers take --base, --team and --personal: a layer is registered when given, named as skipped when not — the script never asks[/+] on Sep 26, 2026
  2. David-Noble-at-work commented on Sep 27, 2026

    @David-Noble-at-work
    ContributorAuthor

    The plan, quoted before its branch is deleted (2026-09-27). Lane 11 is held while another session repairs CI's linters (#964), whose PowerShell gate reaches install.ps1. Per agent rule 8, a held branch is deleted, not parked (ruled 2026-09-27: "quote its plan into devlore-cli#950"). The branch feature/950-installers-take-base-team-and held one commit, 3816e9ca, this plan. It was never pushed, and no code had been written. When the lane reopens, git open-branch 950 starts from this text, updated to whatever develop then holds.

    Work added since the plan was committed:

    docs/plans/feature/950-installers-take-base-team-and.md at 3816e9ca
    ---
    title: "The installers take --base, --team and --personal: a layer is registered when given, and named as skipped when not — the script never asks"
    issue: https://github.com/NobleFactor/devlore-cli/issues/950
    status: approved
    created: 2026-09-25
    updated: 2026-09-27
    ---
    
    # Plan: the installers take the three layer flags
    
    Lane 11 of [#949](https://github.com/NobleFactor/devlore-cli/issues/949). Design:
    [#798](https://github.com/NobleFactor/devlore-cli/issues/798), ruling 2.
    
    ## Issue 950
    
    Setting up a machine took, after the installer, three `writ repo set` lines typed from memory. Ruling 2
    of #798: the installer registers each layer it is given. At `9cd1e95d` neither script knows a layer:
    `install.sh` has `--prefix`, `install.ps1` has `-Prefix` and `-Help`.
    
    **Ruling 2's prompting half reversed, 2026-09-26.** #798 had the installer ask once, on a TTY, for each
    layer not given. Looked up against the installers people actually publish — Docker's `get.docker.com`,
    Tailscale's, Claude Code's `install.sh`, rustup, Homebrew, oh-my-zsh — and ruled: the script never asks.
    In the owner's words: "let's go with docker and claude's approach. verbatim. the shell script never
    prompts. anything interactives belongs to the downloaded binary." That is Docker's, Tailscale's and
    Claude's shape, and it removes the `curl | bash` stdin question entirely: a layer not given is skipped,
    and the summary names the command that registers it.
    
    ## Goals
    
    1. `curl … | bash -s -- --base=<loc> --team=<loc> --personal=<loc>` — and in PowerShell, the
       script-block form with `-Base <loc> -Team <loc> -Personal <loc>`, or `irm | iex` with
       `$env:DEVLORE_BASE` and kin — leaves the three layers registered, in `writ repo list`.
    2. With no flags, the one-liner installs, registers nothing, never asks, and its last lines name each
       layer not given with the command that registers it. Terminal or not, the run is the same.
    
    ## Requirements
    
    ### Requirement 1: The flags, both scripts
    
    | bash | PowerShell | environment (both) | value |
    | --- | --- | --- | --- |
    | `--base=<loc>` | `-Base <loc>` | `DEVLORE_BASE` | a working-tree root or a repository URL — `writ repo set`'s grammar, passed through as given |
    | `--team=<loc>` | `-Team <loc>` | `DEVLORE_TEAM` | same |
    | `--personal=<loc>` | `-Personal <loc>` | `DEVLORE_PERSONAL` | same |
    
    The environment form exists because `irm … | iex` takes no parameters, and `curl … | bash` takes them
    only after `-s --`; the environment is what both one-liners can carry. A flag wins over its variable.
    The `--help` text and both headers list all three, with the environment names.
    
    `install.ps1` runs the same way under Windows PowerShell 5.1 and PowerShell 7, on Windows, macOS and
    Linux. 5.1 is the minimum it supports; anyone may use 7.
    
    **PowerShell's preferred one-liner is the script-block form** (ruled 2026-09-27: "variant 3 seems like
    the winner. it is klunky but is more failsafe … we should doc it on the web page as the preferred
    alternative"):
    
    ```powershell
    & ([scriptblock]::Create((irm https://<site>/install.ps1))) `
        -Base     <loc> `
        -Team     <loc> `
        -Personal <loc>
    ```
    
    `[scriptblock]::Create` turns the downloaded text into a script block and `&` runs it, so the script's
    own parameters bind by name; nothing is saved, so no execution policy applies, and it breaks across lines
    with ordinary backticks. `install.ps1`'s header shows it first, then `irm … | iex` with the environment
    variables, then the file form, `.\install.ps1 -Base <loc> …`, which on Windows needs
    `-ExecutionPolicy Bypass` because the default policy refuses a downloaded script (macOS and Linux have no
    execution policy). Not shown: `iex "& { $(irm …) } -Base …"` — the same thing, but it splits across
    lines only with doubled backticks inside the string. The web page is lane 13, #946, which carries the
    ruling.
    
    ### Requirement 2: No questions
    
    Neither script reads from the terminal, ever: no `read`, no `Read-Host`, no `/dev/tty`, no TTY test
    beyond the one that already decides color. A layer not supplied by flag or variable is skipped, and the
    summary's last lines name it with the command that registers it:
    
    ```text
    skipped: team — writ repo set team <working-tree-root>|<repository-url>
    ```
    
    The same lines print whether or not a terminal is present. Precedent, read on 2026-09-26: Docker's
    `get.docker.com` (no prompt; one "Ctrl+C now or wait" pause), Tailscale's `install.sh` (none), Claude
    Code's `install.sh` (none; `[ -t 0 ]` only to `stty sane` after a signal; the TUI is the binary's).
    
    ### Requirement 3: Registration
    
    After the products are installed, for each layer given, base first:
    
    ```text
    <prefix>/bin/writ repo set <layer> <loc>
    ```
    
    The writ just installed, by path. Its errors are its errors: under `set -o errexit` in bash, and under
    `$ErrorActionPreference = 'Stop'` with `$LASTEXITCODE` checked in PowerShell, as the `self install` calls
    already are, a failure ends the script the way a failed `self install` does. No rollback. Ruled
    2026-09-26: every operation is idempotent — the installer, each `self install` (#933), each `repo set`
    (#791) — so the recovery from any failure is the same command again, and a step that turns out not to be
    safe to repeat is a bug against that step, not a case for the installer to handle.
    If `DEVLORE_TOOLS` left writ out and a layer was given, there is no writ to run; that is an error before
    anything downloads.
    
    While `install.sh` is open: its `set -euo pipefail` becomes `set -o errexit -o nounset -o pipefail`, and
    every short option becomes the long form wherever the tool accepts one on every platform the script
    runs on (ruled 2026-09-26: long options, always). Same behavior, spelled out:
    
    | Tool | Where it runs | Long form |
    | --- | --- | --- |
    | `curl` | everywhere | yes: `--fail --silent --show-error --location --header --output` |
    | `wget` | GNU wherever present | yes: `--quiet --output-document --header` |
    | `tar` | GNU on Linux; libarchive's bsdtar on macOS | yes: `--extract --gzip --file --directory`, all four in bsdtar's option table (`tar/cmdline.c`) |
    | `mkdir`, `rm`, `mktemp` | BSD on macOS | no — `-p`, `-rf`, `-d` stay, as #961 left `rm` and `mktemp` |
    | `unzip` | Info-ZIP | no — Info-ZIP has no long options; `-q -d` stay |
    
    The header's one-liners take the same long `curl` options.
    
    ### Requirement 4: The summary and the next steps
    
    "Next steps" stops suggesting `writ adopt` first. It says: `writ deploy` if a layer was registered, and
    the `writ repo set` lines for what was skipped.
    
    ## Implementation Phases
    
    ### Phase 1: Commit the plan
    
    - [x] This plan, before the change
    - [x] The reversal recorded on #798 as a comment, dated, in the owner's words
          ([comment](https://github.com/NobleFactor/devlore-cli/issues/798#issuecomment-5856172826))
    
    ### Phase 2: The change
    
    - [ ] `install.sh`: flags, variables, registration, summary (Requirements 1–4)
    - [ ] `install.ps1`: parameters, variables, registration, summary (Requirements 1–4), within Windows
          PowerShell 5.1's surface (#951's floor)
    - [ ] Both headers and both `--help` texts
    
    ### Phase 3: Verify, without touching this machine's registrations
    
    Every run below is executed twice in a row; the second run's result and `writ repo list` must equal the
    first's. A difference is a bug, filed against whichever command diverged.
    
    writ reads `XDG_CONFIG_HOME`, `XDG_DATA_HOME` and `XDG_STATE_HOME`, so every run below sets all three to
    scratch directories and installs to a scratch prefix; `writ repo list` from that environment is the
    assertion, and this host's `~/.config/devlore` is diffed before and after to prove it untouched.
    
    - [ ] bash, flags: `--base=<path to the noblefactor-ops clone> --team=<path to the devlore-cli clone>
          --personal=<path to personal>` → three registered
    - [ ] bash, no flags, once with stdin a terminal and once `< /dev/null` → identical: installed, three
          "skipped:" lines, nothing read, exit 0
    - [ ] bash, `DEVLORE_BASE=<path>` alone → base registered, two skipped
    - [ ] bash, `DEVLORE_TOOLS=lore --base=…` → refused before download, exit 1
    - [ ] pwsh 7, the same four through the script-block form's `-Base` and through `irm | iex` with `$env:DEVLORE_BASE`
    - [ ] Windows PowerShell 5.1 on DANOBLE-WD11-3, the script-block form and `irm | iex` — the owner's run; stays open
    - [ ] `star lint shell .` (CI's gate, which reads `install.sh`) passes; PSScriptAnalyzer with the
          organization's settings adds no finding over the base
    
    ### Phase 4: Merge
    
    - [ ] PR script written, shown, and handed over
    - [ ] After the merge: the next pre-release's sync carries both scripts; nothing to deploy
    
    ## Out of Scope
    
    - **`--branch` for a URL layer.** `writ repo set` takes it; ruling 2 does not name it. A follow-up if a
      machine needs a non-default branch at install time.
    - **`writ deploy` from the installer.** Ruling 2 registers; deploying is the user's next command, and
      the summary names it.
    - **The README and the guide** — lane 13, #946, which describes these flags once they exist.
  3. David-Noble-at-work commented on Sep 29, 2026

    @David-Noble-at-work
    ContributorAuthor

    install.ps1 is gated as of 2026-09-28 (devlore-cli#973, merged at 22:10:37Z as 0cf30415). The other session's lint lane handed over the file with these constraints, which this lane's edits keep:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions