Skip to content
Merged
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
29 changes: 15 additions & 14 deletions docs/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ apm [OPTIONS] COMMAND [ARGS]...

### `apm init` - 🚀 Initialize new APM project

Initialize a new APM project with sample prompt and configuration (like `npm init`).
Initialize a new APM project with minimal `apm.yml` configuration (like `npm init`).

```bash
apm init [PROJECT_NAME] [OPTIONS]
Expand All @@ -72,36 +72,37 @@ apm init [PROJECT_NAME] [OPTIONS]
- `PROJECT_NAME` - Optional name for new project directory. Use `.` to explicitly initialize in current directory

**Options:**
- `-f, --force` - Overwrite existing files without confirmation
- `-y, --yes` - Skip interactive questionnaire and use defaults
- `-y, --yes` - Skip interactive prompts and use auto-detected defaults

**Examples:**
```bash
# Initialize in current directory (interactive)
apm init

# Initialize in current directory explicitly
apm init .
# Initialize in current directory with defaults
apm init --yes

# Create new project directory
apm init my-hello-world

# Force overwrite existing project
apm init --force

# Use defaults without prompts
# Create project with auto-detected defaults
apm init my-project --yes
```

**Behavior:**
- **Minimal by default**: Creates only `apm.yml` with auto-detected metadata
- **Interactive mode**: Prompts for project details unless `--yes` specified
- **Existing projects**: Detects existing `apm.yml` and preserves configuration unless `--force` used
- **Strictly additive**: Like npm, preserves existing fields and values where possible
- **Auto-detection**: Automatically detects author from `git config user.name` and description from project context
- **Brownfield friendly**: Works cleanly in existing projects without file pollution

**Creates:**
- `apm.yml` - Project configuration with MCP dependencies
- `hello-world.prompt.md` - Sample prompt with GitHub integration
- `README.md` - Project documentation
- `apm.yml` - Minimal project configuration with empty dependencies and scripts sections

**Auto-detected fields:**
- `name` - From project directory name
- `author` - From `git config user.name` (fallback: "Developer")
- `description` - Generated from project name
- `version` - Defaults to "1.0.0"

### `apm install` - 📦 Install APM and MCP dependencies

Expand Down
49 changes: 47 additions & 2 deletions scripts/test-release-validation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,58 @@ test_init_project() {
return 1
fi

# Check that apm.yml was created
# Check that apm.yml was created (minimal mode - only apm.yml)
if [[ ! -f "my-ai-native-project/apm.yml" ]]; then
log_error "apm.yml not created in project"
return 1
fi

log_success "Project initialization completed"
log_success "Project initialization completed (minimal mode)"

# NEW: Create minimal project structure for testing (simulating user workflow)
log_info "Creating minimal project structure for validation testing..."

cd my-ai-native-project

# Create .apm directory with minimal instruction
mkdir -p .apm/instructions
cat > .apm/instructions/test.instructions.md << 'EOF'
---
applyTo: "**"
description: Test instructions for release validation
---

# Test Instructions

Basic instructions for release validation testing.
EOF

# Create a simple prompt file for testing
cat > hello-world.prompt.md << 'EOF'
---
description: Hello World prompt for validation
---

# Hello World

This is a test prompt for {{name}}.

Say hello to {{name}}!
EOF

# Update apm.yml to add start script
# Note: Using simple append to avoid Python/YAML dependency issues in isolated test
cat >> apm.yml << 'EOF'

# Scripts added for release validation testing
scripts:
start: "codex hello-world.prompt.md"
EOF

cd ..
log_info "Project structure created for testing"

log_success "Project initialization and setup completed"
}

# Test Step 4: cd my-ai-native-project && apm compile
Expand Down
Loading