feat(cli): flag-first moose init and template recovery (514-1408) - #4063
Conversation
- Add --name and --template to moose init; keep hidden positionals for compatibility - Improve unknown-template message with moose template list --json - Update docs, E2E helpers, and template READMEs to use flag syntax - Add cli_init tests for flag forms and invalid template recovery Made-with: Cursor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📜 Recent review details⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (41)
🧰 Additional context used📓 Path-based instructions (3)**/*.rs📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
apps/framework-cli/**/*.rs📄 CodeRabbit inference engine (apps/framework-cli/AGENTS.md)
Files:
apps/framework-cli/**/tests/**/*.rs📄 CodeRabbit inference engine (apps/framework-cli/AGENTS.md)
Files:
🧠 Learnings (25)📓 Common learnings📚 Learning: 2026-04-22T18:10:52.989ZApplied to files:
📚 Learning: 2026-04-22T18:10:52.989ZApplied to files:
📚 Learning: 2026-04-22T18:10:52.989ZApplied to files:
📚 Learning: 2026-04-22T18:10:52.989ZApplied to files:
📚 Learning: 2026-04-01T07:34:38.401ZApplied to files:
📚 Learning: 2026-04-01T07:34:38.401ZApplied to files:
📚 Learning: 2026-03-09T21:19:28.424ZApplied to files:
📚 Learning: 2026-02-08T22:20:08.757ZApplied to files:
📚 Learning: 2026-02-06T01:42:40.104ZApplied to files:
📚 Learning: 2026-02-08T22:31:22.237ZApplied to files:
📚 Learning: 2026-04-23T01:59:31.717ZApplied to files:
📚 Learning: 2026-04-18T22:43:44.130ZApplied to files:
📚 Learning: 2026-04-22T18:10:52.989ZApplied to files:
📚 Learning: 2026-04-22T18:10:52.989ZApplied to files:
📚 Learning: 2026-04-22T18:10:52.989ZApplied to files:
📚 Learning: 2026-04-22T18:10:52.989ZApplied to files:
📚 Learning: 2026-03-04T22:29:17.086ZApplied to files:
📚 Learning: 2026-03-24T19:13:18.829ZApplied to files:
📚 Learning: 2025-12-16T23:08:31.521ZApplied to files:
📚 Learning: 2026-01-26T00:56:27.011ZApplied to files:
📚 Learning: 2026-03-24T19:14:21.620ZApplied to files:
📚 Learning: 2026-03-24T19:15:00.795ZApplied to files:
📚 Learning: 2025-12-16T23:08:31.521ZApplied to files:
📚 Learning: 2026-02-06T01:43:06.078ZApplied to files:
🔇 Additional comments (4)
Summary by CodeRabbit
WalkthroughMigrates Changes
Sequence Diagram(s)sequenceDiagram
participant User as User (CLI)
participant CLI as moose CLI
participant Templates as Template Registry
participant FS as Filesystem/Project Creator
User->>CLI: run `moose init --name X --template Y`
CLI->>CLI: parse flags, resolve name/template (fallback to positional)
CLI->>Templates: lookup template Y
alt template found
Templates-->>CLI: template metadata
CLI->>FS: create project files using metadata
FS-->>CLI: creation success
CLI-->>User: success message
else template missing
Templates-->>CLI: not found
CLI-->>User: "Template 'Y' not found" + hint `moose template list --json`
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/framework-cli/tests/cli_init.rs`:
- Around line 103-107: The test currently asserts that the help output contains
the legacy positional marker "[TEMPLATE]" (see the assertion using
predicate::str::contains("[TEMPLATE]") in apps/framework-cli/tests/cli_init.rs);
update the test to stop codifying the old positional form by removing that
positive assertion (or replace it with a negative assertion like
predicate::str::contains("[TEMPLATE]").not()) and instead ensure the flag-first
form is present (keep or strengthen the existing check for "--template" in the
examples such as the ".stdout(predicate::str::contains(\"--name my-app
--template typescript\"))" assertion) so the test validates the new flag-first +
hidden-legacy behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: db818550-e3ec-48d8-9fbc-c47ef90e1367
📒 Files selected for processing (36)
AGENTS.mdapps/framework-cli-e2e/test/seed-filter.test.tsapps/framework-cli-e2e/test/utils/project-setup.tsapps/framework-cli/src/cli.rsapps/framework-cli/src/cli/commands.rsapps/framework-cli/src/cli/routines/templates.rsapps/framework-cli/tests/cli_init.rsapps/framework-docs-v2/content/guides/chat-in-your-app/tutorial.mdxapps/framework-docs-v2/content/guides/data-warehouses.mdxapps/framework-docs-v2/content/guides/static-report-generation.mdxapps/framework-docs-v2/content/guides/test-guides/code-blocks.mdxapps/framework-docs-v2/content/moosestack/configuration/docker.mdxapps/framework-docs-v2/content/moosestack/contribution/documentation.mdxapps/framework-docs-v2/content/moosestack/deploying/deploying-on-an-offline-server.mdxapps/framework-docs-v2/content/moosestack/deploying/deploying-with-docker-compose.mdxapps/framework-docs-v2/content/moosestack/dev/cdc-managed-tables.mdxapps/framework-docs-v2/content/moosestack/getting-started/from-clickhouse.mdxapps/framework-docs-v2/content/moosestack/getting-started/quickstart.mdxapps/framework-docs-v2/content/moosestack/moose-cli.mdxapps/framework-docs-v2/content/moosestack/olap/alias-columns.mdxapps/framework-docs-v2/content/moosestack/olap/db-pull.mdxapps/framework-docs-v2/content/moosestack/olap/external-tables.mdxapps/framework-docs-v2/content/moosestack/olap/materialized-columns.mdxapps/framework-docs-v2/content/moosestack/release-notes/2025-12-05.mdxapps/framework-docs-v2/content/moosestack/release-notes/2026-04-09.mdxapps/framework-docs-v2/content/shared/examples/setup-example.mdxapps/framework-docs-v2/content/shared/existing-app/moose-init-workspace-ts-pnpm.mdxapps/framework-docs-v2/content/shared/guides/performant-dashboards/add-moosestack-and-set-up-fiveonefour.mdxapps/framework-docs-v2/content/templates/index.mdxapps/framework-docs-v2/src/components/mdx/command-snippet.tsxapps/framework-docs-v2/src/lib/templates.tstemplates/python-empty/README.mdtemplates/python-tests/README.mdtemplates/python/README.mdtemplates/typescript-agent/README.mdtemplates/typescript-mcp/README.md
Graphite Automations"engineering review - commercial [copy]" took an action on this PR • (04/29/26)1 reviewer was added to this PR based on Mitchell Suzuki's automation. |
- Assert init --help does not advertise [TEMPLATE] positional marker - Reword compatibility paragraph so long-help stays consistent without literal [TEMPLATE] Addresses CodeRabbit feedback on PR #4063. Made-with: Cursor
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/framework-cli/tests/cli_init.rs`:
- Around line 165-182: The repository lacks a symmetric regression test for the
name conflict; add a new test function (e.g.,
init_rejects_positional_and_flag_name_together) modeled on
init_rejects_positional_and_flag_template_together that invokes the CLI with
cmd.arg("init").arg("my-app").arg("typescript").arg("--name").arg("other-name")
(or similar positional+--name combination), asserts failure, and checks stderr
contains the conflict message (predicate::str::contains("cannot be used with"))
and the flag name predicate::str::contains("--name") to ensure the same
validation is covered for name conflicts.
- Around line 152-156: Update the test invocations that build the CLI args chain
(the cmd.arg("init") call sequences) to supply the app name via the named flag
instead of a positional argument: replace the .arg("equals-app") positional with
a named flag (e.g., .arg("--name=equals-app") or
.arg("--name").arg("equals-app")) in the cmd.arg("init") chains so the tests
exercise the flag-first parsing path (apply the same change to the second
occurrence around the other cmd.arg("init") usage).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: e625df39-c684-44d6-b3e6-9276687f9173
📒 Files selected for processing (2)
apps/framework-cli/src/cli/commands.rsapps/framework-cli/tests/cli_init.rs
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: Build CLI Binaries (darwin-arm64, macos-14-large, aarch64-apple-darwin)
- GitHub Check: Build CLI Binaries (linux-x64-glibc, ubuntu-22-8-core, x86_64-unknown-linux-gnu)
- GitHub Check: Build CLI Binaries (linux-arm64-glibc, ubuntu-22-8-core, aarch64-unknown-linux-gnu)
- GitHub Check: Package and Publish Independant TS Package
- GitHub Check: Test CLI (macos-latest-large)
- GitHub Check: Cursor Bugbot
- GitHub Check: Analyze (rust)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.rs
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Run
cargo clippyto ensure Rust code passes Clippy's linting standards before each commitFor Rust: Use
thiserrorwith#[derive(thiserror::Error)]for error handling; define errors near fallibility unit; NEVER useanyhow::ResultFor Rust: Use snake_case for functions/vars, PascalCase for types/traits, SCREAMING_SNAKE_CASE for constants
For Rust: Place constants in
constants.rsat appropriate module levelFor Rust: Use tuple structs with validation constructors for newtypes (e.g.,
struct UserId(String))For Rust: Place tests inline with
#[cfg(test)]modulesFor Rust: Documentation required for all public APIs
For Rust: Run
cargo clippy --all-targets -- -D warningspre-commit; no warnings allowed
Files:
apps/framework-cli/tests/cli_init.rsapps/framework-cli/src/cli/commands.rs
apps/framework-cli/**/*.rs
📄 CodeRabbit inference engine (apps/framework-cli/AGENTS.md)
apps/framework-cli/**/*.rs: Always runcargo clippy --all-targets -- -D warningsbefore commits; fix all warnings - no Clippy warnings may remain (treat warnings as errors)
Userustfmt --edition 2021for consistent formatting
Prefer top-of-fileusestatements over inline ones in function bodies; adduseimports for fully-qualified paths; localusefor disambiguation (e.g., name collisions) is fine
Write meaningful names for functions, variables, and types
Keep functions focused and modular
Document all public APIs and breaking changes
Usethiserrorcrate for error handling instead ofanyhow::Result
Define errors near their unit of fallibility (no global Error types)
Use#[derive(thiserror::Error)]with#[error()]messages for error structs
Structure error types as: context struct + error enum +#[source]chaining
Define newtypes as tuple structs:struct UserId(u64);
Add validation constructors for newtypes:UserId::new(id: u64) -> Result<Self, Error>
Derive standard traits for newtypes:#[derive(Debug, Clone, PartialEq)]
ImplementFrom/TryFromfor newtype conversions
Usederive_moreornutypecrates to reduce boilerplate in newtype definitions
Useconstfor static values (prefer overstatic)
UseUPPER_SNAKE_CASEnaming for constants
Scope constant visibility:pub(crate)>pub(super)>pub
Group related constants together
Write unit tests for all public functions
Test error conditions and edge cases in unit and integration tests
Files:
apps/framework-cli/tests/cli_init.rsapps/framework-cli/src/cli/commands.rs
apps/framework-cli/**/tests/**/*.rs
📄 CodeRabbit inference engine (apps/framework-cli/AGENTS.md)
Use integration tests for CLI commands
Files:
apps/framework-cli/tests/cli_init.rs
**/framework-cli/src/**
⚙️ CodeRabbit configuration file
**/framework-cli/src/**: When reviewing changes to Moose CLI:
- Check if any user-facing changes were made (commands, flags, configs, apis, etc)
- If yes, verify the documentation for THAT SPECIFIC feature is updated in apps/framework-docs-v2/content
- If docs for that feature doesn't exist yet, it should be added. If the change removes public apis, the documentation for those should also be removed. Changing unrelated docs doesn't satisfy this requirement.
Files:
apps/framework-cli/src/cli/commands.rs
🧠 Learnings (22)
📓 Common learnings
Learnt from: callicles
Repo: 514-labs/moosestack PR: 4041
File: apps/framework-cli/src/cli/logger.rs:490-494
Timestamp: 2026-04-23T01:59:31.717Z
Learning: In 514-labs/moosestack `apps/framework-cli/src/cli/logger.rs`, recursive `sweep_logs` for nested `log_file_date_format` paths (containing `/`) was explicitly considered and rejected as scope creep in PR `#4041`. The PR's intended fix is only `create_dir_all(parent)` in `open_log_writer` to prevent panics when `~/.moose/` vanishes mid-run. If nested date-format paths are ever supported, the correct approach is config-load validation (reject `/` in `log_file_date_format`), not recursive log cleanup. Do not flag absence of recursive cleanup as a bug in this or similar PRs.
Learnt from: okane16
Repo: 514-labs/moosestack PR: 0
File: :0-0
Timestamp: 2026-04-21T22:20:46.234Z
Learning: In 514-labs/moosestack PR `#4032`, the cutover that removes legacy migrate/olap pages, moves `olap/schema-versioning` to top-level, rewrites cross-refs, and adds redirects is intentionally deferred to a separate follow-up PR. This will land only after `features.migrate_with_deltas` flips to default post-beta. Do not raise concerns about missing redirects, legacy page removal, schema-versioning relocation, or cross-ref rewrites in PR `#4032` or similar additive-only delta-migration PRs.
Learnt from: LucioFranco
Repo: 514-labs/moosestack PR: 3932
File: apps/framework-cli/src/cli.rs:0-0
Timestamp: 2026-04-10T14:30:34.800Z
Learning: In 514-labs/moosestack, `moose clean` calling `shutdown_embedded_servers()` in `apps/framework-cli/src/cli.rs` only closes in-memory handles in the current process. It cannot stop embedded servers (devredis, devkafka, ClickHouse/Temporal) owned by a separate `moose dev --alpha` process. Cross-process cleanup via PID files or a control socket is a known architectural gap shared across all embedded servers, intentionally deferred and out of scope for individual feature PRs. Do not flag this as a bug requiring immediate fix.
Learnt from: oatsandsugar
Repo: 514-labs/moosestack PR: 3468
File: apps/framework-cli/src/cli/routines/docs.rs:0-0
Timestamp: 2026-02-08T22:31:22.237Z
Learning: In apps/framework-cli/src/cli/routines/**/*.rs (Moose CLI): When implementing raw output mode (--raw flag), public entry points (show_toc, fetch_page, search_toc, browse_docs) must return an empty Message (Message::new("".to_string(), "".to_string())) to prevent success messages from polluting piped output. Additionally, wrap show_message! calls in `if !raw` guards to keep intermediate messages from appearing in piped output.
Learnt from: phiSgr
Repo: 514-labs/moosestack PR: 3930
File: apps/framework-cli/src/cli/local_webserver.rs:3524-3535
Timestamp: 2026-04-08T00:08:36.251Z
Learning: In 514-labs/moosestack, the `/admin/inframap` and related `/admin/*` endpoints (e.g., `/admin/plan`, `/admin/integrate-changes`, `/admin/reality-check`) in `apps/framework-cli/src/cli/local_webserver.rs` are internal CLI-to-server communication endpoints. They are consumed programmatically by CLI routines (e.g., migration, remote-plan), not by end users. Do not flag missing framework-docs-v2 documentation for changes to these admin endpoints — the coding guideline requiring docs updates applies only to user-facing APIs, commands, flags, and configs.
Learnt from: oatsandsugar
Repo: 514-labs/moosestack PR: 3468
File: apps/framework-cli/src/cli/routines/docs.rs:40-48
Timestamp: 2026-02-07T04:42:50.188Z
Learning: In apps/framework-cli/src/cli/routines/**/*.rs (Moose CLI Rust code): Prefer inherent `from_str` methods over implementing `std::str::FromStr` trait when the conversion is only used in one place and not used with `.parse()` syntax—stylistic preference.
Learnt from: DatGuyJonathan
Repo: 514-labs/moosestack PR: 3830
File: apps/framework-cli/src/framework/core/infrastructure_map.rs:596-598
Timestamp: 2026-03-24T19:10:26.494Z
Learning: Repo 514-labs/moosestack — Moose CLI: Row policies always reference existing tables. apps/framework-cli/src/framework/core/plan_validator.rs::validate_row_policy_columns rejects policies whose tables are missing or columns don’t exist. Therefore, InfrastructureMap::uses_olap() not checking select_row_policies is acceptable because any map with policies will also have non-empty tables.
Learnt from: DatGuyJonathan
Repo: 514-labs/moosestack PR: 3400
File: apps/framework-cli/src/framework/core/infrastructure_map.rs:1238-1298
Timestamp: 2026-01-26T00:56:27.011Z
Learning: Repo 514-labs/moosestack — Workflows: The CLI’s workflow diff is intended to detect only Temporal schedule–affecting changes. In apps/framework-cli/src/framework/core/infrastructure_map.rs, workflows_config_equal should compare schedule, retries, and timeout only; it must not include tasks. Task code/config changes are picked up automatically when the orchestration worker restarts and should not trigger a WorkflowChange.
Learnt from: oatsandsugar
Repo: 514-labs/moosestack PR: 3462
File: apps/framework-cli/src/cli/routines/feedback.rs:107-119
Timestamp: 2026-02-06T01:42:40.104Z
Learning: In apps/framework-cli/src/cli/routines/**/*.rs (Moose CLI): Raw `println!` is acceptable for multi-line help text and formatted usage examples. The display wrapper (display::show_message_wrapper) is intended for status messages, not help text output.
Learnt from: oatsandsugar
Repo: 514-labs/moosestack PR: 3468
File: apps/framework-cli/src/cli/routines/docs.rs:896-942
Timestamp: 2026-02-07T06:10:41.712Z
Learning: In apps/framework-cli/src/cli/routines/**/*.rs (Moose CLI Rust code): Variable shadowing is acceptable and idiomatic when progressively refining a value through transformations (e.g., from `&str` to `String` or from raw input to processed output). This is a preferred pattern in the codebase.
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: templates/typescript-empty/AGENTS.md:0-0
Timestamp: 2026-03-31T03:46:39.081Z
Learning: Prefer MooseDev MCP tools over CLI commands — they return structured, token-optimized output
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: templates/python-webapp/AGENTS.md:0-0
Timestamp: 2026-03-31T03:46:07.879Z
Learning: Use `moose --help`, `moose docs`, `moose query`, `moose ls`, `moose peek`, and `moose logs` CLI commands for context and debugging
Learnt from: CR
Repo: 514-labs/moosestack
Timestamp: 2026-04-30T14:04:19.625Z
Learning: Always run end-to-end tests when changing MooseStack functionality
Learnt from: CR
Repo: 514-labs/moosestack
Timestamp: 2026-04-30T14:04:19.625Z
Learning: When changing user-facing features, add E2E tests to `python-tests` and `typescript-tests` templates AND audit documentation
Learnt from: CR
Repo: 514-labs/moosestack
Timestamp: 2026-04-30T14:04:19.625Z
Learning: Always format the code
📚 Learning: 2026-04-22T18:10:52.989Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2026-04-22T18:10:52.989Z
Learning: Applies to apps/framework-cli/**/tests/**/*.rs : Use integration tests for CLI commands
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-04-22T18:10:52.989Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2026-04-22T18:10:52.989Z
Learning: Applies to apps/framework-cli/**/*.rs : Test error conditions and edge cases in unit and integration tests
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-02-08T22:20:08.757Z
Learnt from: oatsandsugar
Repo: 514-labs/moosestack PR: 3468
File: apps/framework-cli/src/cli/routines/docs.rs:1590-1838
Timestamp: 2026-02-08T22:20:08.757Z
Learning: In apps/framework-cli/src/cli/routines/**/*.rs (Moose CLI): For HTTP-dependent functionality like `fetch_docs`, prefer E2E or integration tests over unit tests. Unit testing HTTP fetching adds little value compared to integration testing and can be flaky due to network dependencies.
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-02-06T01:42:40.104Z
Learnt from: oatsandsugar
Repo: 514-labs/moosestack PR: 3462
File: apps/framework-cli/src/cli/routines/feedback.rs:107-119
Timestamp: 2026-02-06T01:42:40.104Z
Learning: In apps/framework-cli/src/cli/routines/**/*.rs (Moose CLI): Raw `println!` is acceptable for multi-line help text and formatted usage examples. The display wrapper (display::show_message_wrapper) is intended for status messages, not help text output.
Applied to files:
apps/framework-cli/tests/cli_init.rsapps/framework-cli/src/cli/commands.rs
📚 Learning: 2026-04-22T18:10:52.989Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2026-04-22T18:10:52.989Z
Learning: Applies to apps/framework-cli/**/*.rs : Write unit tests for all public functions
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-04-22T18:10:52.989Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2026-04-22T18:10:52.989Z
Learning: Applies to apps/framework-cli/**/*.rs : Document all public APIs and breaking changes
Applied to files:
apps/framework-cli/tests/cli_init.rsapps/framework-cli/src/cli/commands.rs
📚 Learning: 2026-04-01T07:34:51.710Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: templates/typescript-agent/packages/moosestack-service/AGENTS.md:0-0
Timestamp: 2026-04-01T07:34:51.710Z
Learning: Applies to templates/typescript-agent/packages/moosestack-service/app/**/*.{ts,tsx} : Search for `EXAMPLE_APP_ONLY:` markers to identify which service files are safe to delete or rewrite first when replacing the seeded demo model
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-04-22T18:10:52.989Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2026-04-22T18:10:52.989Z
Learning: Applies to apps/framework-cli/**/*.rs : Write meaningful names for functions, variables, and types
Applied to files:
apps/framework-cli/tests/cli_init.rsapps/framework-cli/src/cli/commands.rs
📚 Learning: 2026-03-31T03:47:23.245Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: templates/typescript/AGENTS.md:0-0
Timestamp: 2026-03-31T03:47:23.245Z
Learning: Applies to templates/typescript/app/index.ts : Export new primitives from the app's entry file (`app/index.ts`) to ensure MooseStack discovers them
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-03-31T03:46:50.753Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: templates/typescript-express/AGENTS.md:0-0
Timestamp: 2026-03-31T03:46:50.753Z
Learning: Applies to templates/typescript-express/app/index.ts : Export all new primitives (data models, pipelines, APIs, workflows) from `app/index.ts` to ensure MooseStack discovery
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-02-08T22:31:22.237Z
Learnt from: oatsandsugar
Repo: 514-labs/moosestack PR: 3468
File: apps/framework-cli/src/cli/routines/docs.rs:0-0
Timestamp: 2026-02-08T22:31:22.237Z
Learning: In apps/framework-cli/src/cli/routines/**/*.rs (Moose CLI): When implementing raw output mode (--raw flag), public entry points (show_toc, fetch_page, search_toc, browse_docs) must return an empty Message (Message::new("".to_string(), "".to_string())) to prevent success messages from polluting piped output. Additionally, wrap show_message! calls in `if !raw` guards to keep intermediate messages from appearing in piped output.
Applied to files:
apps/framework-cli/tests/cli_init.rsapps/framework-cli/src/cli/commands.rs
📚 Learning: 2026-04-23T01:59:31.717Z
Learnt from: callicles
Repo: 514-labs/moosestack PR: 4041
File: apps/framework-cli/src/cli/logger.rs:490-494
Timestamp: 2026-04-23T01:59:31.717Z
Learning: In 514-labs/moosestack `apps/framework-cli/src/cli/logger.rs`, recursive `sweep_logs` for nested `log_file_date_format` paths (containing `/`) was explicitly considered and rejected as scope creep in PR `#4041`. The PR's intended fix is only `create_dir_all(parent)` in `open_log_writer` to prevent panics when `~/.moose/` vanishes mid-run. If nested date-format paths are ever supported, the correct approach is config-load validation (reject `/` in `log_file_date_format`), not recursive log cleanup. Do not flag absence of recursive cleanup as a bug in this or similar PRs.
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-04-18T22:43:44.130Z
Learnt from: callicles
Repo: 514-labs/moosestack PR: 4024
File: apps/framework-cli/src/utilities/native_infra/preflight.rs:53-95
Timestamp: 2026-04-18T22:43:44.130Z
Learning: In `apps/framework-cli/src/utilities/native_infra/preflight.rs` (`PortConflictError::fmt`), `same_project_instance` uses `.any(|c| c.owner_pid.is_some())` intentionally. Only ClickHouse and Temporal write PID files; devredis, devkafka, http, management, and proxy_port ports are never attributed. Switching to `.all()` makes the check structurally unachievable for any realistic conflict set, causing the "another moose project" footer to always render even when attributed PIDs are present — a self-contradictory message. Do not suggest changing `.any()` to `.all()` here.
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-02-06T01:43:06.078Z
Learnt from: oatsandsugar
Repo: 514-labs/moosestack PR: 3462
File: apps/framework-cli/src/cli/routines/feedback.rs:40-72
Timestamp: 2026-02-06T01:43:06.078Z
Learning: In the Moose framework-cli (Rust), the telemetry functions capture_usage and wait_for_usage_capture use a fire-and-forget pattern: errors are logged internally and not surfaced to users. This behavior is intentional across all commands. Do not change error propagation for individual commands; any modification requires a broad refactor across the CLI telemetry layer. During reviews, treat changes to telemetry error reporting as high risk and scope changes to capture_usage/wait_for_usage_capture to the entire framework-cli, not single commands.
Applied to files:
apps/framework-cli/tests/cli_init.rsapps/framework-cli/src/cli/commands.rs
📚 Learning: 2026-02-07T04:42:50.188Z
Learnt from: oatsandsugar
Repo: 514-labs/moosestack PR: 3468
File: apps/framework-cli/src/cli/routines/docs.rs:40-48
Timestamp: 2026-02-07T04:42:50.188Z
Learning: In apps/framework-cli/src/cli/routines/**/*.rs (Moose CLI Rust code): Prefer inherent `from_str` methods over implementing `std::str::FromStr` trait when the conversion is only used in one place and not used with `.parse()` syntax—stylistic preference.
Applied to files:
apps/framework-cli/src/cli/commands.rs
📚 Learning: 2026-02-07T06:10:41.712Z
Learnt from: oatsandsugar
Repo: 514-labs/moosestack PR: 3468
File: apps/framework-cli/src/cli/routines/docs.rs:896-942
Timestamp: 2026-02-07T06:10:41.712Z
Learning: In apps/framework-cli/src/cli/routines/**/*.rs (Moose CLI Rust code): Variable shadowing is acceptable and idiomatic when progressively refining a value through transformations (e.g., from `&str` to `String` or from raw input to processed output). This is a preferred pattern in the codebase.
Applied to files:
apps/framework-cli/src/cli/commands.rs
📚 Learning: 2026-04-08T00:08:36.251Z
Learnt from: phiSgr
Repo: 514-labs/moosestack PR: 3930
File: apps/framework-cli/src/cli/local_webserver.rs:3524-3535
Timestamp: 2026-04-08T00:08:36.251Z
Learning: In 514-labs/moosestack, the `/admin/inframap` and related `/admin/*` endpoints (e.g., `/admin/plan`, `/admin/integrate-changes`, `/admin/reality-check`) in `apps/framework-cli/src/cli/local_webserver.rs` are internal CLI-to-server communication endpoints. They are consumed programmatically by CLI routines (e.g., migration, remote-plan), not by end users. Do not flag missing framework-docs-v2 documentation for changes to these admin endpoints — the coding guideline requiring docs updates applies only to user-facing APIs, commands, flags, and configs.
Applied to files:
apps/framework-cli/src/cli/commands.rs
📚 Learning: 2026-02-07T04:42:43.495Z
Learnt from: oatsandsugar
Repo: 514-labs/moosestack PR: 3468
File: apps/framework-cli/src/cli/routines/docs.rs:863-909
Timestamp: 2026-02-07T04:42:43.495Z
Learning: In apps/framework-cli/src/cli/routines/docs.rs: macOS and Linux are primary target platforms; Windows is a best-effort fallback and not a primary target for the Moose CLI.
Applied to files:
apps/framework-cli/src/cli/commands.rs
📚 Learning: 2026-03-31T03:46:07.879Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: templates/python-webapp/AGENTS.md:0-0
Timestamp: 2026-03-31T03:46:07.879Z
Learning: Use `moose --help`, `moose docs`, `moose query`, `moose ls`, `moose peek`, and `moose logs` CLI commands for context and debugging
Applied to files:
apps/framework-cli/src/cli/commands.rs
📚 Learning: 2026-03-31T03:46:39.081Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: templates/typescript-empty/AGENTS.md:0-0
Timestamp: 2026-03-31T03:46:39.081Z
Learning: Prefer MooseDev MCP tools over CLI commands — they return structured, token-optimized output
Applied to files:
apps/framework-cli/src/cli/commands.rs
📚 Learning: 2026-02-07T04:42:43.608Z
Learnt from: oatsandsugar
Repo: 514-labs/moosestack PR: 3468
File: apps/framework-cli/src/cli/routines/docs.rs:878-887
Timestamp: 2026-02-07T04:42:43.608Z
Learning: For the Moose CLI under apps/framework-cli, document and implement that Windows support is best-effort only, while macOS (open) and Linux (xdg-open) are the primary targets. Treat Windows-specific code paths (e.g., using cmd /c start) as fallback implementations and ensure they are not required to be as robust as the primary platforms. When adding Windows fallbacks, include clear caveats, avoid blocking on Windows-specific behavior, and add appropriate runtime checks, logs, and TODOs. This guidance applies to Rust source files under apps/framework-cli/src (and adjacent Rust files in the same module) to keep Windows handling clearly scoped and maintainable.
Applied to files:
apps/framework-cli/src/cli/commands.rs
🔇 Additional comments (1)
apps/framework-cli/src/cli/commands.rs (1)
30-64: Flag-firstinitcontract looks solid.The
ArgGroup+ hidden positional compatibility + explicit conflicts cleanly enforce the new--name/--templateprimary path without breaking legacy calls.
- Use --name in equals-style and unknown-template flag tests - Add init_rejects_positional_and_flag_name_together (symmetric to template) Addresses CodeRabbit feedback on PR #4063. Made-with: Cursor
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/framework-cli/tests/cli_init.rs`:
- Around line 143-163: The test function
can_run_cli_init_with_equals_style_template_flag currently only asserts
package.json; strengthen it by also asserting the scaffolded app directory and
config file exist: after running the Command in
can_run_cli_init_with_equals_style_template_flag, add assertions similar to
other success-path tests to check
temp.child("app").assert(predicate::path::exists()) and
temp.child("moose.config.toml").assert(predicate::path::exists()), ensuring the
equals-style template flag produces the full scaffold.
- Around line 222-225: After asserting failure on unknown template via
cmd.assert().failure().stdout(...), add assertions that the target directory
used for init in this test (the tempdir variable used when constructing the cmd)
contains no scaffold files and/or is empty; specifically check that expected
scaffold artifacts (e.g., known filenames your init normally creates) do not
exist and/or that the directory read_dir().next() is None, so the init failure
is side-effect free. Use the same tempdir variable from this test and standard
fs checks (Path::exists / read_dir) to verify no files were created.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: b9ac675c-45af-4602-a2cb-4155d669c12f
📒 Files selected for processing (1)
apps/framework-cli/tests/cli_init.rs
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: Build CLI Binaries (linux-x64-glibc, ubuntu-22-8-core, x86_64-unknown-linux-gnu)
- GitHub Check: Build CLI Binaries (linux-arm64-glibc, ubuntu-22-8-core, aarch64-unknown-linux-gnu)
- GitHub Check: Build CLI Binaries (darwin-arm64, macos-14-large, aarch64-apple-darwin)
- GitHub Check: Package and Publish Independant TS Package
- GitHub Check: Check
- GitHub Check: Cursor Bugbot
- GitHub Check: Analyze (rust)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.rs
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Run
cargo clippyto ensure Rust code passes Clippy's linting standards before each commitRust: Use
thiserrorwith#[derive(thiserror::Error)]for error handling; define errors near the fallibility unit; never useanyhow::ResultRust: Use snake_case for functions and variables, PascalCase for types and traits, SCREAMING_SNAKE_CASE for constants
Rust: Place constants in
constants.rsat the appropriate module levelRust: Use tuple structs with validation constructors for newtypes (e.g.,
struct UserId(String))Rust: Include tests inline with
#[cfg(test)]modulesRust: Documentation is required for all public APIs
Rust: Run
cargo clippy --all-targets -- -D warningspre-commit; no warnings allowed
Files:
apps/framework-cli/tests/cli_init.rs
apps/framework-cli/**/*.rs
📄 CodeRabbit inference engine (apps/framework-cli/AGENTS.md)
apps/framework-cli/**/*.rs: Always runcargo clippy --all-targets -- -D warningsbefore commits; fix all warnings - no Clippy warnings may remain (treat warnings as errors)
Userustfmt --edition 2021for consistent formatting
Prefer top-of-fileusestatements over inline ones in function bodies; adduseimports for fully-qualified paths; localusefor disambiguation (e.g., name collisions) is fine
Write meaningful names for functions, variables, and types
Keep functions focused and modular
Document all public APIs and breaking changes
Usethiserrorcrate for error handling instead ofanyhow::Result
Define errors near their unit of fallibility (no global Error types)
Use#[derive(thiserror::Error)]with#[error()]messages for error structs
Structure error types as: context struct + error enum +#[source]chaining
Define newtypes as tuple structs:struct UserId(u64);
Add validation constructors for newtypes:UserId::new(id: u64) -> Result<Self, Error>
Derive standard traits for newtypes:#[derive(Debug, Clone, PartialEq)]
ImplementFrom/TryFromfor newtype conversions
Usederive_moreornutypecrates to reduce boilerplate in newtype definitions
Useconstfor static values (prefer overstatic)
UseUPPER_SNAKE_CASEnaming for constants
Scope constant visibility:pub(crate)>pub(super)>pub
Group related constants together
Write unit tests for all public functions
Test error conditions and edge cases in unit and integration tests
Files:
apps/framework-cli/tests/cli_init.rs
apps/framework-cli/**/tests/**/*.rs
📄 CodeRabbit inference engine (apps/framework-cli/AGENTS.md)
Use integration tests for CLI commands
Files:
apps/framework-cli/tests/cli_init.rs
🧠 Learnings (16)
📓 Common learnings
Learnt from: callicles
Repo: 514-labs/moosestack PR: 4041
File: apps/framework-cli/src/cli/logger.rs:490-494
Timestamp: 2026-04-23T01:59:31.717Z
Learning: In 514-labs/moosestack `apps/framework-cli/src/cli/logger.rs`, recursive `sweep_logs` for nested `log_file_date_format` paths (containing `/`) was explicitly considered and rejected as scope creep in PR `#4041`. The PR's intended fix is only `create_dir_all(parent)` in `open_log_writer` to prevent panics when `~/.moose/` vanishes mid-run. If nested date-format paths are ever supported, the correct approach is config-load validation (reject `/` in `log_file_date_format`), not recursive log cleanup. Do not flag absence of recursive cleanup as a bug in this or similar PRs.
Learnt from: DatGuyJonathan
Repo: 514-labs/moosestack PR: 3830
File: apps/framework-cli/src/framework/core/infrastructure_map.rs:596-598
Timestamp: 2026-03-24T19:10:26.494Z
Learning: Repo 514-labs/moosestack — Moose CLI: Row policies always reference existing tables. apps/framework-cli/src/framework/core/plan_validator.rs::validate_row_policy_columns rejects policies whose tables are missing or columns don’t exist. Therefore, InfrastructureMap::uses_olap() not checking select_row_policies is acceptable because any map with policies will also have non-empty tables.
Learnt from: LucioFranco
Repo: 514-labs/moosestack PR: 3932
File: apps/framework-cli/src/cli.rs:0-0
Timestamp: 2026-04-10T14:30:34.800Z
Learning: In 514-labs/moosestack, `moose clean` calling `shutdown_embedded_servers()` in `apps/framework-cli/src/cli.rs` only closes in-memory handles in the current process. It cannot stop embedded servers (devredis, devkafka, ClickHouse/Temporal) owned by a separate `moose dev --alpha` process. Cross-process cleanup via PID files or a control socket is a known architectural gap shared across all embedded servers, intentionally deferred and out of scope for individual feature PRs. Do not flag this as a bug requiring immediate fix.
Learnt from: okane16
Repo: 514-labs/moosestack PR: 0
File: :0-0
Timestamp: 2026-04-21T22:20:46.234Z
Learning: In 514-labs/moosestack PR `#4032`, the cutover that removes legacy migrate/olap pages, moves `olap/schema-versioning` to top-level, rewrites cross-refs, and adds redirects is intentionally deferred to a separate follow-up PR. This will land only after `features.migrate_with_deltas` flips to default post-beta. Do not raise concerns about missing redirects, legacy page removal, schema-versioning relocation, or cross-ref rewrites in PR `#4032` or similar additive-only delta-migration PRs.
Learnt from: DatGuyJonathan
Repo: 514-labs/moosestack PR: 3400
File: apps/framework-cli/src/framework/core/infrastructure_map.rs:1238-1298
Timestamp: 2026-01-26T00:56:27.011Z
Learning: Repo 514-labs/moosestack — Workflows: The CLI’s workflow diff is intended to detect only Temporal schedule–affecting changes. In apps/framework-cli/src/framework/core/infrastructure_map.rs, workflows_config_equal should compare schedule, retries, and timeout only; it must not include tasks. Task code/config changes are picked up automatically when the orchestration worker restarts and should not trigger a WorkflowChange.
Learnt from: oatsandsugar
Repo: 514-labs/moosestack PR: 3468
File: apps/framework-cli/src/cli/routines/docs.rs:40-48
Timestamp: 2026-02-07T04:42:50.188Z
Learning: In apps/framework-cli/src/cli/routines/**/*.rs (Moose CLI Rust code): Prefer inherent `from_str` methods over implementing `std::str::FromStr` trait when the conversion is only used in one place and not used with `.parse()` syntax—stylistic preference.
Learnt from: cjus
Repo: 514-labs/moosestack PR: 3684
File: apps/framework-cli/src/framework/core/infrastructure_map.rs:0-0
Timestamp: 2026-03-04T22:31:33.997Z
Learning: Repo 514-labs/moosestack — In apps/framework-cli/src/framework/core/infrastructure_map.rs, InfrastructureMap::to_proto serializes select_row_policies and InfrastructureMap::from_proto deserializes them back into the map. Proto/Redis round-trips now preserve row policies; do not flag select_row_policies as being dropped on load in future reviews.
Learnt from: oatsandsugar
Repo: 514-labs/moosestack PR: 3468
File: apps/framework-cli/src/cli/routines/docs.rs:0-0
Timestamp: 2026-02-08T22:31:22.237Z
Learning: In apps/framework-cli/src/cli/routines/**/*.rs (Moose CLI): When implementing raw output mode (--raw flag), public entry points (show_toc, fetch_page, search_toc, browse_docs) must return an empty Message (Message::new("".to_string(), "".to_string())) to prevent success messages from polluting piped output. Additionally, wrap show_message! calls in `if !raw` guards to keep intermediate messages from appearing in piped output.
Learnt from: phiSgr
Repo: 514-labs/moosestack PR: 3930
File: apps/framework-cli/src/cli/local_webserver.rs:3524-3535
Timestamp: 2026-04-08T00:08:36.251Z
Learning: In 514-labs/moosestack, the `/admin/inframap` and related `/admin/*` endpoints (e.g., `/admin/plan`, `/admin/integrate-changes`, `/admin/reality-check`) in `apps/framework-cli/src/cli/local_webserver.rs` are internal CLI-to-server communication endpoints. They are consumed programmatically by CLI routines (e.g., migration, remote-plan), not by end users. Do not flag missing framework-docs-v2 documentation for changes to these admin endpoints — the coding guideline requiring docs updates applies only to user-facing APIs, commands, flags, and configs.
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: templates/typescript-empty/AGENTS.md:0-0
Timestamp: 2026-03-31T03:46:39.081Z
Learning: Prefer MooseDev MCP tools over CLI commands — they return structured, token-optimized output
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: templates/python-webapp/AGENTS.md:0-0
Timestamp: 2026-03-31T03:46:07.879Z
Learning: Use `moose --help`, `moose docs`, `moose query`, `moose ls`, `moose peek`, and `moose logs` CLI commands for context and debugging
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-09T21:19:28.424Z
Learning: When changing MooseStack functionality, ALWAYS run end-to-end tests
Learnt from: CR
Repo: 514-labs/moosestack
Timestamp: 2026-04-30T14:24:02.413Z
Learning: Always run end-to-end tests when changing MooseStack functionality
Learnt from: CR
Repo: 514-labs/moosestack
Timestamp: 2026-04-30T14:24:02.413Z
Learning: When changing user-facing features, add E2E tests to `python-tests` and `typescript-tests` templates and audit documentation
Learnt from: CR
Repo: 514-labs/moosestack
Timestamp: 2026-04-30T14:24:02.413Z
Learning: Always format the code
Learnt from: CR
Repo: 514-labs/moosestack
Timestamp: 2026-04-30T14:24:02.413Z
Learning: When working with MooseStack ClickHouse schemas, queries, or configurations, reference the `moosestack-clickhouse-best-practices` skill for rules on schema design, query optimization, and insert strategy
Learnt from: CR
Repo: 514-labs/moosestack
Timestamp: 2026-04-30T14:24:02.413Z
Learning: Promote flag-first `moose init` style in documentation and examples: `moose init --name <name> --template <template>`; treat legacy positional form as backward-compatible only
Learnt from: CR
Repo: 514-labs/moosestack
Timestamp: 2026-04-30T14:24:02.413Z
Learning: For `moose dev --dockerless`, show this option when the Docker runtime is unavailable; do not suggest it for unrelated infrastructure failures
📚 Learning: 2026-04-22T18:10:52.989Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2026-04-22T18:10:52.989Z
Learning: Applies to apps/framework-cli/**/*.rs : Test error conditions and edge cases in unit and integration tests
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-04-22T18:10:52.989Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2026-04-22T18:10:52.989Z
Learning: Applies to apps/framework-cli/**/tests/**/*.rs : Use integration tests for CLI commands
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-02-06T01:42:40.104Z
Learnt from: oatsandsugar
Repo: 514-labs/moosestack PR: 3462
File: apps/framework-cli/src/cli/routines/feedback.rs:107-119
Timestamp: 2026-02-06T01:42:40.104Z
Learning: In apps/framework-cli/src/cli/routines/**/*.rs (Moose CLI): Raw `println!` is acceptable for multi-line help text and formatted usage examples. The display wrapper (display::show_message_wrapper) is intended for status messages, not help text output.
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-04-22T18:10:52.989Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2026-04-22T18:10:52.989Z
Learning: Applies to apps/framework-cli/**/*.rs : Document all public APIs and breaking changes
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-04-22T18:10:52.989Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2026-04-22T18:10:52.989Z
Learning: Applies to apps/framework-cli/**/*.rs : Write unit tests for all public functions
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-02-08T22:31:22.237Z
Learnt from: oatsandsugar
Repo: 514-labs/moosestack PR: 3468
File: apps/framework-cli/src/cli/routines/docs.rs:0-0
Timestamp: 2026-02-08T22:31:22.237Z
Learning: In apps/framework-cli/src/cli/routines/**/*.rs (Moose CLI): When implementing raw output mode (--raw flag), public entry points (show_toc, fetch_page, search_toc, browse_docs) must return an empty Message (Message::new("".to_string(), "".to_string())) to prevent success messages from polluting piped output. Additionally, wrap show_message! calls in `if !raw` guards to keep intermediate messages from appearing in piped output.
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-04-23T01:59:31.717Z
Learnt from: callicles
Repo: 514-labs/moosestack PR: 4041
File: apps/framework-cli/src/cli/logger.rs:490-494
Timestamp: 2026-04-23T01:59:31.717Z
Learning: In 514-labs/moosestack `apps/framework-cli/src/cli/logger.rs`, recursive `sweep_logs` for nested `log_file_date_format` paths (containing `/`) was explicitly considered and rejected as scope creep in PR `#4041`. The PR's intended fix is only `create_dir_all(parent)` in `open_log_writer` to prevent panics when `~/.moose/` vanishes mid-run. If nested date-format paths are ever supported, the correct approach is config-load validation (reject `/` in `log_file_date_format`), not recursive log cleanup. Do not flag absence of recursive cleanup as a bug in this or similar PRs.
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-04-18T22:43:44.130Z
Learnt from: callicles
Repo: 514-labs/moosestack PR: 4024
File: apps/framework-cli/src/utilities/native_infra/preflight.rs:53-95
Timestamp: 2026-04-18T22:43:44.130Z
Learning: In `apps/framework-cli/src/utilities/native_infra/preflight.rs` (`PortConflictError::fmt`), `same_project_instance` uses `.any(|c| c.owner_pid.is_some())` intentionally. Only ClickHouse and Temporal write PID files; devredis, devkafka, http, management, and proxy_port ports are never attributed. Switching to `.all()` makes the check structurally unachievable for any realistic conflict set, causing the "another moose project" footer to always render even when attributed PIDs are present — a self-contradictory message. Do not suggest changing `.any()` to `.all()` here.
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-04-22T18:10:52.989Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2026-04-22T18:10:52.989Z
Learning: Applies to apps/framework-cli/**/*.rs : Write meaningful names for functions, variables, and types
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-04-22T18:10:52.989Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2026-04-22T18:10:52.989Z
Learning: Applies to apps/framework-cli/**/*.rs : Prefer top-of-file `use` statements over inline ones in function bodies; add `use` imports for fully-qualified paths; local `use` for disambiguation (e.g., name collisions) is fine
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-04-22T18:10:52.989Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2026-04-22T18:10:52.989Z
Learning: Applies to apps/framework-cli/**/*.rs : Use `rustfmt --edition 2021` for consistent formatting
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-04-22T18:10:52.989Z
Learnt from: CR
Repo: 514-labs/moosestack PR: 0
File: apps/framework-cli/AGENTS.md:0-0
Timestamp: 2026-04-22T18:10:52.989Z
Learning: Applies to apps/framework-cli/**/*.rs : Use `UPPER_SNAKE_CASE` naming for constants
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-03-04T22:29:17.086Z
Learnt from: cjus
Repo: 514-labs/moosestack PR: 3684
File: apps/framework-cli/src/framework/core/execute.rs:130-136
Timestamp: 2026-03-04T22:29:17.086Z
Learning: In apps/framework-cli/src/framework/core/plan_validator.rs, `validate_row_policy_columns` enforces at build time that no two SelectRowPolicy instances on the same column have conflicting JWT claim mappings. This means the `row_policies_config` HashMap construction in `execute_initial_infra_change` (execute.rs) cannot silently overwrite conflicting claims — the plan would have already been rejected. Do not flag the collect() as a silent-duplicate risk.
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-03-24T19:13:18.829Z
Learnt from: DatGuyJonathan
Repo: 514-labs/moosestack PR: 3830
File: apps/framework-cli/src/cli/routines/migrate.rs:363-366
Timestamp: 2026-03-24T19:13:18.829Z
Learning: In `apps/framework-cli/src/cli/routines/migrate.rs`, the `CreateRowPolicy`/`DropRowPolicy` branches in `validate_table_databases_and_clusters` (which skip cluster validation) are intentionally covered by E2E tests in `apps/framework-cli-e2e/test/row-level-security.test.ts` rather than by dedicated unit tests in `migrate.rs`. Do not request additional unit tests for these branches.
Applied to files:
apps/framework-cli/tests/cli_init.rs
📚 Learning: 2026-02-06T01:43:06.078Z
Learnt from: oatsandsugar
Repo: 514-labs/moosestack PR: 3462
File: apps/framework-cli/src/cli/routines/feedback.rs:40-72
Timestamp: 2026-02-06T01:43:06.078Z
Learning: In the Moose framework-cli (Rust), the telemetry functions capture_usage and wait_for_usage_capture use a fire-and-forget pattern: errors are logged internally and not surfaced to users. This behavior is intentional across all commands. Do not change error propagation for individual commands; any modification requires a broad refactor across the CLI telemetry layer. During reviews, treat changes to telemetry error reporting as high risk and scope changes to capture_usage/wait_for_usage_capture to the entire framework-cli, not single commands.
Applied to files:
apps/framework-cli/tests/cli_init.rs
🔇 Additional comments (3)
apps/framework-cli/tests/cli_init.rs (3)
103-107: Help output assertions match the flag-first direction.Good checks for hiding legacy positional template markers and surfacing preferred flag-based examples.
114-139: Flag-based init happy-path coverage looks solid.This directly exercises
--name+--templateand verifies generated artifacts.
168-201: Conflict regression coverage for--templateand--nameis well scoped.These tests pin the mutual-exclusion behavior and assert the relevant flag appears in the error.
This comment has been minimized.
This comment has been minimized.
- Assert app/ and moose.config.toml on equals-template success path - Assert no scaffold artifacts after unknown-template failure Addresses CodeRabbit feedback on PR #4063. Made-with: Cursor
Summary
Improves
moose initso agents and scripts can use--nameand--template(including--template=value) without Clap rejecting the flag form. Legacy positionals remain supported but are hidden from primary help; docs and examples use the flag syntax. Unknown-template errors now point tomoose template listandmoose template list --json.Linear
Testing
cargo test -p moose-cli --test cli_initcargo clippy -p moose-cli --all-targets -- -D warningsMade with Cursor
Note
Medium Risk
Moderate risk because it changes
moose initargument parsing/validation (clap groups, conflicts, required args), which could break existing scripts or edge-case invocations despite keeping legacy positionals.Overview
Updates
moose initto be flag-first, adding--nameand--template(including--template=...) as the preferred interface while keeping the legacy positional name/template inputs as hidden, backward-compatible arguments.Improves
init --helpto promote flag-based examples and adds new CLI tests covering flag usage, conflict cases (positional+flag), and unknown-template recovery messaging.Enhances unknown-template errors to point users/agents to
moose template listandmoose template list --json, and updates E2E setup code, docs, and template READMEs to use the new flag-basedinitsyntax throughout.Reviewed by Cursor Bugbot for commit bd4ef55. Bugbot is set up for automated code reviews on this repo. Configure here.