FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PlatformPlatform/developer-cli/Program.cs at main · platformplatform/PlatformPlatform · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
platformplatform
/
PlatformPlatform
Public
Notifications
You must be signed in to change notification settings
Fork
53
Star
437
Code
Issues
8
Pull requests
1
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
PlatformPlatform
/
developer-cli
/
Program.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
77 lines (62 loc) · 2.44 KB
Breadcrumbs
PlatformPlatform
/
developer-cli
/
Program.cs
Copy path
File metadata and controls
77 lines (62 loc) · 2.44 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
using
System
.
CommandLine
;
using
System
.
Reflection
;
using
DeveloperCli
.
Installation
;
using
DeveloperCli
.
Utilities
;
using
Spectre
.
Console
;
var
isDebugBuild
=
new
FileInfo
(
Environment
.
ProcessPath
!
)
.
FullName
.
Contains
(
"debug"
)
;
ChangeDetection
.
EnsureCliIsCompiledWithLatestChanges
(
isDebugBuild
)
;
if
(
!
Configuration
.
IsMacOs
&&
!
Configuration
.
IsWindows
&&
!
Configuration
.
IsLinux
)
{
AnsiConsole
.
MarkupLine
(
$
"[red]Your OS [bold]
{
Environment
.
OSVersion
.
Platform
}
[/] is not supported.[/]"
)
;
Environment
.
Exit
(
1
)
;
}
Configuration
.
ExitIfRunningFromWrongRepository
(
)
;
if
(
args
.
Length
==
0
)
{
args
=
[
"--help"
]
;
}
// Preprocess arguments to handle @ symbols in search terms
args
=
CommandLineArgumentsPreprocessor
.
PreprocessArguments
(
args
)
;
WorkspaceHelper
.
EnsureWorkspace
(
)
;
// Skip preamble for commands that need a clean stdout (MCP protocol, skills parsing CLI output).
var
isQuietCommand
=
args
.
Length
>
0
&&
(
args
[
0
]
==
"mcp"
||
args
[
0
]
==
"claude-command"
)
;
var
solutionName
=
new
DirectoryInfo
(
Configuration
.
SourceCodeFolder
)
.
Name
;
if
(
!
isQuietCommand
&&
!
args
.
Contains
(
"-q"
)
&&
!
args
.
Contains
(
"--quiet"
)
)
{
if
(
args
.
Length
==
1
&&
(
args
[
0
]
==
"--help"
||
args
[
0
]
==
"-h"
||
args
[
0
]
==
"-?"
)
)
{
var
figletText
=
new
FigletText
(
solutionName
)
;
AnsiConsole
.
Write
(
figletText
)
;
Prerequisite
.
Recommend
(
Prerequisite
.
TypeScriptLanguageServer
,
Prerequisite
.
CSharpLanguageServer
)
;
Prerequisite
.
WarnIfAspireCliDoesNotMatchSdk
(
)
;
}
AnsiConsole
.
WriteLine
(
$
"Source code folder:
{
Configuration
.
SourceCodeFolder
}
\n
"
)
;
}
var
rootCommand
=
new
RootCommand
{
Description
=
$
"Welcome to the
{
solutionName
}
Developer CLI!"
}
;
var
traceOption
=
new
Option
<
bool
>
(
"--trace"
)
{
Description
=
"Show external processes being executed"
,
Recursive
=
true
}
;
rootCommand
.
Options
.
Add
(
traceOption
)
;
var
allCommands
=
Assembly
.
GetExecutingAssembly
(
)
.
GetTypes
(
)
.
Where
(
t
=>
!
t
.
IsAbstract
&&
t
.
IsAssignableTo
(
typeof
(
Command
)
)
)
.
Where
(
t
=>
t
.
Namespace
!=
"DeveloperCli.Commands.ClaudeCommand"
)
.
Select
(
Activator
.
CreateInstance
)
.
Cast
<
Command
>
(
)
.
ToList
(
)
;
if
(
!
isDebugBuild
)
{
// Remove InstallCommand if isDebugBuild is false
allCommands
.
Remove
(
allCommands
.
First
(
c
=>
c
.
Name
==
"install"
)
)
;
}
foreach
(
var
command
in
allCommands
)
{
rootCommand
.
Subcommands
.
Add
(
command
)
;
}
var
parseResult
=
rootCommand
.
Parse
(
args
)
;
Configuration
.
TraceEnabled
=
parseResult
.
GetValue
(
traceOption
)
;
return
await
parseResult
.
InvokeAsync
(
)
;
Back
|
FazBrowse Home
|
New Git URL