1- """specify init command ."""
1+ """CLI adapter for `` specify init`` ."""
22
33from __future__ import annotations
44
1515from rich .markup import escape as _escape_markup
1616from rich .panel import Panel
1717
18- from .. _agent_config import (
18+ from ._agent_config import (
1919 AGENT_CONFIG ,
2020 SCRIPT_TYPE_CHOICES ,
2121 resolve_default_init_integration ,
2222)
23- from .. _assets import (
23+ from ._assets import (
2424 _locate_bundled_preset ,
2525 _locate_bundled_workflow ,
2626 get_speckit_version ,
2727)
28- from .. _console import StepTracker , console , select_with_arrows , show_banner
29- from .. _utils import check_tool
28+ from ._console import StepTracker , console , select_with_arrows , show_banner
29+ from ._utils import check_tool
3030
3131
3232def _stdin_is_interactive () -> bool :
@@ -108,9 +108,9 @@ def _install_extension_during_init(project_path: Path, ext_spec: str, speckit_ve
108108 """
109109 from urllib .parse import urlparse
110110
111- from .. _assets import _locate_bundled_extension
112- from .. extensions import ExtensionCatalog , ExtensionError , ExtensionManager
113- from .. extensions ._commands import (
111+ from ._assets import _locate_bundled_extension
112+ from .extensions import ExtensionCatalog , ExtensionError , ExtensionManager
113+ from .extensions ._commands import (
114114 _resolve_catalog_extension ,
115115 install_extension_from_url ,
116116 )
@@ -164,7 +164,7 @@ def _install_extension_during_init(project_path: Path, ext_spec: str, speckit_ve
164164 return f"{ manifest .name } v{ manifest .version } installed"
165165
166166 if ext_info .get ("bundled" ) and not ext_info .get ("download_url" ):
167- from .. extensions import REINSTALL_COMMAND
167+ from .extensions import REINSTALL_COMMAND
168168
169169 raise ValueError (
170170 f"Extension '{ resolved_id } ' is bundled with spec-kit but not found in the installed package. "
@@ -219,7 +219,7 @@ def ensure_constitution_from_template(
219219 constitution) can seed the memory file. When nothing overrides it, the
220220 resolver falls through to the core template.
221221 """
222- from .. presets import _materialize_constitution_template
222+ from .presets import _materialize_constitution_template
223223
224224 memory_constitution = project_path / ".specify" / "memory" / "constitution.md"
225225
@@ -380,24 +380,24 @@ def init(
380380 specify init my-project --extension https://example.com/extensions/my-ext.zip --trust-extension-urls # URL extension (non-interactive)
381381 """
382382 # Lazy imports to avoid circular dependency — __init__.py imports this module
383- from .. import (
383+ from . import (
384384 _install_shared_infra_or_exit ,
385385 _print_cli_warning ,
386386 ensure_executable_scripts ,
387387 save_init_options ,
388388 )
389- from .. integration_runtime import (
389+ from .integration_runtime import (
390390 invoke_prefix_for_integration as _invoke_prefix_for_integration ,
391391 with_integration_setting as _with_integration_setting ,
392392 )
393- from .. integrations ._commands import (
393+ from .integrations ._commands import (
394394 _parse_integration_options ,
395395 _write_integration_json ,
396396 )
397397
398398 show_banner ()
399399
400- from .. integrations import INTEGRATION_REGISTRY , get_integration
400+ from .integrations import INTEGRATION_REGISTRY , get_integration
401401
402402 if integration :
403403 resolved_integration = get_integration (integration )
@@ -667,7 +667,7 @@ def init(
667667 ) as live :
668668 tracker .attach_refresh (lambda : live .update (tracker .render ()))
669669 try :
670- from .. integrations .manifest import IntegrationManifest
670+ from .integrations .manifest import IntegrationManifest
671671
672672 tracker .start ("integration" )
673673 manifest = IntegrationManifest (
@@ -684,7 +684,7 @@ def init(
684684 if extra :
685685 integration_parsed_options .update (extra )
686686
687- from .. events import resolve_events
687+ from .events import resolve_events
688688 events_map = resolve_events (
689689 resolved_integration .key ,
690690 resolved_integration .config ,
@@ -702,7 +702,7 @@ def init(
702702 manifest .save ()
703703
704704 if force :
705- from .. integrations ._helpers import (
705+ from .integrations ._helpers import (
706706 _register_extensions_for_agent ,
707707 _register_presets_for_agent ,
708708 )
@@ -769,8 +769,8 @@ def init(
769769 try :
770770 bundled_wf = _locate_bundled_workflow ("speckit" )
771771 if bundled_wf :
772- from .. workflows .catalog import WorkflowRegistry
773- from .. workflows .engine import WorkflowDefinition
772+ from .workflows .catalog import WorkflowRegistry
773+ from .workflows .engine import WorkflowDefinition
774774
775775 wf_registry = WorkflowRegistry (project_path )
776776 if wf_registry .is_installed ("speckit" ):
@@ -823,7 +823,7 @@ def init(
823823
824824 if preset :
825825 try :
826- from .. presets import PresetCatalog , PresetError , PresetManager
826+ from .presets import PresetCatalog , PresetError , PresetManager
827827
828828 preset_manager = PresetManager (project_path )
829829 speckit_ver = get_speckit_version ()
@@ -849,7 +849,7 @@ def init(
849849 elif pack_info .get ("bundled" ) and not pack_info .get (
850850 "download_url"
851851 ):
852- from .. extensions import REINSTALL_COMMAND
852+ from .extensions import REINSTALL_COMMAND
853853
854854 console .print (
855855 f"[yellow]Warning:[/yellow] Preset '{ preset } ' is bundled with spec-kit "
@@ -895,7 +895,7 @@ def init(
895895
896896 # Install extensions specified via --extension
897897 if extensions :
898- from .. extensions ._commands import _refresh_events_and_warn
898+ from .extensions ._commands import _refresh_events_and_warn
899899
900900 speckit_ver = get_speckit_version ()
901901 any_extension_installed = False
@@ -1093,7 +1093,7 @@ def init(
10931093 step_num += 1
10941094 usage_label = "skills" if native_skill_mode else "slash commands"
10951095
1096- from .. _invocation_style import (
1096+ from ._invocation_style import (
10971097 is_dollar_skills_agent as _is_dollar_skills_agent ,
10981098 is_slash_skills_agent as _is_slash_skills_agent ,
10991099 )
0 commit comments