-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
1 / 11 of 1 issue completed
Copy link
Labels
enhancementNew feature or requestNew feature or request
Description
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 packageImplementation 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.ymlgenerator fromapm initrefactor - 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 packagesScenario 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 + installAcceptance Criteria
-
apm install org/pkgin directory withoutapm.ymlcreates minimal manifest - Auto-created
apm.ymlincludes the specified package in dependencies - Success message clearly indicates
apm.ymlwas created -
apm installwithout packages and withoutapm.ymlshows helpful error - Error message suggests both
apm initandapm install <package>options - Existing behavior preserved when
apm.ymlalready exists - Tests cover all scenarios (with/without manifest, with/without packages)
- Integration with minimal init generator from issue Refactor
apm initto minimal-only mode (breaking change) #13
Dependencies
- Requires issue Refactor
apm initto minimal-only mode (breaking change) #13 (minimal init refactor) to be completed first - Shares auto-detection and minimal
apm.ymlgeneration logic
Related
Part of npm-parity redesign for brownfield adoption
Reactions are currently unavailable
Sub-issues
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request