You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The command SHALL prompt users to select their preferred language during initialization, and all generated content SHALL use the selected language. The default language SHALL be English (en-US), with optional support for Chinese (zh-CN), French (fr-FR), Japanese (ja-JP), Arabic (ar-SA), and other languages as they become available.
6
+
7
+
#### Scenario: Prompting for language selection in interactive mode
8
+
9
+
-**WHEN**`openspec init` is executed interactively
10
+
-**THEN** present a language selection prompt before AI tool selection
11
+
-**AND** display available languages with their native names (e.g., "English (en-US)", "中文 (zh-CN)", "Français (fr-FR)", "日本語 (ja-JP)", "العربية (ar-SA)")
12
+
-**AND** default to English (en-US) if no selection is made
13
+
-**AND** store the selected language in `openspec/config.json` for future use
Copy file name to clipboardExpand all lines: openspec/specs/cli-init/spec.md
+91-10Lines changed: 91 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ The command SHALL display progress indicators during initialization to provide c
19
19
- Then success: "✔ AI tools configured"
20
20
21
21
### Requirement: Directory Creation
22
-
The command SHALL create the complete OpenSpec directory structure with all required directories and files.
22
+
The command SHALL create the complete OpenSpec directory structure with all required directories and files, including the configuration file.
23
23
24
24
#### Scenario: Creating OpenSpec structure
25
25
-**WHEN**`openspec init` is executed
@@ -28,18 +28,20 @@ The command SHALL create the complete OpenSpec directory structure with all requ
28
28
openspec/
29
29
├── project.md
30
30
├── AGENTS.md
31
+
├── config.json
31
32
├── specs/
32
33
└── changes/
33
34
└── archive/
34
35
```
35
36
36
37
### Requirement: File Generation
37
-
The command SHALL generate required template files with appropriate content for immediate use.
38
+
The command SHALL generate required template files with appropriate content for immediate use in the user's selected language.
38
39
39
40
#### Scenario: Generating template files
40
41
-**WHEN** initializing OpenSpec
41
-
-**THEN** generate `openspec/AGENTS.md` containing complete OpenSpec instructions for AI assistants
42
-
-**AND** generate `project.md` with project context template
42
+
-**THEN** generate `openspec/AGENTS.md` containing complete OpenSpec instructions for AI assistants in the selected language
43
+
-**AND** generate `project.md` with project context template in the selected language
44
+
-**AND** use the language setting from `openspec/config.json` if it exists, otherwise use the language selected during initialization
43
45
44
46
### Requirement: AI Tool Configuration
45
47
The command SHALL configure AI coding assistants with OpenSpec instructions using a grouped selection experience so teams can enable native integrations while always provisioning guidance for other assistants.
@@ -267,30 +269,34 @@ The init command SHALL generate slash command files for supported editors using
267
269
-**AND** each template includes instructions for the relevant OpenSpec workflow stage
268
270
269
271
### Requirement: Non-Interactive Mode
270
-
The command SHALL support non-interactive operation through command-line options for automation and CI/CD use cases.
272
+
The command SHALL support non-interactive operation through command-line options for automation and CI/CD use cases, including language selection.
271
273
272
274
#### Scenario: Select all tools non-interactively
273
-
-**WHEN** run with `--tools all`
275
+
-**WHEN** run with `--tools all` and `--language <lang-code>`
274
276
-**THEN** automatically select every available AI tool without prompting
275
-
-**AND** proceed with initialization using the selected tools
277
+
-**AND** use the specified language for all generated content
278
+
-**AND** proceed with initialization using the selected tools and language
276
279
277
280
#### Scenario: Select specific tools non-interactively
278
-
-**WHEN** run with `--tools claude,cursor`
281
+
-**WHEN** run with `--tools claude,cursor` and `--language <lang-code>`
279
282
-**THEN** parse the comma-separated tool IDs and validate against available tools
283
+
-**AND** use the specified language for all generated content
280
284
-**AND** proceed with initialization using only the specified valid tools
-**WHEN** run with `--tools none` and `--language <lang-code>`
284
288
-**THEN** skip AI tool configuration entirely
289
+
-**AND** use the specified language for generated template files
285
290
-**AND** only create the OpenSpec directory structure and template files
286
291
287
292
#### Scenario: Invalid tool specification
288
293
-**WHEN** run with `--tools` containing any IDs not present in the AI tool registry
289
294
-**THEN** exit with code 1 and display available values (`all`, `none`, or the supported tool IDs)
290
295
291
-
#### Scenario: Help text lists available tool IDs
296
+
#### Scenario: Help text lists available tool IDs and language codes
292
297
-**WHEN** displaying CLI help for `openspec init`
293
298
-**THEN** show the `--tools` option description with the valid values derived from the AI tool registry
299
+
-**AND** show the `--language` option description with supported language codes (e.g., `en-US` (default), `zh-CN`, `fr-FR`, `ja-JP`, `ar-SA`)
294
300
295
301
### Requirement: Root instruction stub
296
302
`openspec init` SHALL always scaffold the root-level `AGENTS.md` hand-off so every teammate finds the primary OpenSpec instructions.
@@ -302,6 +308,81 @@ The command SHALL support non-interactive operation through command-line options
302
308
-**AND** preserve any existing content outside the managed markers while replacing the stub text inside them
303
309
-**AND** create the stub regardless of which native AI tools are selected
304
310
311
+
### Requirement: Language Selection
312
+
313
+
The command SHALL prompt users to select their preferred language during initialization, and all generated content SHALL use the selected language. The default language SHALL be English (en-US), with optional support for Chinese (zh-CN), French (fr-FR), Japanese (ja-JP), Arabic (ar-SA), and other languages as they become available.
314
+
315
+
#### Scenario: Prompting for language selection in interactive mode
316
+
317
+
-**WHEN**`openspec init` is executed interactively
318
+
-**THEN** present a language selection prompt before AI tool selection
319
+
-**AND** display available languages with their native names (e.g., "English (en-US)", "中文 (zh-CN)", "Français (fr-FR)", "日本語 (ja-JP)", "العربية (ar-SA)")
320
+
-**AND** default to English (en-US) if no selection is made
321
+
-**AND** store the selected language in `openspec/config.json` for future use
0 commit comments