-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
114 lines (100 loc) · 4.3 KB
/
Copy pathProgram.cs
File metadata and controls
114 lines (100 loc) · 4.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
using SimpleModule.Cli.Commands.Dev;
using SimpleModule.Cli.Commands.Doctor;
using SimpleModule.Cli.Commands.Install;
using SimpleModule.Cli.Commands.Jobs;
using SimpleModule.Cli.Commands.List;
using SimpleModule.Cli.Commands.Maintenance;
using SimpleModule.Cli.Commands.New;
using SimpleModule.Cli.Commands.Skill;
using SimpleModule.Cli.Commands.Version;
using Spectre.Console.Cli;
var app = new CommandApp();
app.Configure(config =>
{
config.SetApplicationName("sm");
config.SetApplicationVersion(VersionCommand.ResolveVersion());
config.AddExample("new", "project", "MyApp");
config.AddExample("new", "module", "Customers");
config.AddExample("new", "feature", "CreateCustomer", "--module", "Customers");
config.AddExample("dev");
config.AddExample("list");
config.AddExample("doctor", "--fix");
config.AddExample("skill", "add", "shadcn", "--source", "shadcn/ui/skills/shadcn");
config.AddExample("skill", "update");
config.AddBranch(
"new",
newBranch =>
{
newBranch.SetDescription("Create new projects, modules, or features");
newBranch
.AddCommand<NewProjectCommand>("project")
.WithDescription("Scaffold a new SimpleModule solution")
.WithExample("new", "project", "MyApp");
newBranch
.AddCommand<NewModuleCommand>("module")
.WithDescription("Scaffold a new module")
.WithExample("new", "module", "Customers");
newBranch
.AddCommand<NewFeatureCommand>("feature")
.WithDescription("Add a feature to an existing module")
.WithExample("new", "feature", "CreateCustomer", "--module", "Customers");
}
);
config
.AddCommand<DevCommand>("dev")
.WithDescription(
"Start the development environment (dotnet watch + Vite dev server with HMR)"
);
config
.AddCommand<ListCommand>("list")
.WithDescription("List modules in the current project with their route prefixes");
config
.AddCommand<InstallCommand>("install")
.WithDescription("Install a SimpleModule package from NuGet");
config
.AddCommand<DoctorCommand>("doctor")
.WithDescription("Validate project structure and conventions");
config.AddBranch(
"jobs",
jobsBranch =>
{
jobsBranch.SetDescription("Inspect background-job state");
jobsBranch
.AddCommand<JobsListScheduledCommand>("list-scheduled")
.WithDescription("List declarative scheduled jobs with next/last run times")
.WithExample("jobs", "list-scheduled");
}
);
config.AddBranch(
"skill",
skillBranch =>
{
skillBranch.SetDescription("Manage Claude skills under .claude/skills");
skillBranch
.AddCommand<SkillAddCommand>("add")
.WithDescription("Add a Claude skill (from GitHub, a local path, or a scaffold)")
.WithExample("skill", "add", "shadcn", "--source", "shadcn/ui/skills/shadcn")
.WithExample("skill", "add", "my-skill")
.WithExample("skill", "add", "team-skill", "--source", "./skills/team-skill");
skillBranch
.AddCommand<SkillUpdateCommand>("update")
.WithDescription("Re-fetch tracked skills and refresh skills-lock.json")
.WithExample("skill", "update")
.WithExample("skill", "update", "shadcn", "--ref", "main")
.WithExample("skill", "update", "--check");
skillBranch
.AddCommand<SkillListCommand>("list")
.WithDescription("List installed Claude skills and their tracked sources");
}
);
config
.AddCommand<DownCommand>("down")
.WithDescription("Enable maintenance mode (writes the .maintenance sentinel)")
.WithExample("down", "--secret", "let-me-in", "--retry", "60")
.WithExample("down", "--status");
config
.AddCommand<UpCommand>("up")
.WithDescription("Disable maintenance mode (removes the .maintenance sentinel)");
config.AddCommand<VersionCommand>("version").WithDescription("Print the sm CLI version");
});
return app.Run(args);