Skip to content

Add self-update and subcommands - #5

Merged
alshdavid merged 1 commit into
mainfrom
agent/deepseek-2-medium/self-update
Nov 11, 2026
Merged

alshdavid merged 1 commit into
mainfrom
agent/deepseek-2-medium/self-update

Conversation

@alshdavid-machine

Copy link
Copy Markdown

Based on the reference in template-rust-cli's src/cmd/upgrade/main.rs.

procplot exec      # spawn a process and record its resource usage (previous behaviour)
procplot upgrade   # self-update to the latest release (alias: up, u; --check to only check)
procplot version   # print the current version

Changes

  • procplot exec: the previous top-level behaviour moved under exec; args.rs and reporter.rs moved to src/cmd/exec/. All existing options (-r, -i, -m, -t, -o, --no-*) and PM_* env vars are unchanged; the command is still passed after -- (procplot exec -- node script.mjs).
  • procplot upgrade: ported from the template — uses self_update (rustls) against GitHub releases of alshlabs/procplot, selects the asset matching OS/arch, and is skipped for prerelease versions. --check reports whether a newer release exists. Failures now propagate to the exit code instead of printing and returning 0.
  • procplot version: prints CARGO_PKG_VERSION (the top level also has --version).
  • Dependencies: self_update (github, reqwest, rustls, tar.gz, checksums) and semver.
  • Docs: README usage/installation/upgrading updated; test/run.bash runs cargo run -- exec.

Notes for reviewers

  • This is a breaking CLI change: procplot -- node ... no longer works; it must be procplot exec -- node ....
  • Releases published before this change contain no recognisable binaries (and older tags are named 0.0.x), so procplot upgrade will report "already on the latest version" until a release built by the new workflow is the latest.

Verification (local)

  • cargo clippy --all-targets --workspace -- -D warnings and cargo xfmt --check pass
  • cargo build --release; procplot --help, procplot exec --help, procplot version behave as documented
  • procplot exec -- node ... produces the expected CSV
  • procplot upgrade --check queries GitHub correctly (reports 0.2.0 as latest, as no newer release exists)

- Move the process monitor into `procplot exec`
- Add `procplot upgrade` (with `--check`) using self_update against
  alshlabs/procplot GitHub releases
- Add `procplot version`
- Update README and test/run.bash
@alshdavid
alshdavid merged commit 6c2b1dc into main Nov 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants