Skip to content

feat(cli): devagent up / down — one-command setup and driver start (kills the SELFBUILD_* tribal knowledge) #371

Description

@linhdmn

Problem

Starting the factory today needs tribal knowledge, not a command:

  • the loop driver reads config from the environment only (SELFBUILD_*, internal/loopdriver/config.go:240); nothing reads devagent.json for it, so every knob is an export;
  • DevagentBin defaults to the bare name devagent (config.go:79), so a checkout that only ever builds ./devagent-go (make build) runs a stale or missing CLI for pane-run/task/preflight/sync-docs;
  • the start path is make loop-start in the repo (nohup + pgrep) or a hand-made hub job, and the selfbuild/state branch plus the selfbuild issue label are assumed to exist;
  • devagent create still bakes Node-era argv into its LaunchAgents (dist/src/cli.js at internal/pipeline/create.go:164, scripts/build-loop.sh at :193) — both paths are gone with the retired tree.

Requested change

One lifecycle command per direction:

  • devagent up — verify → seed → start, then report:
    1. prerequisite gate (reuse commands.RunDoctor/RunInit checks: git origin + gh auth + worker CLI), aborting with the plain-language fix line;
    2. config + state dirs (.selfbuild/{research,goals,logs}, .devagent/queue), selfbuild issue label ensured;
    3. PRD intake (feat(prd-intake): operator PRD checkboxes become loop work (the value lane #355 asks for) #370) so the lane starts non-empty;
    4. daemon start when down (:7788) and the loop driver detached (setsid + .selfbuild/logs/driver.log + pid file), or --foreground to run it in this terminal;
    5. a final "what is running / where to look / next action" card.
  • devagent down — stop exactly the processes up started (pid files, never a blind pkill -f).
  • Fix devagent create's plist argv to the Go self-executable (createSelfExePath(), :216) and devagent loop, dropping the dist/src/cli.js and scripts/build-loop.sh entries.

Acceptance

  • devagent up on a clean checkout with only make build done starts a supervised-free driver and prints pid + log path + queue depth; a second up is idempotent (reports the live pid, starts nothing).
  • devagent down leaves no devagent-go loop/daemon process behind and reports what it stopped.
  • devagent create --dry-run emits plists whose ProgramArguments contain no deleted paths.

Activity

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions