Skip to content

Commit adbe91c

Browse files
committed
feat: add API endpoint mapping feature
- Detect and map all HTTP endpoints (controllers and minimal APIs) - Show routes, HTTP methods, parameters and authorization info - Support for versioned APIs, areas, and custom routes - Update to version 1.1.0
1 parent 5e73a54 commit adbe91c

File tree

10 files changed

+511
-5
lines changed

10 files changed

+511
-5
lines changed

.github/workflows/publish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish to NuGet
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: 'Version to publish (e.g., 1.0.1)'
10+
required: true
11+
type: string
12+
13+
jobs:
14+
publish:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup .NET
21+
uses: actions/setup-dotnet@v4
22+
with:
23+
dotnet-version: 9.0.x
24+
25+
- name: Set version
26+
run: |
27+
if [ "${{ github.event_name }}" == "release" ]; then
28+
VERSION=${{ github.event.release.tag_name }}
29+
else
30+
VERSION=${{ github.event.inputs.version }}
31+
fi
32+
echo "VERSION=${VERSION#v}" >> $GITHUB_ENV
33+
34+
- name: Restore dependencies
35+
run: dotnet restore
36+
37+
- name: Build
38+
run: dotnet build --configuration Release --no-restore
39+
40+
- name: Run tests
41+
run: dotnet test --no-restore --verbosity normal
42+
43+
- name: Pack
44+
run: dotnet pack src/CodeContext.CLI/CodeContext.CLI.csproj --configuration Release --no-build -p:Version=${{ env.VERSION }} -o ./artifacts
45+
46+
- name: Push to NuGet
47+
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

Directory.Build.props

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<Project>
2+
<PropertyGroup>
3+
<!-- Version configuration -->
4+
<VersionPrefix>1.1.0</VersionPrefix>
5+
<VersionSuffix></VersionSuffix>
6+
7+
<!-- Common package metadata -->
8+
<Authors>Berkant</Authors>
9+
<Company>Nonanti</Company>
10+
<Copyright>Copyright (c) 2025 Berkant</Copyright>
11+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
12+
<RepositoryUrl>https://github.com/Nonanti/CodeContext.NET</RepositoryUrl>
13+
<RepositoryType>git</RepositoryType>
14+
15+
<!-- Build configuration -->
16+
<LangVersion>latest</LangVersion>
17+
<Nullable>enable</Nullable>
18+
<ImplicitUsings>enable</ImplicitUsings>
19+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
20+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
21+
<NoWarn>$(NoWarn);CS1591</NoWarn>
22+
23+
24+
<!-- Source Link -->
25+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
26+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
27+
<IncludeSymbols>true</IncludeSymbols>
28+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
29+
</PropertyGroup>
30+
31+
<ItemGroup>
32+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
33+
</ItemGroup>
34+
</Project>

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Ever spent hours explaining your codebase patterns to ChatGPT? Or wished GitHub
1010

1111
This tool scans your C# project and creates a context file that tells AI assistants how your code works. No more explaining your patterns over and over.
1212

13+
**New:** Now detects and maps all your API endpoints automatically.
14+
1315
```bash
1416
codecontext --path ./MyProject
1517
```
@@ -33,6 +35,7 @@ CodeContext detects:
3335
- You use underscore for private fields
3436
- Your async methods end with "Async"
3537
- You prefer Result<T> over exceptions
38+
- All your API endpoints with routes and auth info
3639

3740
Next time you ask AI for help, it writes code YOUR way, not some generic tutorial style.
3841

@@ -64,6 +67,11 @@ Private fields start with underscore (_)
6467
Async methods end with 'Async' suffix
6568
Use Result<T> pattern for error handling
6669
Dependencies injected through constructor
70+
71+
API Endpoints:
72+
- GET /api/users → GetAllUsers() [Authorize]
73+
- POST /api/users → CreateUser(UserDto dto) [Admin]
74+
- DELETE /api/users/{id} → DeleteUser(int id) [Authorize]
6775
```
6876

6977
Just copy this into ChatGPT/Claude/Copilot before asking for code.

src/CodeContext.CLI/CodeContext.CLI.csproj

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,7 @@
1313
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
1414

1515
<PackageId>CodeContext.CLI</PackageId>
16-
<Version>1.0.0</Version>
17-
<Authors>Berkant</Authors>
1816
<Description>AI Context Generator for C# Codebases - Analyzes code patterns and generates context for AI tools</Description>
19-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
20-
<RepositoryUrl>https://github.com/Nonanti/CodeContext.NET</RepositoryUrl>
21-
<RepositoryType>git</RepositoryType>
2217
<PackageTags>csharp;ai;code-analysis;roslyn;context-generation;chatgpt;copilot;pattern-detection</PackageTags>
2318
<PackageProjectUrl>https://github.com/Nonanti/CodeContext.NET</PackageProjectUrl>
2419
<PackageReadmeFile>README.md</PackageReadmeFile>

0 commit comments

Comments
 (0)