Skip to content

feat: add ready_cmd option#187

Merged
jdx merged 3 commits intojdx:mainfrom
TheFedaikin:main
Jan 25, 2026
Merged

feat: add ready_cmd option#187
jdx merged 3 commits intojdx:mainfrom
TheFedaikin:main

Conversation

@TheFedaikin
Copy link
Contributor

@TheFedaikin TheFedaikin commented Jan 22, 2026

Based on the discussion I started implementing the ready_cmd feature.

  • Config and cli arguments
  • Shell abstraction for different shell supports with tests
  • Updated e2e tests
  • Docs

Outstanding questions:

  • Is the abstraction for shell sufficient?
  • Code style issues?

Note

Adds a new readiness check that polls a shell command and integrates it across CLI, config, schema, supervisor, and UI.

  • Introduces ready_cmd in pitchfork.toml, JSON Schema, and docs; new --cmd <CMD> flag for start/run
  • Threads ready_cmd through RunOptions, daemon state, IPC, restart/retry/watchers/boot paths, TUI, and web routes
  • Implements cross-platform shell module and uses it in supervisor lifecycle to run readiness commands (500ms polling)
  • Updates usage specs and guides; adds e2e and config parsing tests for the new check

Written by Cursor Bugbot for commit 1055b3c. This will update automatically on new commits. Configure here.

@TheFedaikin
Copy link
Contributor Author

Once we agree on implementation I'll add the docs for this feature. I'd like to keep it to code in first commit.

@TheFedaikin
Copy link
Contributor Author

Updated docs and made the branch ready.

// Setup command readiness check interval (poll every 500ms)
let mut cmd_check_interval = ready_cmd
.as_ref()
.map(|_| tokio::time::interval(Duration::from_millis(500)));
Copy link
Contributor Author

@TheFedaikin TheFedaikin Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be extracted to const at the top of the file and be configurable in the future? I think for cmd it's probably the most needed one, as some of them are expensive and can run more than an interval duration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need it to be configuable in the future

Copy link
Contributor

@gaojunran gaojunran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there may have been a lib to do this abstraction. but you finish it with full tests and I think it's ok

// Setup command readiness check interval (poll every 500ms)
let mut cmd_check_interval = ready_cmd
.as_ref()
.map(|_| tokio::time::interval(Duration::from_millis(500)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need it to be configuable in the future

@jdx
Copy link
Owner

jdx commented Jan 25, 2026

bugbot run

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

@jdx jdx merged commit 166f56c into jdx:main Jan 25, 2026
4 checks passed
@jdx jdx mentioned this pull request Jan 25, 2026
jdx added a commit that referenced this pull request Feb 1, 2026
## 🤖 New release

* `pitchfork-cli`: 1.2.0 -> 1.3.0

<details><summary><i><b>Changelog</b></i></summary><p>

<blockquote>

## [1.3.0](v1.2.0...v1.3.0) -
2026-02-01

### Added

- *(list)* show available daemons and align logics with TUI
([#206](#206))
- *(logs)* support `--since <humantime>`, use pager by default
([#204](#204))
- support `pitchfork.local.toml`
([#198](#198))
- impl `stop --all` ([#195](#195))
- beautify web ui ([#191](#191))
- add ready_cmd option
([#187](#187))

### Fixed

- refactor the logic of stopping a daemon and add tests
([#192](#192))

### Other

- re-order code to suit for multi-frontend structure
([#197](#197))
- *(deps)* update rust crate xx to v2.3.1
([#203](#203))
- *(deps)* update rust crate clap to v4.5.56
([#202](#202))
- *(ci)* run linting on all files in CI
([#196](#196))
- Update README.md logo
([#184](#184))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk: this PR only updates version numbers and release notes/docs,
with no runtime code changes.
> 
> **Overview**
> Releases **v1.3.0** by bumping the crate version from `1.2.0` to
`1.3.0` (including `Cargo.lock`) and updating the
`pitchfork.usage.kdl`/generated CLI docs to match.
> 
> Updates `CHANGELOG.md` with the `1.3.0` release notes and links to the
included feature/fix PRs.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
d278b90. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.

3 participants