storkit: create 399_story_cli_port_flag_with_project_toml_persistence

This commit is contained in:
Timmy
2026-03-26 11:05:12 +00:00
parent c7c4a57533
commit 584a44a516
@@ -10,14 +10,22 @@ As a developer, I want to set the server port via a --port CLI flag that persist
## Acceptance Criteria
- [ ] storkit --help shows a --port option
- [ ] storkit --port 4000 starts the server on port 4000
- [ ] After first run with --port, the port is saved to project.toml
- [ ] On subsequent runs without --port, the port from project.toml is used
- [ ] CLI --port overrides the value in project.toml
- [ ] Default port is 3001 when neither --port nor project.toml port is set
- [ ] STORKIT_PORT env var continues to work as lowest-priority fallback
- [ ] `storkit --help` shows a `--port` option
- [ ] `storkit --port 4000` starts the server on port 4000
- [ ] After first run with `--port`, the port is saved to `project.toml`
- [ ] On subsequent runs without `--port`, the port from `project.toml` is used
- [ ] CLI `--port` overrides the value in `project.toml`
- [ ] Default port is 3001 when neither `--port` nor `project.toml` port is set
- [ ] `STORKIT_PORT` env var is removed — no longer read or respected
- [ ] `.storkit_port` lock file mechanism is removed (`write_port_file` / `remove_port_file`)
## Out of Scope
- TBD
- Docker compose changes (can update `STORKIT_PORT` references separately)
- Adding other CLI flags beyond `--port`
## Technical Notes
Port resolution priority: `--port` flag > `project.toml` `port` field > default 3001
The port should be written to `project.toml` on startup so subsequent runs remember it. Use the existing `config.rs` / `ProjectConfig` struct — add a `port` field.