Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,13 @@ openspec init [path] [options]
| `--tools <list>` | Configure AI tools non-interactively. Use `all`, `none`, or comma-separated list |
| `--force` | Auto-cleanup legacy files without prompting |
| `--profile <profile>` | Override global profile for this init run (`core` or `custom`) |
| `--schema <name>` | Write the named workflow schema to `openspec/config.yaml` |
| `--schema-source <dir>` | Import a schema bundle directory |

`--profile custom` uses whatever workflows are currently selected in global config (`openspec config profile`).
`--schema-source` copies the schema bundle directory into `openspec/schemas/<name>/` and
uses the source `schema.yaml` `name` field unless `--schema <name>` is provided.
When both are provided, the names must match.

**Supported tool IDs (`--tools`):** `amazon-q`, `antigravity`, `auggie`, `bob`, `claude`, `cline`, `codex`, `forgecode`, `codebuddy`, `continue`, `costrict`, `crush`, `cursor`, `factory`, `gemini`, `github-copilot`, `iflow`, `junie`, `kilocode`, `kimi`, `kiro`, `opencode`, `pi`, `qoder`, `lingma`, `qwen`, `roocode`, `trae`, `windsurf`

Expand All @@ -110,6 +115,12 @@ openspec init ./my-project
# Non-interactive: configure for Claude and Cursor
openspec init --tools claude,cursor

# Initialize with a custom schema already available to OpenSpec
openspec init --schema my-workflow

# Import a schema bundle into the project during initialization
openspec init --schema-source ../omnidev/schemas/my-workflow

# Configure for all supported tools
openspec init --tools all

Expand Down
15 changes: 14 additions & 1 deletion docs/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,20 @@ The `openspec/config.yaml` file is the easiest way to customize OpenSpec for you
openspec init
```

This walks you through creating a config interactively. Or create one manually:
This creates `openspec/config.yaml` with the default schema. If your team schema
is already available to OpenSpec, initialize with it directly:

```bash
openspec init --schema my-workflow
```

If your schema lives outside the project, import it during initialization:

```bash
openspec init --schema-source ../omnidev/schemas/my-workflow
```

Or create one manually:

```yaml
# openspec/config.yaml
Expand Down
9 changes: 8 additions & 1 deletion src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ program
.option('--tools <tools>', toolsOptionDescription)
.option('--force', 'Auto-cleanup legacy files without prompting')
.option('--profile <profile>', 'Override global config profile (core or custom)')
.action(async (targetPath = '.', options?: { tools?: string; force?: boolean; profile?: string }) => {
.option('--schema <name>', 'Workflow schema to write to openspec/config.yaml')
.option('--schema-source <dir>', 'Import a schema bundle directory')
.action(async (
targetPath = '.',
options?: { tools?: string; force?: boolean; profile?: string; schema?: string; schemaSource?: string }
) => {
try {
// Validate that the path is a valid directory
const resolvedPath = path.resolve(targetPath);
Expand All @@ -127,6 +132,8 @@ program
tools: options?.tools,
force: options?.force,
profile: options?.profile,
schema: options?.schema,
schemaSource: options?.schemaSource,
});
await initCommand.execute(targetPath);
} catch (error) {
Expand Down
20 changes: 20 additions & 0 deletions src/core/completions/command-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,26 @@ export const COMMAND_REGISTRY: CommandDefinition[] = [
description: 'Configure AI tools non-interactively (e.g., "all", "none", or comma-separated tool IDs)',
takesValue: true,
},
{
name: 'force',
description: 'Auto-cleanup legacy files without prompting',
},
{
name: 'profile',
description: 'Override global config profile for this init run',
takesValue: true,
values: ['core', 'custom'],
},
{
name: 'schema',
description: 'Workflow schema to write to openspec/config.yaml',
takesValue: true,
},
{
name: 'schema-source',
description: 'Import a schema bundle directory',
takesValue: true,
},
],
},
{
Expand Down
Loading