Skip to content

Commit ed52200

Browse files
committed
Update Naming Convetions and MD
1 parent 59de08f commit ed52200

6 files changed

Lines changed: 140 additions & 70 deletions

File tree

.cursor/skills/generate-ids/SKILL.md

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
---
2-
name: generate-xrm-ids
3-
description: Generate XrmUnitTest Id<T> definitions using the Id Generator CLI. Use when writing or updating unit tests that need Id<>, nested *Ids classes, or test entity GUIDs for Dynamics/Dataverse.
2+
name: generate-ids
3+
description: Generate DataverseUnitTest Id<T> definitions using the Id Generator CLI. Use when writing or updating unit tests that need Id<>, nested *Ids classes, or test entity GUIDs for Dynamics/Dataverse.
44
---
55

6-
# Generate XrmUnitTest IDs
6+
# Generate DataverseUnitTest IDs
77

88
Use the Id Generator CLI instead of hand-writing GUIDs or guessing naming rules.
99

10-
Documentation: [Id Generator wiki](https://github.com/daryllabar/XrmUnitTest/wiki/Id-Generator)
10+
Documentation: [Id Generator wiki](https://github.com/daryllabar/XrmUnitTest/wiki/Id-Generator) · [Id Generator CLI wiki](https://github.com/daryllabar/XrmUnitTest/wiki/Id-Generator-CLI)
11+
12+
## Install (NuGet)
13+
14+
```powershell
15+
dotnet tool install -g DataverseUnitTest.IdGenerator.Cli
16+
```
17+
18+
NuGet: [DataverseUnitTest.IdGenerator.Cli](https://www.nuget.org/packages/DataverseUnitTest.IdGenerator.Cli)
19+
20+
Requires .NET 10 SDK or runtime (or newer).
1121

1222
## When to use
1323

@@ -17,16 +27,16 @@ Documentation: [Id Generator wiki](https://github.com/daryllabar/XrmUnitTest/wik
1727

1828
## Preferred command
1929

20-
From the repository root:
30+
If the global tool is installed from NuGet:
2131

2232
```powershell
23-
dotnet run --project IdGenerator.Cli -- --settings-file .cursor/IdGeneratorSettings.json "Account 2|Contact"
33+
idgen --settings-file .cursor/IdGeneratorSettings.json --input "Account 2|Contact"
2434
```
2535

26-
If the global tool is installed:
36+
When working in the source repository without the global tool:
2737

2838
```powershell
29-
idgen --settings-file .cursor/IdGeneratorSettings.json "Account 2|Contact"
39+
dotnet run --project IdGenerator.Cli -- --settings-file .cursor/IdGeneratorSettings.json "Account 2|Contact"
3040
```
3141

3242
## Input format
@@ -55,29 +65,29 @@ Rules:
5565
### Generate from entity input
5666

5767
```powershell
58-
dotnet run --project IdGenerator.Cli -- --settings-file .cursor/IdGeneratorSettings.json "Account|Contact 2"
68+
idgen --settings-file .cursor/IdGeneratorSettings.json --input "Account|Contact 2"
5969
```
6070

6171
### Regenerate from existing C#
6272

6373
Parse an existing test ID block and regenerate GUIDs with the same shape:
6474

6575
```powershell
66-
dotnet run --project IdGenerator.Cli -- --settings-file .cursor/IdGeneratorSettings.json --from-csharp path/to/TestFile.cs
76+
idgen --settings-file .cursor/IdGeneratorSettings.json --from-csharp path/to/TestFile.cs
6777
```
6878

6979
Or from stdin:
7080

7181
```powershell
72-
Get-Content path/to/snippet.cs | dotnet run --project IdGenerator.Cli -- --settings-file .cursor/IdGeneratorSettings.json --from-csharp -
82+
Get-Content path/to/snippet.cs | idgen --settings-file .cursor/IdGeneratorSettings.json --from-csharp -
7383
```
7484

7585
### Deterministic output
7686

7787
Use `--seed` when reproducible GUIDs are useful (docs, examples, snapshots):
7888

7989
```powershell
80-
dotnet run --project IdGenerator.Cli -- --seed 42 --settings-file .cursor/IdGeneratorSettings.json "Account 2"
90+
idgen --seed 42 --settings-file .cursor/IdGeneratorSettings.json --input "Account 2"
8191
```
8292

8393
Without `--seed`, GUIDs are random (normal test usage).
@@ -98,17 +108,14 @@ Override on the command line when needed:
98108

99109
1. Identify entities needed for the test.
100110
2. Build entity input (use `|` on one line for CLI convenience).
101-
3. Run the CLI and capture stdout.
111+
3. Run `idgen` and capture stdout.
102112
4. Paste the generated properties/classes into the test's nested IDs helper class.
103113
5. Do not invent GUIDs or naming conventions manually.
104114

105115
Match existing test patterns such as nested `TestIdsClass` / `*Ids` containers in the test project.
106116

107-
## Install the global tool (optional)
117+
## Update the global tool
108118

109119
```powershell
110-
dotnet pack IdGenerator.Cli/IdGenerator.Cli.csproj -c Release
111-
dotnet tool install -g --add-source IdGenerator.Cli/bin/Release XrmUnitTest.IdGenerator.Cli
120+
dotnet tool update -g DataverseUnitTest.IdGenerator.Cli
112121
```
113-
114-
Then use `idgen` anywhere.

IdGenerator.Cli/IdGenerator.Cli.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
<AssemblyName>idgen</AssemblyName>
1010
<PackAsTool>true</PackAsTool>
1111
<ToolCommandName>idgen</ToolCommandName>
12-
<PackageId>XrmUnitTest.IdGenerator.Cli</PackageId>
12+
<PackageId>DataverseUnitTest.IdGenerator.Cli</PackageId>
1313
<Version>1.0.0.1</Version>
1414
<AssemblyVersion>1.0.0.1</AssemblyVersion>
1515
<FileVersion>1.0.0.1</FileVersion>
16-
<PackageDescription>CLI for generating XrmUnitTest Id definitions from entity input or existing C#.</PackageDescription>
17-
<PackageTags>xrm;dataverse;crm;unittest;idgenerator</PackageTags>
16+
<PackageDescription>CLI for generating DataverseUnitTest Id definitions from entity input or existing C#.</PackageDescription>
17+
<PackageTags>dataverse;crm;unittest;idgenerator</PackageTags>
1818
<PackageReadmeFile>README.md</PackageReadmeFile>
1919
</PropertyGroup>
2020

IdGenerator.Cli/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ private static async Task<string> ReadTextSourceAsync(string pathOrDash)
117117

118118
private static string HelpText =>
119119
"""
120-
XrmUnitTest Id Generator CLI
120+
DataverseUnitTest Id Generator CLI
121121
122122
Usage:
123123
idgen [input] [options]

IdGenerator.Cli/README.md

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,39 @@
1-
# XrmUnitTest Id Generator CLI
1+
# DataverseUnitTest Id Generator CLI
22

3-
Generate `Id<T>` definitions for XrmUnitTest from entity input or existing C#.
3+
Generate `Id<T>` definitions for DataverseUnitTest from entity input or existing C#.
44

5-
## Install
5+
## Install from NuGet.org
66

7-
From a local build:
7+
```powershell
8+
dotnet tool install -g DataverseUnitTest.IdGenerator.Cli
9+
```
10+
11+
```bash
12+
dotnet tool install -g DataverseUnitTest.IdGenerator.Cli
13+
```
14+
15+
**NuGet package:** [DataverseUnitTest.IdGenerator.Cli](https://www.nuget.org/packages/DataverseUnitTest.IdGenerator.Cli)
16+
17+
**Requires:** .NET 10 SDK or runtime (or newer)
18+
19+
Pin a version:
820

921
```powershell
10-
dotnet pack IdGenerator.Cli/IdGenerator.Cli.csproj -c Release
11-
dotnet tool install -g --add-source IdGenerator.Cli/bin/Release XrmUnitTest.IdGenerator.Cli
22+
dotnet tool install -g DataverseUnitTest.IdGenerator.Cli --version 1.0.0.1
1223
```
1324

14-
From the repository root:
25+
Update or uninstall:
1526

1627
```powershell
17-
dotnet run --project IdGenerator.Cli -- "Account 2|Contact"
28+
dotnet tool update -g DataverseUnitTest.IdGenerator.Cli
29+
dotnet tool uninstall -g DataverseUnitTest.IdGenerator.Cli
30+
```
31+
32+
## Quick start
33+
34+
```powershell
35+
idgen --input "Account 2|Contact"
36+
idgen --help
1837
```
1938

2039
## Usage
@@ -47,4 +66,19 @@ Examples:
4766
idgen --from-csharp - < existing-ids.cs
4867
```
4968

50-
See the [Id Generator wiki](https://github.com/daryllabar/XrmUnitTest/wiki/Id-Generator) for input format details.
69+
See the [Id Generator wiki](https://github.com/daryllabar/XrmUnitTest/wiki/Id-Generator) for input format details and the [Id Generator CLI wiki](https://github.com/daryllabar/XrmUnitTest/wiki/Id-Generator-CLI) for full documentation.
70+
71+
## Build from source (contributors)
72+
73+
From the repository root:
74+
75+
```powershell
76+
dotnet run --project IdGenerator.Cli -- "Account 2|Contact"
77+
```
78+
79+
Or install from a local pack:
80+
81+
```powershell
82+
dotnet pack IdGenerator.Cli/IdGenerator.Cli.csproj -c Release
83+
dotnet tool install -g --add-source IdGenerator.Cli/bin/Release DataverseUnitTest.IdGenerator.Cli
84+
```

IdGenerator/Id-Generator-CLI.md

Lines changed: 50 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Id Generator CLI
22

3-
Use the Id Generator CLI (`idgen`) to generate `Id<T>` definitions for XrmUnitTest from the command line or from AI coding assistants such as Cursor.
3+
Use the Id Generator CLI (`idgen`) to generate `Id<T>` definitions for DataverseUnitTest from the command line or from AI coding assistants such as Cursor.
44

55
This complements the [Id Generator](Id-Generator) WinForms tool and reuses the same parsing and output logic.
66

@@ -10,40 +10,68 @@ This complements the [Id Generator](Id-Generator) WinForms tool and reuses the s
1010
|------|----------|
1111
| **WinForms app** (`IdGenerator/`) | Interactive use, visual settings, parse/regenerate from output |
1212
| **CLI** (`IdGenerator.Cli/`) | Scripts, CI, terminal workflows, AI assistants |
13-
| **Cursor skill** (`.cursor/skills/generate-xrm-ids/`) | In-repo guidance for Cursor agents |
13+
| **Cursor skill** (`.cursor/skills/generate-ids/`) | In-repo guidance for Cursor agents |
1414

1515
The CLI and WinForms app share the same core library (`IdGenerator.Core/`).
1616

1717
---
1818

1919
## Quick start
2020

21-
### Run from the repository (no install)
21+
### Install from NuGet.org (recommended)
2222

23-
From the repository root:
23+
Install the global `idgen` tool:
2424

2525
```powershell
26-
dotnet run --project IdGenerator.Cli -- --settings-file .cursor/IdGeneratorSettings.json --input "Account 2|Contact"
26+
dotnet tool install -g DataverseUnitTest.IdGenerator.Cli
2727
```
2828

2929
```bash
30-
dotnet run --project IdGenerator.Cli -- --settings-file .cursor/IdGeneratorSettings.json --input "Account 2|Contact"
30+
dotnet tool install -g DataverseUnitTest.IdGenerator.Cli
3131
```
3232

33-
### Install as a global dotnet tool
33+
Then run:
3434

3535
```powershell
36-
dotnet pack IdGenerator.Cli/IdGenerator.Cli.csproj -c Release
37-
dotnet tool install -g --add-source IdGenerator.Cli/bin/Release XrmUnitTest.IdGenerator.Cli
36+
idgen --input "Account 2|Contact"
3837
```
3938

40-
Then run anywhere:
39+
- **NuGet package:** [DataverseUnitTest.IdGenerator.Cli](https://www.nuget.org/packages/DataverseUnitTest.IdGenerator.Cli)
40+
- **Requires:** .NET 10 SDK or runtime (or newer)
41+
42+
Pin a specific version:
4143

4244
```powershell
43-
idgen --settings-file .cursor/IdGeneratorSettings.json --input "Account 2|Contact"
45+
dotnet tool install -g DataverseUnitTest.IdGenerator.Cli --version 1.0.0.1
4446
```
4547

46-
Releases may also include a pre-built tool package (`IdGenerator.Cli.zip`) from GitHub Actions.
48+
Update or uninstall:
49+
50+
```powershell
51+
dotnet tool update -g DataverseUnitTest.IdGenerator.Cli
52+
dotnet tool uninstall -g DataverseUnitTest.IdGenerator.Cli
53+
```
54+
55+
### Run from the repository (contributors)
56+
57+
If you are working in the source repo and have not installed the global tool, from the repository root:
58+
59+
```powershell
60+
dotnet run --project IdGenerator.Cli -- --settings-file .cursor/IdGeneratorSettings.json --input "Account 2|Contact"
61+
```
62+
63+
```bash
64+
dotnet run --project IdGenerator.Cli -- --settings-file .cursor/IdGeneratorSettings.json --input "Account 2|Contact"
65+
```
66+
67+
### Install from a local build (contributors)
68+
69+
```powershell
70+
dotnet pack IdGenerator.Cli/IdGenerator.Cli.csproj -c Release
71+
dotnet tool install -g --add-source IdGenerator.Cli/bin/Release DataverseUnitTest.IdGenerator.Cli
72+
```
73+
74+
GitHub releases may also include a pre-built tool package (`IdGenerator.Cli.zip`).
4775

4876
---
4977

@@ -206,7 +234,7 @@ public class ProjectIds
206234
4. Paste the generated properties/classes into a nested helper class in your test.
207235

208236
```powershell
209-
dotnet run --project IdGenerator.Cli -- --settings-file .cursor/IdGeneratorSettings.json --input "Account|Contact 2|SystemUser"
237+
idgen --settings-file .cursor/IdGeneratorSettings.json --input "Account|Contact 2|SystemUser"
210238
```
211239

212240
### Regenerate GUIDs from existing C#
@@ -220,13 +248,13 @@ idgen --settings-file .cursor/IdGeneratorSettings.json --from-csharp path/to/MyT
220248
From stdin (PowerShell):
221249

222250
```powershell
223-
Get-Content path/to/snippet.cs | dotnet run --project IdGenerator.Cli -- --settings-file .cursor/IdGeneratorSettings.json --from-csharp -
251+
Get-Content path/to/snippet.cs | idgen --settings-file .cursor/IdGeneratorSettings.json --from-csharp -
224252
```
225253

226254
From stdin (bash):
227255

228256
```bash
229-
dotnet run --project IdGenerator.Cli -- --settings-file .cursor/IdGeneratorSettings.json --from-csharp - < snippet.cs
257+
idgen --settings-file .cursor/IdGeneratorSettings.json --from-csharp - < snippet.cs
230258
```
231259

232260
### Deterministic output for docs or examples
@@ -284,24 +312,24 @@ AI assistants should **run the CLI** rather than inventing GUIDs or naming rules
284312

285313
### Recommended command
286314

287-
From the repository root:
315+
If the global tool is installed from NuGet:
288316

289317
```powershell
290-
dotnet run --project IdGenerator.Cli -- --settings-file .cursor/IdGeneratorSettings.json --input "Account 2|Contact"
318+
idgen --settings-file .cursor/IdGeneratorSettings.json --input "Account 2|Contact"
291319
```
292320

293-
If the global tool is installed:
321+
When working in the source repository without the global tool installed:
294322

295323
```powershell
296-
idgen --settings-file .cursor/IdGeneratorSettings.json --input "Account 2|Contact"
324+
dotnet run --project IdGenerator.Cli -- --settings-file .cursor/IdGeneratorSettings.json --input "Account 2|Contact"
297325
```
298326

299327
### Cursor project skill
300328

301329
This repository includes a Cursor skill at:
302330

303331
```text
304-
.cursor/skills/generate-xrm-ids/SKILL.md
332+
.cursor/skills/generate-ids/SKILL.md
305333
```
306334

307335
That skill tells Cursor agents:
@@ -317,7 +345,7 @@ Clone or copy that skill into other projects if needed.
317345

318346
1. Determine required entity types and counts from the test being written.
319347
2. Build entity input using the formats above.
320-
3. Run `idgen` (or `dotnet run --project IdGenerator.Cli`).
348+
3. Run `idgen` (install from NuGet with `dotnet tool install -g DataverseUnitTest.IdGenerator.Cli`, or use `dotnet run --project IdGenerator.Cli` when working in the source repo).
321349
4. Paste stdout into the test's nested IDs helper class.
322350
5. Do **not** manually create GUIDs or guess container/property naming.
323351

@@ -404,5 +432,6 @@ The WinForms app saves settings next to its executable (`IdGeneratorSettings.jso
404432
## Related pages
405433

406434
- [Id Generator](Id-Generator) — WinForms tool and input format reference
435+
- [DataverseUnitTest.IdGenerator.Cli on NuGet.org](https://www.nuget.org/packages/DataverseUnitTest.IdGenerator.Cli)
407436
- Repository: `IdGenerator/`, `IdGenerator.Core/`, `IdGenerator.Cli/`
408437
- GitHub releases — WinForms zip and CLI tool package
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<TargetFramework>net10.0-windows</TargetFramework>
4-
<LangVersion>latest</LangVersion>
5-
<ImplicitUsings>enable</ImplicitUsings>
6-
<Nullable>enable</Nullable>
7-
<IsPackable>false</IsPackable>
8-
</PropertyGroup>
9-
<ItemGroup>
10-
<PackageReference Include="MSTest" Version="4.2.2" />
11-
</ItemGroup>
12-
<ItemGroup>
13-
<ProjectReference Include="..\IdGenerator.Core\IdGenerator.Core.csproj" />
14-
</ItemGroup>
15-
<ItemGroup>
16-
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
17-
</ItemGroup>
18-
</Project>
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFramework>net10.0-windows</TargetFramework>
4+
<LangVersion>latest</LangVersion>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<IsPackable>false</IsPackable>
8+
</PropertyGroup>
9+
<ItemGroup>
10+
<PackageReference Include="MSTest" Version="4.2.2" />
11+
</ItemGroup>
12+
<ItemGroup>
13+
<ProjectReference Include="..\IdGenerator.Core\IdGenerator.Core.csproj" />
14+
</ItemGroup>
15+
<ItemGroup>
16+
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
17+
</ItemGroup>
18+
</Project>

0 commit comments

Comments
 (0)