Skip to content

feat(init): add language option - #1685

Open
clay-good wants to merge 3 commits into
Fission-AI:mainfrom
clay-good:codex/add-init-language
Open

feat(init): add language option#1685
clay-good wants to merge 3 commits into
Fission-AI:mainfrom
clay-good:codex/add-init-language

Conversation

@clay-good

@clay-good clay-good commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Status

LGTM.

What was missing / the motivation

OpenSpec already supports non-English artifacts through project context, but new projects had to edit openspec/config.yaml by hand. Issue #1049 asks for a non-interactive initialization option.

What it does

  • Adds openspec init --language <language>.
  • Adds language guidance only when creating a new config.
  • Keeps OpenSpec headings and SHALL/MUST keywords in English so generated artifacts remain valid.
  • Preserves existing .yaml and .yml configs and external-store pointers without mutation.
  • Rejects multiline, deceptive Unicode formatting, control-character, and oversized values before writing files.
  • Fails before tool setup when the requested language config is unwritable or unsafe to access.
  • Adds the flag to shell completions and documents both CLI and manual setup.

Proof it works

  • pnpm build
  • pnpm lint
  • openspec validate cli-init --type spec --strict
  • 197 focused unit, config, completion, external-store, and packaged CLI E2E tests pass.
  • Packaged CLI E2E proves the parsed language context reaches resolved artifact instructions.
  • Built-CLI adversarial tests cover read-only config directories and dangling config symlinks without unrelated mutations.
  • Boundary tests prove a context at exactly 50KB remains readable and the next byte is rejected.
  • Repeat initialization leaves the generated config byte-for-byte unchanged.
  • Default initialization remains byte-for-byte identical, including its existing best-effort config-write behavior.
  • Three independent second-pass reviews covered compatibility, unsafe inputs, write failures, config precedence, PR overlap, and scope; final reviews are LGTM with no blockers.

Notes / nits

This is opt-in. It does not change schemas, validation rules, existing configs, external stores, or default init output and behavior. Localized normative-keyword validation is intentionally out of scope.

Closes #1049

@clay-good
clay-good requested a review from a team as a code owner August 17, 2026 14:59
@clay-good
clay-good requested review from alfred-openspec and removed request for a team August 17, 2026 14:59
@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

An error occurred during the review process. Please try again later.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

multiple language support

1 participant