Skip to content

feat: add init questionnaire command#22

Merged
fmueller merged 2 commits intomainfrom
codex/implement-init-command-for-scribae
Feb 3, 2026
Merged

feat: add init questionnaire command#22
fmueller merged 2 commits intomainfrom
codex/implement-init-command-for-scribae

Conversation

@fmueller
Copy link
Owner

Motivation

  • Provide a guided, consistent CLI flow to create a project scribae.yaml so users can set sensible defaults for Scribae commands.
  • Support writing the config into a project folder or a custom filename and align UX with existing commands (prompts, colors, examples).

Description

  • Add a new scribae init CLI command implemented in src/scribae/init_cli.py that runs a terminal questionnaire and renders a scribae.yaml file.
  • Support --project <folder> (creates folder if needed) and --file <filename> output targets and validate the two options are mutually exclusive.
  • Ask the user before overwriting existing files, with a --force option to skip confirmation, and produce friendly colored prompts and examples for each field.
  • Normalize list inputs (comma-separated keywords / allowed tags) and render YAML using yaml.safe_dump while preserving order.
  • Register the command in the CLI entrypoint by adding init to src/scribae/main.py and add unit tests in tests/unit/init_cli_test.py covering default file, project directory, custom file, overwrite prompt, --force, and option validation.

Testing

  • Ran uv run ruff check and all checks passed.
  • Ran uv run mypy which surfaced environment-related import issues for optional ML dependency (torch) unrelated to the new init command; these are external to the change.
  • Ran uv run pytest and all unit tests passed (166 passed).

Codex Task

Add strip_ansi helper to conftest.py and use it in init_cli_test.py
and translate_cli_test.py to handle colored output in CI environments.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@fmueller fmueller merged commit 879a382 into main Feb 3, 2026
3 checks passed
@fmueller fmueller deleted the codex/implement-init-command-for-scribae branch February 3, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant