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
50 changes: 25 additions & 25 deletions docs/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ apm [OPTIONS] COMMAND [ARGS]...

## Core Commands

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

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

Expand Down Expand Up @@ -104,7 +104,7 @@ apm init my-project --yes
- `description` - Generated from project name
- `version` - Defaults to "1.0.0"

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

Install APM package and MCP server dependencies from `apm.yml` (like `npm install`). Auto-creates minimal `apm.yml` when packages are specified but no manifest exists.

Expand Down Expand Up @@ -259,7 +259,7 @@ Skills are copied directly to target directories:

This makes all package prompts available in VSCode, Claude Code, and compatible editors for immediate use with your coding agents.

### `apm uninstall` - 🗑️ Remove APM packages
### `apm uninstall` - Remove APM packages

Remove installed APM packages and their integrated files.

Comment on lines +262 to 265

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The uninstall section summary doesn’t mention that apm uninstall also removes entries from apm.yml (which is part of the command’s behavior and is called out later in the table/behavior list). Consider updating this one-line description to match the more complete scope described elsewhere (and the updated CLI help string).

Copilot uses AI. Check for mistakes.
Expand Down Expand Up @@ -310,7 +310,7 @@ apm uninstall microsoft/apm-sample-package --dry-run
- Cleans up empty parent directories
- Safe operation: only removes files tracked in the `deployed_files` manifest

### `apm prune` - 🧹 Remove orphaned packages
### `apm prune` - Remove orphaned packages

Remove APM packages from `apm_modules/` that are not listed in `apm.yml`, along with their deployed integration files (prompts, agents, hooks, etc.).

Expand All @@ -335,7 +335,7 @@ apm prune --dry-run
- Removes deployed integration files (prompts, agents, hooks, etc.) for pruned packages using the `deployed_files` manifest in `apm.lock`
- Updates `apm.lock` to reflect the pruned state

### `apm update` - ⬆️ Update APM to the latest version
### `apm update` - Update APM to the latest version

Update the APM CLI to the latest version available on GitHub releases.

Expand Down Expand Up @@ -378,15 +378,15 @@ If the automatic update fails, you can always update manually:
curl -sSL https://raw.githubusercontent.com/microsoft/apm/main/install.sh | sh
```

### `apm deps` - 🔗 Manage APM package dependencies
### `apm deps` - Manage APM package dependencies

Manage APM package dependencies with installation status, tree visualization, and package information.

```bash
apm deps COMMAND [OPTIONS]
```

#### `apm deps list` - 📋 List installed APM dependencies
#### `apm deps list` - List installed APM dependencies

Show all installed APM dependencies in a Rich table format with per-primitive counts.

Expand Down Expand Up @@ -415,7 +415,7 @@ apm deps list
- Source information
- Per-primitive counts (prompts, instructions, agents, skills)

#### `apm deps tree` - 🌳 Show dependency tree structure
#### `apm deps tree` - Show dependency tree structure

Display dependencies in hierarchical tree format with primitive counts.

Expand Down Expand Up @@ -447,7 +447,7 @@ company-website (local)
- Version numbers from dependency package metadata
- Version information for each dependency

#### `apm deps info` - ℹ️ Show detailed package information
#### `apm deps info` - Show detailed package information

Display comprehensive information about a specific installed package.

Expand All @@ -474,7 +474,7 @@ apm deps info design-guidelines
- Agent workflow descriptions and counts
- Installation path and status

#### `apm deps clean` - 🧹 Remove all APM dependencies
#### `apm deps clean` - Remove all APM dependencies

Remove the entire `apm_modules/` directory and all installed APM packages.

Expand All @@ -494,7 +494,7 @@ apm deps clean
- Displays count of packages that will be removed
- Can be cancelled with Ctrl+C or 'n' response

#### `apm deps update` - 🔄 Update APM dependencies
#### `apm deps update` - Update APM dependencies

Update installed APM dependencies to their latest versions.

Expand All @@ -514,15 +514,15 @@ apm deps update
apm deps update compliance-rules
```

### `apm mcp` - 🔌 Browse MCP server registry
### `apm mcp` - Browse MCP server registry

Browse and discover MCP servers from the GitHub MCP Registry.

```bash
apm mcp COMMAND [OPTIONS]
```

#### `apm mcp list` - 📋 List MCP servers
#### `apm mcp list` - List MCP servers

List all available MCP servers from the registry.

Expand All @@ -542,7 +542,7 @@ apm mcp list
apm mcp list --limit 20
```

#### `apm mcp search` - 🔍 Search MCP servers
#### `apm mcp search` - Search MCP servers

Search for MCP servers in the GitHub MCP Registry.

Expand All @@ -568,7 +568,7 @@ apm mcp search database --limit 5
apm mcp search github
```

#### `apm mcp show` - 📋 Show MCP server details
#### `apm mcp show` - Show MCP server details

Show detailed information about a specific MCP server from the registry.

Expand All @@ -595,7 +595,7 @@ apm mcp show a5e8a7f0-d4e4-4a1d-b12f-2896a23fd4f1
- Available installation packages
- Installation instructions

### `apm run` - 🚀 Execute prompts
### `apm run` - Execute prompts

Execute a script defined in your apm.yml with parameters and real-time output streaming.

Expand Down Expand Up @@ -627,7 +627,7 @@ apm run llm --param service=api --param environment=prod
- `0` - Success
- `1` - Execution failed or error occurred

### `apm preview` - 👀 Preview compiled scripts
### `apm preview` - Preview compiled scripts

Show the processed prompt content with parameters substituted, without executing.

Expand All @@ -650,7 +650,7 @@ apm preview start --param name="<YourGitHubHandle>"
apm preview llm --param name="Alice"
```

### `apm list` - 📋 List available scripts
### `apm list` - List available scripts

Display all scripts defined in apm.yml.

Expand All @@ -672,7 +672,7 @@ Available scripts:
debug: RUST_LOG=debug codex hello-world.prompt.md
```

### `apm compile` - 📝 Compile APM context into distributed AGENTS.md files
### `apm compile` - Compile APM context into distributed AGENTS.md files

Compile APM context files (chatmodes, instructions, contexts) into distributed AGENTS.md files with conditional sections, markdown link resolution, and project setup auto-detection.

Expand Down Expand Up @@ -822,7 +822,7 @@ The structure is entirely dictated by the instruction context found in `.apm/` a

APM integrates seamlessly with [Spec-kit](https://github.com/github/spec-kit) for specification-driven development, automatically injecting Spec-kit `constitution` into the compiled context layer.

### `apm config` - ⚙️ Configure APM CLI
### `apm config` - Configure APM CLI

Manage APM CLI configuration settings. Running `apm config` without subcommands displays the current configuration.

Expand Down Expand Up @@ -914,7 +914,7 @@ apm config set auto-integrate 1

## Runtime Management

### `apm runtime` - 🤖 Manage AI runtimes
### `apm runtime` - Manage AI runtimes

APM manages AI runtime installation and configuration automatically. Currently supports three runtimes: `copilot`, `codex`, and `llm`.

Expand All @@ -927,7 +927,7 @@ apm runtime COMMAND [OPTIONS]
- **`codex`** - OpenAI Codex CLI with GitHub Models support
- **`llm`** - Simon Willison's LLM library with multiple providers

#### `apm runtime setup` - ⚙️ Install AI runtime
#### `apm runtime setup` - Install AI runtime

Download and configure an AI runtime from official sources.

Expand Down Expand Up @@ -963,7 +963,7 @@ apm runtime setup llm
- Uses runtime's native defaults (e.g., OpenAI for Codex)
- No configuration files created by APM

#### `apm runtime list` - 📋 Show installed runtimes
#### `apm runtime list` - Show installed runtimes

List all available runtimes and their installation status.

Expand All @@ -977,7 +977,7 @@ apm runtime list
- Installation path and version
- Configuration details

#### `apm runtime remove` - 🗑️ Uninstall runtime
#### `apm runtime remove` - Uninstall runtime

Remove an installed runtime and its configuration.

Expand All @@ -991,7 +991,7 @@ apm runtime remove RUNTIME_NAME
**Options:**
- `--yes` - Confirm the action without prompting

#### `apm runtime status` - 📊 Show runtime status
#### `apm runtime status` - Show runtime status

Display which runtime APM will use for execution and runtime preference order.

Expand Down
24 changes: 12 additions & 12 deletions src/apm_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def cli(ctx):
cli.add_command(deps)


@cli.command(help="🚀 Initialize a new APM project")
@cli.command(help="Initialize a new APM project")
@click.argument("project_name", required=False)
@click.option(
"--yes", "-y", is_flag=True, help="Skip interactive prompts and use auto-detected defaults"
Expand Down Expand Up @@ -635,7 +635,7 @@ def _validate_package_exists(package):


@cli.command(
help="📦 Install APM and MCP dependencies (auto-creates apm.yml when installing packages)"
help="Install APM and MCP dependencies (auto-creates apm.yml when installing packages)"
)
@click.argument("packages", nargs=-1)
@click.option("--runtime", help="Target specific runtime only (copilot, codex, vscode)")
Expand Down Expand Up @@ -972,7 +972,7 @@ def prune(ctx, dry_run):
sys.exit(1)


@cli.command(help="⬆️ Update APM to the latest version")
@cli.command(help="Update APM to the latest version")
@click.option("--check", is_flag=True, help="Only check for updates without installing")
def update(check):
"""Update APM CLI to the latest version (like npm update -g npm).
Expand Down Expand Up @@ -1099,7 +1099,7 @@ def update(check):
sys.exit(1)


@cli.command(help="Remove APM packages from apm.yml and apm_modules")
@cli.command(help="Remove APM packages, their integrated files, and apm.yml entries")
@click.argument("packages", nargs=-1, required=True)
@click.option(
"--dry-run", is_flag=True, help="Show what would be removed without removing"
Expand Down Expand Up @@ -3922,7 +3922,7 @@ def _recompile(self, changed_file):
sys.exit(1)


@cli.command(help="🚀 Compile APM context into distributed AGENTS.md files")
@cli.command(help="Compile APM context into distributed AGENTS.md files")
@click.option(
"--output",
"-o",
Expand All @@ -3939,7 +3939,7 @@ def _recompile(self, changed_file):
@click.option(
"--dry-run",
is_flag=True,
help="🔍 Preview compilation without writing files (shows placement decisions)",
help="Preview compilation without writing files (shows placement decisions)",
)
@click.option("--no-links", is_flag=True, help="Skip markdown link resolution")
@click.option("--chatmode", help="Chatmode to prepend to AGENTS.md files")
Expand All @@ -3955,23 +3955,23 @@ def _recompile(self, changed_file):
@click.option(
"--single-agents",
is_flag=True,
help="📄 Force single-file compilation (legacy mode)",
help="Force single-file compilation (legacy mode)",
)
@click.option(
"--verbose",
"-v",
is_flag=True,
help="🔍 Show detailed source attribution and optimizer analysis",
help="Show detailed source attribution and optimizer analysis",
)
@click.option(
"--local-only",
is_flag=True,
help="🏠 Ignore dependencies, compile only local primitives",
help="Ignore dependencies, compile only local primitives",
)
@click.option(
"--clean",
is_flag=True,
help="🧹 Remove orphaned AGENTS.md files that are no longer generated",
help="Remove orphaned AGENTS.md files that are no longer generated",
)
@click.pass_context
def compile(
Expand Down Expand Up @@ -4421,7 +4421,7 @@ def compile(
sys.exit(1)


@cli.group(help="Configure APM CLI")
@cli.group(help="Configure APM CLI", invoke_without_command=True)
@click.pass_context
def config(ctx):
"""Configure APM CLI settings."""
Comment on lines 4423 to 4427

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that apm config runs without a subcommand, its output becomes a primary user-facing surface. The configuration table title includes an emoji (see the config_table = Table(... title=...) a few lines above), which seems to conflict with this PR’s “no emojis in output” goal; please remove emoji characters from this output as well.

Copilot uses AI. Check for mistakes.
Comment on lines 4423 to 4427

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change alters default CLI behavior (apm config now executes and prints config instead of showing help). There are existing Click/CliRunner tests for other CLI commands, but none covering apm config’s bare invocation; please add a test that invokes config with no subcommand and asserts a successful exit code and expected output.

Copilot uses AI. Check for mistakes.
Expand Down Expand Up @@ -4706,7 +4706,7 @@ def list():

@runtime.command(help="Remove an installed runtime")
@click.argument("runtime_name", type=click.Choice(["copilot", "codex", "llm"]))
@click.confirmation_option(prompt="Are you sure you want to remove this runtime?")
@click.confirmation_option(prompt="Are you sure you want to remove this runtime?", help="Confirm the action without prompting")
def remove(runtime_name):
"""Remove an installed runtime from APM management."""
try:
Expand Down
10 changes: 5 additions & 5 deletions src/apm_cli/commands/deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def deps():
pass


@deps.command(name="list", help="📋 List installed APM dependencies")
@deps.command(name="list", help="List installed APM dependencies")
def list_packages():
"""Show all installed APM dependencies with context files and agent workflows."""
try:
Expand Down Expand Up @@ -229,7 +229,7 @@ def list_packages():
sys.exit(1)


@deps.command(help="🌳 Show dependency tree structure")
@deps.command(help="Show dependency tree structure")

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are trailing spaces at the end of this decorator line. This can cause noisy diffs and may fail formatting/lint checks; please remove the extra whitespace.

Copilot uses AI. Check for mistakes.
def tree():
"""Display dependencies in hierarchical tree format using lockfile."""
try:
Expand Down Expand Up @@ -389,7 +389,7 @@ def _add_children(parent_branch, parent_repo_url, depth=0):
sys.exit(1)


@deps.command(help="🧹 Remove all APM dependencies")
@deps.command(help="Remove all APM dependencies")
def clean():
"""Remove entire apm_modules/ directory."""
project_root = Path(".")
Expand Down Expand Up @@ -423,7 +423,7 @@ def clean():
sys.exit(1)


@deps.command(help="🔄 Update APM dependencies")
@deps.command(help="Update APM dependencies")
@click.argument('package', required=False)
def update(package: Optional[str]):
"""Update specific package or all if no package specified."""
Expand Down Expand Up @@ -461,7 +461,7 @@ def update(package: Optional[str]):
_update_all_packages(project_deps, apm_modules_path)


@deps.command(help="ℹ️ Show detailed package information")
@deps.command(help="Show detailed package information")
@click.argument('package', required=True)
def info(package: str):
"""Show detailed information about a specific package including context files and workflows."""
Expand Down