Skip to content

Commit 26d45bc

Browse files
committed
Add migrate, doctor commands and config improvements
- Add peas migrate command for legacy config migration - Add peas doctor command for health checks with --fix support - Move canonical config location to .peas/config.toml - Deprecate peas.path config option - Add JSON Schema for config files with LSP support - Support sequential ID generation mode - doctor --fix now includes migration (migrate is convenience alias) - Update README with new commands and configuration options
1 parent 64c6fbb commit 26d45bc

20 files changed

+930
-69
lines changed

.peas.toml renamed to .peas/config.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#:schema https://raw.githubusercontent.com/asaaki/peas/refs/heads/main/schemas/peas.json
22

33
[peas]
4-
path = ".peas"
54
prefix = "peas-"
65
id_length = 5
76
default_status = "todo"

.peas/memory/workflow-tickets.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
+++
2+
key = "workflow-tickets"
3+
tags = [
4+
"workflow",
5+
"best-practice",
6+
]
7+
created = "2026-02-02T19:44:48.224348700Z"
8+
updated = "2026-02-02T19:44:48.224348700Z"
9+
+++
10+
11+
Always create tickets FIRST before starting work on a feature or fix. The workflow is:
12+
13+
1. Create ticket with description of what needs to be done
14+
2. Work on the implementation
15+
3. Update ticket status to completed when done
16+
4. Reference ticket ID in commits/PRs if applicable
17+
18+
This ensures proper tracking and documentation of all changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
+++
2+
id = "peas-1r9z5"
3+
title = "Integrate migrate into doctor --fix"
4+
type = "chore"
5+
status = "completed"
6+
priority = "normal"
7+
created = "2026-02-02T19:50:57.406789700Z"
8+
updated = "2026-02-02T19:50:57.406789700Z"
9+
+++
10+
11+
Made doctor --fix perform config migration inline, making migrate a convenience alias. Updated help text and README to reflect this relationship.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
+++
2+
id = "peas-5ud47"
3+
title = "Add peas migrate command"
4+
type = "feature"
5+
status = "completed"
6+
priority = "normal"
7+
created = "2026-02-02T19:42:29.409971400Z"
8+
updated = "2026-02-02T19:42:29.409971400Z"
9+
+++
10+
11+
Added `peas migrate` command to help users migrate from legacy config locations to the new `.peas/config.toml` location.
12+
13+
## Usage
14+
```bash
15+
peas migrate # Perform migration
16+
peas migrate --dry-run # Preview what would be changed
17+
```
18+
19+
## Features
20+
- Detects legacy config files (`.peas.toml`, `.peas.yml`, etc.)
21+
- Moves config to `.peas/config.toml`
22+
- Removes deprecated `path` option from config
23+
- Adds schema directive for LSP support
24+
- Dry-run mode to preview changes
25+
- Handles already-migrated projects gracefully
26+
- Cleans up leftover legacy config files
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
+++
2+
id = "peas-5z3nx"
3+
title = "Move config file to .peas/config.toml"
4+
type = "feature"
5+
status = "completed"
6+
priority = "normal"
7+
created = "2026-02-02T19:38:56.817948700Z"
8+
updated = "2026-02-02T19:38:56.817948700Z"
9+
+++
10+
11+
Moved the canonical config file location from project root to inside the .peas directory.
12+
13+
## Changes
14+
- New config location: `.peas/config.toml` (also supports .yml, .yaml, .json)
15+
- Legacy locations (`.peas.toml`, `.peas.yml`, etc.) still supported with deprecation warning
16+
- Deprecated `peas.path` config option - data is always stored in `.peas/`
17+
- Updated `peas init` to create config in new location
18+
- Added deprecation warnings for legacy config and `--peas-path` CLI option
19+
20+
## Migration
21+
Users with existing projects will see a deprecation warning. To migrate:
22+
1. Move `.peas.toml` to `.peas/config.toml`
23+
2. Remove the `path` option from config (it's now ignored)
24+
25+
## Benefits
26+
- Cleaner project root (only `.peas/` directory)
27+
- All peas-related files in one place
28+
- Config file is now inside the data directory it configures
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
+++
2+
id = "peas-hv5nr"
3+
title = "Add peas doctor command for health checks"
4+
type = "feature"
5+
status = "completed"
6+
priority = "normal"
7+
created = "2026-02-02T19:44:41.466851600Z"
8+
updated = "2026-02-02T19:48:24.768703800Z"
9+
+++
10+
11+
Add a `peas doctor` command that assesses the health of the peas setup and suggests fixes.
12+
13+
## Proposed checks
14+
- [ ] Config location: suggest `peas migrate` if using legacy location
15+
- [ ] Config validity: check for parse errors or invalid values
16+
- [ ] Deprecated options: warn about `path` or other deprecated settings
17+
- [ ] Schema directive: suggest adding if missing
18+
- [ ] Data directory: check if `.peas/` exists and is readable/writable
19+
- [ ] Orphaned files: detect tickets with invalid references (parent, blocking)
20+
- [ ] Duplicate IDs: check for ID collisions
21+
- [ ] Sequential ID counter: verify `.peas/.id` is in sync with existing tickets
22+
- [ ] Archive integrity: check archived tickets
23+
24+
## Usage
25+
```bash
26+
peas doctor # Run all health checks
27+
peas doctor --fix # Automatically fix issues where possible
28+
```
29+
30+
## Output format
31+
- Show ✓ for passing checks
32+
- Show ! for warnings with suggestions
33+
- Show ✗ for errors that need attention
34+
- Provide actionable fix commands where applicable

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ peas tui
9999
| `peas mutate <mutation>` | Execute a GraphQL mutation |
100100
| `peas serve` | Start GraphQL HTTP server |
101101
| `peas tui` | Open interactive TUI |
102+
| `peas migrate` | Migrate legacy config to `.peas/config.toml` (alias for focused `doctor --fix`) |
103+
| `peas doctor` | Check project health and suggest fixes (`--fix` includes migration) |
102104
| `peas import-beans` | Import from a beans project |
103105
| `peas export-beans` | Export to beans format |
104106
| `peas bulk <action>` | Bulk update multiple peas at once |
@@ -205,22 +207,23 @@ Or add to your `AGENTS.md`:
205207

206208
## Configuration
207209

208-
peas uses `.peas.toml` for configuration (also supports `.peas.yml`, `.peas.yaml`, or `.peas.json`, but TOML is preferred):
210+
peas stores configuration in `.peas/config.toml` (also supports `config.yml`, `config.yaml`, or `config.json`):
209211

210212
```toml
211213
[peas]
212-
path = ".peas" # Data directory
213214
prefix = "peas-" # ID prefix
214215
id_length = 5 # ID suffix length
215216
id_mode = "random" # ID mode: "random" (default) or "sequential"
216217
default_status = "todo"
217218
default_type = "task"
218-
frontmatter = "toml" # Frontmatter format: toml, yaml, json (TOML preferred)
219+
frontmatter = "toml" # Frontmatter format: toml, yaml (TOML preferred)
219220

220221
[tui]
221222
use_type_emojis = false # Enable emoji icons for ticket types in TUI
222223
```
223224

225+
> **Note:** Legacy config locations (`.peas.toml`, `.peas.yml`, etc. in the project root) are still supported but deprecated. Run `peas doctor --fix` or `peas migrate` to automatically move your config to the new location.
226+
224227
### ID Modes
225228

226229
- **random** (default): Generates IDs like `peas-a1b2c` using random alphanumeric characters

schemas/peas.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"description": "Core peas settings",
1717
"additionalProperties": false,
1818
"x-tombi-table-keys-order": [
19-
"path",
2019
"prefix",
2120
"id_length",
2221
"id_mode",
@@ -27,13 +26,8 @@
2726
"properties": {
2827
"path": {
2928
"type": "string",
30-
"description": "Directory where pea files are stored",
31-
"default": ".peas",
32-
"examples": [
33-
".peas",
34-
"tickets",
35-
".issues"
36-
]
29+
"description": "[DEPRECATED] This option is ignored. Data is always stored in .peas/",
30+
"deprecated": true
3731
},
3832
"prefix": {
3933
"type": "string",

src/cli/commands.rs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ pub struct Cli {
1717
#[arg(long, global = true)]
1818
pub config: Option<String>,
1919

20-
/// Path to data directory (overrides config)
21-
#[arg(long, global = true)]
20+
/// [DEPRECATED] Path to data directory - ignored, data is always in .peas/
21+
#[arg(long, global = true, hide = true)]
2222
pub peas_path: Option<String>,
2323

2424
/// Enable verbose logging (DEBUG level)
@@ -293,6 +293,24 @@ pub enum Commands {
293293
/// Open the interactive TUI
294294
Tui,
295295

296+
/// Migrate legacy config to new location (.peas/config.toml)
297+
///
298+
/// Alias for `peas doctor --fix` focused on config migration.
299+
Migrate {
300+
/// Dry run - show what would be migrated without making changes
301+
#[arg(long)]
302+
dry_run: bool,
303+
},
304+
305+
/// Check project health and suggest fixes
306+
///
307+
/// With --fix, also performs config migration (same as `peas migrate`).
308+
Doctor {
309+
/// Automatically fix issues where possible (includes migration)
310+
#[arg(long)]
311+
fix: bool,
312+
},
313+
296314
/// Import from a beans project
297315
#[command(name = "import-beans")]
298316
ImportBeans {

0 commit comments

Comments
 (0)