Skip to content

feat: add vale init command to scaffold configuration - #1201

Closed
AdamMagued wants to merge 1 commit into
vale-cli:v3from
AdamMagued:feat-issue-1156-vale-init
Closed

AdamMagued wants to merge 1 commit into
vale-cli:v3from
AdamMagued:feat-issue-1156-vale-init

Conversation

@AdamMagued

Copy link
Copy Markdown

Summary

Implements the vale init command to scaffold an initial .vale.ini configuration and the associated styles directory as requested in #1156.

Resolves #1156.

Changes

  • Added InitConfig in internal/core/config.go with DefaultConfigTemplate specifying StylesPath = styles, MinAlertLevel = suggestion, Packages = Google, and [*.{md,txt}] with BasedOnStyles = Vale, Google.
  • Scaffolds the StylesPath directory alongside the generated configuration file.
  • Validates that an existing configuration does not already exist at the target path or within the target directory (.vale.ini, vale.ini, or _vale.ini).
  • Added CLI command definition init [path] in cmd/vale/command.go and command handler initCmd in cmd/vale/main.go.
  • Added unit tests in internal/core/config_test.go and CLI command tests in cmd/vale/init_test.go covering path resolution, directory scaffolding, conflict handling, and pipeline parsing.

Verification

  • go test ./internal/core -v and go vet ./internal/core passed cleanly in container sandbox.
  • go test ./cmd/vale -v -run TestInit and go vet ./cmd/vale passed cleanly in container sandbox.

Signed-off-by: AdamMagued <adamismailmageud@gmail.com>
@github-actions

Copy link
Copy Markdown

Before this is reviewed, please read the AI-Assisted Contributions section of the contributing guide and make sure this change meets it: you can explain every line, the description is your own and brief, it fixes a bug you hit or a feature agreed in an issue, it does not touch undocumented options, and any substantial tool use is noted.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

The license agreement is signed.
Posted by the CLA Assistant Lite bot.

@AdamMagued

Copy link
Copy Markdown
Author

I have read the CLA and I agree to it

@jdkato

jdkato commented Nov 21, 2026

Copy link
Copy Markdown
Member

Closing this in favor of the two setup paths Vale already has. A useful starting config depends on the repository: which formats it has, which package fits its style, which terms belong in the vocabulary. A fixed template can't know any of that, and this one fails on its first run until vale sync installs Google.

  • vale.sh/generator builds a .vale.ini from your answers.
  • With a coding agent, /vale:setup reads the repository, writes the config, syncs the styles, and runs Vale once.

Thanks for picking up #1156.

@jdkato jdkato closed this Nov 21, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for a vale init command

2 participants