Skip to content
Draft
Show file tree
Hide file tree
Changes from 66 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
7200b38
Update CI condition and add new properties
WeihanLi Sep 11, 2025
1fa240c
Remove EmbedUntrackedSources property
WeihanLi Sep 11, 2025
c35c3fb
Initial plan
Copilot Sep 11, 2025
fe7948d
docs: Add comprehensive documentation and improve README
Copilot Sep 11, 2025
34666c5
docs: Complete comprehensive documentation with CI/CD integration and…
Copilot Sep 11, 2025
c7f6b15
Update README.md
WeihanLi Sep 13, 2025
e6e82e5
Initial plan
Copilot Sep 13, 2025
bee78a3
docs: update verbose comment
WeihanLi Sep 13, 2025
9ba5061
Merge branch 'dev' of https://github.com/WeihanLi/dotnet-httpie into dev
WeihanLi Sep 13, 2025
a35a02b
feat: bump package version
WeihanLi Sep 13, 2025
1e11faf
Initial investigation and testing of dotnet-httpie repository
Copilot Sep 13, 2025
14aa56f
Add comprehensive copilot instructions for dotnet-httpie repository
Copilot Sep 13, 2025
caccfce
Address review comments: simplify build commands and remove prereleas…
Copilot Sep 13, 2025
3a84f73
Initial plan and exploration complete
Copilot Sep 13, 2025
97c96ce
Apply suggestion from @WeihanLi
WeihanLi Sep 13, 2025
3a2493d
Address review feedback: prioritize build script and simplify validat…
Copilot Sep 13, 2025
f744e05
docs: Address all review comments - fix documentation accuracy
Copilot Sep 13, 2025
a923589
docs: Add comprehensive documentation and improve README with accurac…
Copilot Sep 13, 2025
dde86c1
Remove hardcoded test counts and timing from copilot instructions
Copilot Sep 13, 2025
fc5db77
Address review feedback: remove network restrictions assumptions and …
Copilot Sep 13, 2025
ded699f
docs: Clarify authentication methods - distinguish between --auth fla…
Copilot Sep 13, 2025
c2c2459
Revert code change and clarify GET default behavior comment
Copilot Sep 13, 2025
0c7a974
Update docs/articles/reference/command-line-options.md
WeihanLi Sep 13, 2025
ffff576
Clean up duplications in copilot instructions by consolidating redund…
Copilot Sep 13, 2025
af89e4e
Merge pull request #115 from WeihanLi/copilot/fix-114
WeihanLi Sep 13, 2025
2c48ccc
Merge pull request #116 from WeihanLi/dev
WeihanLi Sep 13, 2025
64ed722
Update docs/articles/reference/command-line-options.md
WeihanLi Sep 13, 2025
8239314
Update docs/articles/reference/command-line-options.md
WeihanLi Sep 13, 2025
dcd7f70
Update docs/articles/reference/command-line-options.md
WeihanLi Sep 13, 2025
a6bca88
Remove unsupported features from documentation: multipart upload, net…
Copilot Sep 13, 2025
0042e3c
Update README.md
WeihanLi Sep 13, 2025
86c44cc
Merge pull request #113 from WeihanLi/copilot/fix-112
WeihanLi Sep 13, 2025
dd4f873
refactor: prefer the response HttpVersion for request http version
WeihanLi Sep 16, 2025
cda18a0
refactor: update http version formatting
WeihanLi Sep 20, 2025
e6da983
update copilot setup
WeihanLi Sep 27, 2025
9bc1cc7
feat: bump dependencies
WeihanLi Sep 27, 2025
9aa2505
build: update dotnet-outdated create pr action
WeihanLi Sep 27, 2025
9e8f2d6
Update NuGet Packages
WeihanLi Sep 28, 2025
22071e7
Merge pull request #118 from WeihanLi/update-nuget-dependencies
WeihanLi Sep 28, 2025
a0d17b5
refactor: update url output format
WeihanLi Sep 28, 2025
c8d80f9
Update NuGet Packages
WeihanLi Oct 3, 2025
800839a
Merge pull request #119 from WeihanLi/update-nuget-dependencies
WeihanLi Oct 12, 2025
75ae228
Update NuGet Packages
WeihanLi Oct 15, 2025
02a485c
Merge pull request #120 from WeihanLi/update-nuget-dependencies
WeihanLi Oct 15, 2025
85ef915
Automated dotnet-format update from commit 02a485cc6ea4711fd3691b9ec4…
WeihanLi Oct 15, 2025
e342d57
Update NuGet Packages
WeihanLi Oct 27, 2025
3ee87b2
Merge pull request #121 from WeihanLi/update-nuget-dependencies
WeihanLi Oct 27, 2025
e9aabfc
Automated dotnet-format update from commit 3ee87b20b4277a540e5b8ff501…
WeihanLi Oct 27, 2025
d4fd9d1
fix build
WeihanLi Oct 27, 2025
84d2fb9
Update System.Linq.AsyncEnumerable version
WeihanLi Nov 3, 2025
f890af6
Create agent md
WeihanLi Nov 3, 2025
a9ab373
Initial plan
Copilot Nov 3, 2025
6c80618
Implement streaming HTTP response output
Copilot Nov 3, 2025
b44488d
Fix streaming mode to work correctly with offline mode
Copilot Nov 3, 2025
d2887d7
Address code review feedback for streaming implementation
Copilot Nov 3, 2025
d5012f4
Update dotnet-agent.md
WeihanLi Nov 3, 2025
7f471bb
Merge pull request #123 from WeihanLi/copilot/fix-7604648-337128585-7…
WeihanLi Nov 7, 2025
63802f4
Automated dotnet-format update from commit 7f471bbb364d479c178c217e26…
WeihanLi Nov 7, 2025
c3573d8
fix build
WeihanLi Nov 7, 2025
78e3079
Automated dotnet-format update from commit c3573d8af2bb1d12d455b95e79…
WeihanLi Nov 7, 2025
2700753
feat: upgrade xunit dependencies
WeihanLi Nov 9, 2025
09b0d17
fix xunit test cases
WeihanLi Nov 9, 2025
6e124ea
Update NuGet Packages
WeihanLi Nov 12, 2025
c863e54
Merge pull request #124 from WeihanLi/update-nuget-dependencies
WeihanLi Nov 12, 2025
2ff248c
bump dependencies
WeihanLi Nov 12, 2025
5ff802b
Merge branch 'dev' of https://github.com/WeihanLi/dotnet-httpie into dev
WeihanLi Nov 12, 2025
767e534
Update docs/articles/http-requests.md
WeihanLi Nov 22, 2025
5071185
Update README.md
WeihanLi Nov 22, 2025
9a33811
docs: Fix formatting of HTTP request examples
WeihanLi Nov 22, 2025
329a267
Update NuGet Packages
WeihanLi Nov 29, 2025
833bdb9
Merge pull request #127 from WeihanLi/update-nuget-dependencies
WeihanLi Nov 29, 2025
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
12 changes: 12 additions & 0 deletions .github/agents/dotnet-agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: dotnet expert
description: Build amazing things in C#
---

# My Agent

Designed to provide guidance and best practices for C# development and build http client tool likes httpie, this agent brings deep expertise in:

- Core C# Development: Adheres to modern best practices for syntax, structure, and performance, while still honoring the preferences of the existing repository.
- Code Integrity: Implements minimal code changes and writes efficient code utilizing async/await patterns with proper cancellation and exception handling.
- Testing Best Practices: Supports behavior-driven unit testing practices, integration testing, and TDD workflows.
138 changes: 138 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# dotnet-httpie

A command-line HTTP client for .NET, providing a user-friendly alternative to curl for API testing and debugging. This tool can be installed as a global .NET tool or run as a Docker container.

Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.

## Working Effectively

### Build and Test Process

- **NEVER CANCEL builds or tests** - Builds and tests typically complete quickly. Set timeout to 60+ seconds.
- **Recommended Build Method**: `./build.sh` (uses dotnet-execute, builds and runs tests automatically)
- **Alternative Build Methods**:
```bash
dotnet build # Direct dotnet CLI
dotnet build dotnet-httpie.slnx # Specify solution file explicitly
```
- **Individual Test Commands**:
```bash
dotnet test tests/HTTPie.UnitTest/HTTPie.UnitTest.csproj # Unit tests
dotnet test tests/HTTPie.IntegrationTest/HTTPie.IntegrationTest.csproj # Integration tests
```
- **Package the tool**:
```bash
dotnet pack src/HTTPie/HTTPie.csproj --configuration Release
```

### Running the Application

- Run in development:
```bash
dotnet run --project src/HTTPie/HTTPie.csproj --framework net10.0 -- --help
```

- Install as global tool:
```bash
dotnet tool install --global --add-source src/HTTPie/bin/Release dotnet-httpie
dotnet-http --help
```

- Test basic functionality:
```bash
# Test in offline mode (no network required)
dotnet-http https://httpbin.org/get --offline

# Execute .http files (test assets available)
dotnet-http exec tests/HTTPie.IntegrationTest/TestAssets/HttpStartedSample.http --offline
```

## Validation

- **ALWAYS run complete build and test suite** before submitting changes
- Build validation commands that MUST pass:
```bash
dotnet build # build
dotnet test # run test cases
dotnet pack src/HTTPie/HTTPie.csproj # pack artifacts
```
- **MANUAL VALIDATION SCENARIOS**: After code changes, test these workflows:
1. **CLI Help**: `dotnet-http --help` - verify all options display correctly
2. **HTTP Request**: `dotnet-http https://httpbin.org/get --offline` - verify request formatting
3. **HTTP File Execution**: `dotnet-http exec tests/HTTPie.IntegrationTest/TestAssets/HttpStartedSample.http --offline` - verify .http file parsing
4. **Package Installation**: Install as global tool and verify `dotnet-http` command works
- Integration tests should pass when network connectivity is available

## Key Project Structure

### Repository Layout
```
/
├── .github/workflows/ # CI/CD pipelines (dotnet.yml is main build)
├── src/HTTPie/ # Main application project (multi-targets net8.0;net10.0)
├── tests/ # Test projects
│ ├── HTTPie.UnitTest/ # Unit tests (all should pass)
│ └── HTTPie.IntegrationTest/ # Integration tests
├── build/ # Build scripts and dotnet-execute configuration
├── docs/ # Release notes and documentation
├── dotnet-httpie.slnx # Solution file (requires .NET 10 SDK)
├── build.sh # Build script using dotnet-execute
└── .husky/ # Git hooks (pre-commit runs dotnet build)
```

### Important Files
- `src/HTTPie/HTTPie.csproj` - Main project, packaged as global tool (`dotnet-http` command)
- `tests/HTTPie.IntegrationTest/TestAssets/` - Sample .http files for testing exec functionality
- `build/build.cs` - Build script executed by dotnet-execute tool
- `Directory.Build.props` - Common MSBuild properties (sets LangVersion to preview)

### Technical Details
- **Target Frameworks**: net8.0 and net10.0 (multi-targeting enabled)
- **Package Output**: `src/HTTPie/bin/Release/dotnet-httpie.{version}.nupkg`
- **AOT Compilation**: Enabled for Release builds on .NET 10 (PublishAot=true)

## Common Development Tasks

### Complete Development Workflow
```bash
# 1. Build and test (recommended - runs both build and tests)
./build.sh

# Alternative: Build and test separately
# dotnet build
# dotnet test

# 2. Test functionality
dotnet run --project src/HTTPie/HTTPie.csproj --framework net10.0 -- --help
dotnet run --project src/HTTPie/HTTPie.csproj --framework net10.0 -- https://httpbin.org/get --offline

# 3. Package and install
dotnet pack src/HTTPie/HTTPie.csproj --configuration Release
dotnet tool install --global --add-source src/HTTPie/bin/Release dotnet-httpie --version {version}
```

### Environment Setup Verification
```bash
# Verify .NET installation
dotnet --list-sdks # Should show 10.0.x
dotnet --list-runtimes # Should show Microsoft.NETCore.App 10.0.x

# Verify tools
dotnet-exec --info # Should show dotnet-execute tool info
which dotnet-http # Should show path after global tool install
```

## Troubleshooting

### Git Workflow
- Pre-commit hook automatically runs `dotnet build`
- Always ensure builds pass before pushing
- CI/CD runs on macOS, Linux, and Windows with .NET 10 SDK

### Common Issues
- **Build fails with "unrecognized Solution element"**: Install .NET 10 SDK, .NET 8 doesn't support .slnx format
- **Tests fail with "Framework not found"**: Ensure .NET 10 runtime is installed and DOTNET_ROOT is set
- **dotnet-execute build script fails**: The tool has compatibility issues with .NET 10 preview, use direct `dotnet build` instead
- **Integration tests fail**: Ensure network connectivity is available for external service calls

This project is a modern .NET tool that showcases advanced features like multi-targeting, AOT compilation, and global tool packaging. Always test the complete user workflow after making changes.
36 changes: 36 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "Copilot Setup Steps"

# Automatically run the setup steps when they are changed to allow for easy validation, and
# allow manual testing through the repository's "Actions" tab
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml

jobs:
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
copilot-setup-steps:
runs-on: ubuntu-latest

# Set the permissions to the lowest permissions possible needed for your steps.
# Copilot will be given its own token for its operations.
permissions:
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
contents: read

# You can define any steps you want, and they will run before the agent starts.
# If you do not check out your code, Copilot will do this for you.
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
5 changes: 2 additions & 3 deletions .github/workflows/dotnet-outdated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@ jobs:
fi
- name: Create Pull Request
if: ${{ env.has_changes == 'true' }}
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Update NuGet Packages"
title: 'Update NuGet Packages'
body: >
This PR updates the outdated NuGet packages.
labels: automated pr
labels: dependencies
branch: update-nuget-dependencies
base: ${{ github.ref }}
14 changes: 7 additions & 7 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<PackageVersion Include="JsonPath.Net" Version="2.1.1" />
<PackageVersion Include="JsonSchema.Net" Version="7.4.0" />
<PackageVersion Include="MathNet.Numerics.Signed" Version="5.0.0" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-rc.1.25451.107" />
<PackageVersion Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net10.0'))" Include="System.Linq.AsyncEnumerable" Version="10.0.0-rc.1.25451.107" />
<PackageVersion Include="WeihanLi.Common" Version="1.0.82" />
<PackageVersion Include="System.CommandLine" Version="2.0.0" />
<PackageVersion Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net10.0'))" Include="System.Linq.AsyncEnumerable" Version="10.0.0" />
<PackageVersion Include="WeihanLi.Common" Version="1.0.84" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="xunit.v3" Version="3.0.1" />
<PackageVersion Include="Xunit.DependencyInjection" Version="10.7.0" />
<PackageVersion Include="xunit.v3" Version="3.2.0" />
<PackageVersion Include="Xunit.DependencyInjection" Version="11.1.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
</ItemGroup>
</Project>
</Project>
Loading
Loading