Skip to content
Closed
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
488 changes: 488 additions & 0 deletions .github/workflows/build-release-dotnet.yml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,6 @@ WIP
# Internal planning documents
skill-plan.md
skill-strategy.md

# NodeJS
node_modules/
16 changes: 16 additions & 0 deletions docs/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,20 @@ apm run debug --param service=api

# Run specific scripts with parameters
apm run llm --param service=api --param environment=prod

# Auto-install and run a virtual package (zero-config)
apm run owner/repo/prompts/code-review.prompt.md
apm run owner/repo/review # .prompt.md is added automatically
```

**Auto-Install Virtual Packages:**

When running a virtual package reference (e.g., `owner/repo/path/file.prompt.md`), APM will automatically download and install the package if it's not already available locally. This enables zero-config usage — no `apm init` or `apm install` required. APM will:
1. Create a minimal `apm.yml` if none exists
2. Download the package from GitHub
3. Add it to `apm.yml` dependencies
4. Execute the prompt

**Return Codes:**
- `0` - Success
- `1` - Execution failed or error occurred
Expand Down Expand Up @@ -607,10 +619,14 @@ apm compile [OPTIONS]
**Options:**
- `-o, --output TEXT` - Output file path (default: AGENTS.md)
- `-t, --target TEXT` - Target agent format: `vscode`, `claude`, or `all`. Auto-detects if not specified.
- `--single-agents` - Force single-file compilation (legacy mode)
- `--chatmode TEXT` - Chatmode to prepend to the AGENTS.md file
- `--dry-run` - Generate content without writing file
- `-v, --verbose` - Show detailed source attribution and optimizer analysis
- `--local-only` - Ignore dependencies, compile only local primitives
- `--no-links` - Skip markdown link resolution
- `--with-constitution/--no-constitution` - Include Spec Kit `memory/constitution.md` verbatim at top inside a delimited block (default: `--with-constitution`). When disabled, any existing block is preserved but not regenerated.
- `--clean` - Remove orphaned AGENTS.md files that are no longer generated
- `--watch` - Auto-regenerate on changes (file system monitoring)
- `--validate` - Validate context without compiling

Expand Down
5 changes: 5 additions & 0 deletions src/apm-dotnet/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**/TestResults/
**/bin/
**/obj/
**/packages/
**/publish/
8 changes: 8 additions & 0 deletions src/apm-dotnet/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
</Project>
22 changes: 22 additions & 0 deletions src/apm-dotnet/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>

<ItemGroup>
<!-- Apm.Cli -->
<PackageVersion Include="LibGit2Sharp" Version="0.31.0" />
<PackageVersion Include="Spectre.Console" Version="0.54.0" />
<PackageVersion Include="Spectre.Console.Cli" Version="0.53.1" />
<PackageVersion Include="Tomlyn" Version="0.20.0" />
<PackageVersion Include="YamlDotNet" Version="16.3.0" />

<!-- Apm.Cli.Tests -->
<PackageVersion Include="AwesomeAssertions" Version="9.3.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
<PackageVersion Include="FakeItEasy" Version="9.0.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.4" />
</ItemGroup>
</Project>
49 changes: 49 additions & 0 deletions src/apm-dotnet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# APM CLI — .NET Port

A .NET 10 NativeAOT implementation of the APM CLI — the dependency manager for AI agents.

## Install

### .NET Global Tool

```bash
dotnet tool install -g apm-cli
```

### PowerShell (cross-platform, pwsh 7+)

```powershell
irm https://raw.githubusercontent.com/danielmeppiel/apm/main/src/apm-dotnet/install.ps1 | iex
```

### dnx

```bash
dnx run apm-cli
```

### Build from Source

```bash
git clone https://github.com/danielmeppiel/apm.git
cd apm/src/apm-dotnet
dotnet build
dotnet test
dotnet run --project src/Apm.Cli
```

## Build & Pack

```bash
dotnet build # Debug build
dotnet test # Run tests
dotnet pack # Create NuGet package
```

### NativeAOT Publish

```bash
dotnet publish src/Apm.Cli -c Release -r linux-x64 /p:NativeAot=true
```

Supported RIDs: `win-x64`, `linux-x64`, `linux-arm64`, `osx-x64`, `osx-arm64`.
8 changes: 8 additions & 0 deletions src/apm-dotnet/apm-dotnet.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Solution>
<Folder Name="/src/">
<Project Path="src/Apm.Cli/Apm.Cli.csproj" />
</Folder>
<Folder Name="/tests/">
<Project Path="tests/Apm.Cli.Tests/Apm.Cli.Tests.csproj" />
</Folder>
</Solution>
5 changes: 5 additions & 0 deletions src/apm-dotnet/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"version": 1,
"isRoot": true,
"tools": {}
}
Loading