feat: description prompt, default port fix, v0.13.0#115
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When running `tari template init`, checks if [package].description exists in Cargo.toml. If missing, prompts the user for one and writes it to [package].description (where the metadata crate reads it from). Also available as --description flag for non-interactive use. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- tari template init now prompts for description if [package].description is missing and writes it there - Updated CLI commands and config schema docs - Default walletd port updated to 5100 - Bump workspace version to 0.13.0 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request bumps the project version to 0.13.0 and introduces a new description field for template metadata, which is now prompted during initialization and stored in Cargo.toml. Additionally, the default wallet daemon port has been updated from 9000 to 5100 across the CLI and documentation. Review feedback highlights inconsistencies in the documentation where configuration keys were changed to kebab-case, which would prevent them from being parsed correctly, and identifies a redundant synchronous file read in an asynchronous function that should be optimized.
| # default-account = "myaccount" | ||
| # metadata-server-url = "http://localhost:3000" | ||
| # template-address = "template_abc123..." |
There was a problem hiding this comment.
The configuration keys in the documentation are inconsistent with the code. The ProjectConfig struct in crates/cli/src/project/config.rs uses underscores for field names (e.g., default_account, metadata_server_url, template_address), and there is no rename_all attribute to convert them to kebab-case. Using hyphens in the configuration file will cause these settings to be ignored by the parser.
| # default-account = "myaccount" | |
| # metadata-server-url = "http://localhost:3000" | |
| # template-address = "template_abc123..." | |
| # default_account = "myaccount" | |
| # metadata_server_url = "http://localhost:3000" | |
| # template_address = "template_abc123..." |
| | `default-account` | String | None | Default wallet account | | ||
| | `metadata-server-url` | URL | None | Metadata server URL | | ||
| | `template-address` | Address | None | Template address (saved automatically by `tari publish`) | |
There was a problem hiding this comment.
These table entries should use underscores to match the field names in the ProjectConfig struct, ensuring that users who copy-paste from the documentation have a working configuration.
| | `default-account` | String | None | Default wallet account | | |
| | `metadata-server-url` | URL | None | Metadata server URL | | |
| | `template-address` | Address | None | Template address (saved automatically by `tari publish`) | | |
| | `default_account` | String | None | Default wallet account | | |
| | `metadata_server_url` | URL | None | Metadata server URL | | |
| | `template_address` | Address | None | Template address (saved automatically by `tari publish`) | |
| // Check if [package].description already exists | ||
| let cargo_toml_path = args.path.join("Cargo.toml"); | ||
| let has_description = if cargo_toml_path.exists() { | ||
| let content = std::fs::read_to_string(&cargo_toml_path)?; |
There was a problem hiding this comment.
This line performs a redundant synchronous file read. The handle function (the caller) has already read the contents of Cargo.toml into cargo_toml_content at line 65. Additionally, using std::fs in an async context blocks the executor thread, which should be avoided. Consider passing the already-read content or a parsed DocumentMut to this function.
Summary
tari template initnow prompts for description if[package].descriptionis missing from Cargo.toml, and writes it there (also available as--descriptionflag)Test plan
cargo checkpassescargo test— all 7 tests passtari template initon a crate without description prompts for onetari template initon a crate with description skips the prompt🤖 Generated with Claude Code