Summary
Enable apm install <package> to automatically create a minimal apm.yml when none exists, matching npm's behavior where npm install <package> works in any directory.
Current Behavior
$ apm install danielmeppiel/design-guidelines
Error: No apm.yml found. Run 'apm init' first.
Target Behavior
$ apm install danielmeppiel/design-guidelines
✨ Created apm.yml
✓ Added danielmeppiel/design-guidelines to apm.yml
✓ Installed danielmeppiel/design-guidelines
# apm.yml is now created with minimal config + the installed package
Implementation Requirements
Logic Flow
def install(ctx, packages, ...):
apm_yml_exists = Path('apm.yml').exists()
# NEW: Auto-bootstrap when packages specified but no apm.yml
if not apm_yml_exists and packages:
_create_minimal_apm_yml() # Reuse from issue #13
_rich_success("Created apm.yml", symbol="sparkles")
# Error only when NO apm.yml AND NO packages
if not apm_yml_exists and not packages:
_rich_error("No apm.yml found")
_rich_info("💡 Run 'apm init' to create one, or:")
_rich_info(" apm install <org/repo> to auto-create + install")
sys.exit(1)
# Continue with existing install logic...
Integration with Issue #13
- Reuse the minimal
apm.yml generator from apm init refactor
- Same auto-detection logic for project metadata
- Consistent output format
Scenarios
Scenario 1: No apm.yml, WITH packages
cd existing-repo
apm install myorg/standards myorg/chatmodes
# ✨ Creates minimal apm.yml
# ✓ Adds both packages to dependencies
# ✓ Installs both packages
Scenario 2: No apm.yml, NO packages
cd existing-repo
apm install
# ❌ Error with helpful message pointing to:
# - apm init (create empty manifest)
# - apm install <package> (create + install)
Scenario 3: Has apm.yml (existing behavior preserved)
cd project-with-apm-yml
apm install # Install existing deps
apm install myorg/new-pkg # Add to apm.yml + install
Acceptance Criteria
Dependencies
Related
Part of npm-parity redesign for brownfield adoption
Summary
Enable
apm install <package>to automatically create a minimalapm.ymlwhen none exists, matching npm's behavior wherenpm install <package>works in any directory.Current Behavior
$ apm install danielmeppiel/design-guidelines Error: No apm.yml found. Run 'apm init' first.Target Behavior
$ apm install danielmeppiel/design-guidelines ✨ Created apm.yml ✓ Added danielmeppiel/design-guidelines to apm.yml ✓ Installed danielmeppiel/design-guidelines # apm.yml is now created with minimal config + the installed packageImplementation Requirements
Logic Flow
Integration with Issue #13
apm.ymlgenerator fromapm initrefactorScenarios
Scenario 1: No apm.yml, WITH packages
Scenario 2: No apm.yml, NO packages
Scenario 3: Has apm.yml (existing behavior preserved)
Acceptance Criteria
apm install org/pkgin directory withoutapm.ymlcreates minimal manifestapm.ymlincludes the specified package in dependenciesapm.ymlwas createdapm installwithout packages and withoutapm.ymlshows helpful errorapm initandapm install <package>optionsapm.ymlalready existsapm initto minimal-only mode (breaking change) #13Dependencies
apm initto minimal-only mode (breaking change) #13 (minimal init refactor) to be completed firstapm.ymlgeneration logicRelated
Part of npm-parity redesign for brownfield adoption