Skip to content

Commit c38d29e

Browse files
committed
chore: Update torque-cli installation command to use latest version and GitHub package source
1 parent 1177e8d commit c38d29e

2 files changed

Lines changed: 78 additions & 84 deletions

File tree

Quali.Torque.Cli/Program.cs

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -37,96 +37,96 @@ public static int Main(string[] args)
3737
{
3838
// TODO: log error once logging is ready
3939
productValue = new ProductInfoHeaderValue(Constants.DefaultUserAgentValue, UserAgentUtils.GetCurrentVersion());
40-
}
40+
}
4141
}
42-
42+
4343
configure.DefaultRequestHeaders.UserAgent.Add(productValue);
4444
});
4545
services.AddSingleton<IUserProfilesManager, UserProfilesManager>();
4646
services.AddSingleton<IEnvironmentProvider, EnvironmentProvider>();
4747
services.AddSingleton<ITorqueConfigurationProvider, TorqueYamlConfigurationProvider>();
4848

49-
services.AddSingleton<IConsoleManager, SpectreConsoleManager>();
49+
services.AddSingleton<IConsoleManager, SpectreConsoleManager>();
5050
services.AddSingleton<IClientManager, ClientManager>();
5151

5252
var registrar = new TypeRegistrar(services);
5353
var app = new CommandApp(registrar);
54-
54+
5555
app.Configure(config =>
5656
{
57-
config.SetApplicationName("torque");
57+
config.SetApplicationName("torque-cli");
5858
config.ValidateExamples();
59-
59+
6060
config.AddBranch("blueprint", blueprint =>
6161
{
6262
blueprint.SetDescription("Get, List, Validate blueprints.");
63-
63+
6464
blueprint.AddCommand<BlueprintGetCommand>("get")
6565
.WithDescription("Get blueprint by Name.")
66-
.WithExample(new [] { "bp", "get", "MyBp"});
66+
.WithExample(new[] { "bp", "get", "MyBp" });
6767

6868
blueprint.AddCommand<BlueprintListCommand>("list")
6969
.WithDescription("List blueprints")
70-
.WithExample(new [] { "bp", "list" });
70+
.WithExample(new[] { "bp", "list" });
7171

7272
blueprint.AddCommand<BlueprintValidateCommand>("validate")
7373
.WithDescription("Validate blueprint");
74-
74+
7575
blueprint.AddCommand<BlueprintPublishCommand>("publish")
7676
.WithDescription("Publish blueprint to catalog");
77-
77+
7878
blueprint.AddCommand<BlueprintUnpublishCommand>("unpublish")
7979
.WithDescription("Remove blueprint from catalog");
8080
}).WithAlias("bp");
81-
81+
8282
config.AddBranch("environment", environment =>
8383
{
8484
environment.SetDescription("Start, End, View Torque environments.");
8585
environment.AddCommand<EnvironmentStartCommand>("start")
8686
.WithDescription("Start Environment")
87-
.WithExample(new[] {"env", "start", "demo", "--duration=100", "--name=MyDemoEnv"});
88-
87+
.WithExample(new[] { "env", "start", "demo", "--duration=100", "--name=MyDemoEnv" });
88+
8989
environment.AddCommand<EnvironmentBulkStartCommand>("bulkstart")
9090
.WithDescription("Start Environment")
91-
.WithExample(new[] {"env", "bulkstart", "<CSV file path>>"});
91+
.WithExample(new[] { "env", "bulkstart", "<CSV file path>>" });
9292

9393
environment.AddCommand<EnvironmentGetCommand>("get")
9494
.WithDescription("Get Environment Details")
95-
.WithExample(new[] {"env", "get"});
96-
95+
.WithExample(new[] { "env", "get" });
96+
9797
environment.AddCommand<EnvironmentEndCommand>("end")
9898
.WithDescription("End Torque Environment")
99-
.WithExample(new []{"env", "end", "qwdj4jr9smf"});
100-
99+
.WithExample(new[] { "env", "end", "qwdj4jr9smf" });
100+
101101
environment.AddCommand<EnvironmentListCommand>("list")
102102
.WithDescription("List Torque Environment")
103-
.WithExample(new []{"env", "list", "--show-ended"});
104-
103+
.WithExample(new[] { "env", "list", "--show-ended" });
104+
105105
environment.AddCommand<EnvironmentExtendCommand>("extend")
106106
.WithDescription("Extend Torque Environment")
107-
.WithExample(new []{"env", "extend", "qwdj4jr9smf", "--duration", "120"});
107+
.WithExample(new[] { "env", "extend", "qwdj4jr9smf", "--duration", "120" });
108108
}).WithAlias("env");
109-
109+
110110
config.AddBranch("config", configure =>
111111
{
112112
configure.SetDescription("List, Add and Modify user profiles");
113113
configure.AddCommand<ConfigListCommand>("list")
114114
.WithDescription("List all profiles")
115115
.WithExample("config", "list");
116-
116+
117117
configure.AddCommand<ConfigAddProfileCommand>("add")
118118
.WithDescription("Add user profile")
119119
.WithAlias("add");
120-
120+
121121
configure.AddCommand<ConfigUpdateProfileCommand>("update")
122122
.WithDescription("Update user profile")
123123
.WithAlias("add");
124-
124+
125125
configure.AddCommand<ConfigRemoveCommand>("remove")
126126
.WithDescription("Remove specified profile")
127127
.WithAlias("remove")
128128
.WithExample("config", "remove", "myprofile");
129-
129+
130130
configure.AddCommand<ConfigSetActiveCommand>("activate")
131131
.WithDescription("Set active profile")
132132
.WithExample("config", "activate", "myprofile");
@@ -138,11 +138,11 @@ public static int Main(string[] args)
138138

139139
agent.AddCommand<AgentsListCommand>("list")
140140
.WithDescription("List agents in Space.")
141-
.WithExample(new[] {"agent", "list", "mySpace"});
141+
.WithExample(new[] { "agent", "list", "mySpace" });
142142

143143
agent.AddCommand<AgentAssociateWithSpaceCommand>("associate")
144144
.WithDescription("Associate Agent with Space")
145-
.WithExample(new[] {"agent", "associate", "myAgent", "mySpace", "--ns", "demo", "--sa", "mySA"});
145+
.WithExample(new[] { "agent", "associate", "myAgent", "mySpace", "--ns", "demo", "--sa", "mySA" });
146146
});
147147

148148
config.AddBranch("space", space =>
@@ -151,15 +151,15 @@ public static int Main(string[] args)
151151

152152
space.AddCommand<SpaceCreateCommand>("create")
153153
.WithDescription("Create space")
154-
.WithExample(new[] {"space", "create", "demo"});
154+
.WithExample(new[] { "space", "create", "demo" });
155155

156156
space.AddCommand<SpaceDeleteCommand>("delete")
157157
.WithDescription("Delete space")
158-
.WithExample(new[] {"space", "delete", "demo"});
158+
.WithExample(new[] { "space", "delete", "demo" });
159159

160160
space.AddCommand<SpaceListCommand>("list")
161161
.WithDescription("Show list of spaces")
162-
.WithExample(new[] {"space", "list"});
162+
.WithExample(new[] { "space", "list" });
163163

164164
// space.AddCommand<SpaceAddRepoCommand>("connect")
165165
// .WithDescription("Connect repo to space")
@@ -169,22 +169,22 @@ public static int Main(string[] args)
169169
config.AddBranch("eac", eac =>
170170
{
171171
eac.SetDescription("Handle environment-as-code actions.");
172-
172+
173173
eac.AddCommand<EacListCommand>("list")
174174
.WithDescription("List all current Git-managed environments and their status.")
175-
.WithExample(new[] {"eac", "list"});
176-
175+
.WithExample(new[] { "eac", "list" });
176+
177177
eac.AddCommand<ExportEacCommand>("export")
178178
.WithDescription("Generates an environment YAML file from an existing environment.")
179-
.WithExample(new[] {"eac", "export", "qwdj4jr9smf"});
180-
179+
.WithExample(new[] { "eac", "export", "qwdj4jr9smf" });
180+
181181
eac.AddCommand<RunPlanCommand>("plan")
182182
.WithDescription("Runs a plan against an environment and returns the results.")
183-
.WithExample(new[] {"eac", "plan", "qwdj4jr9smf"})
184-
.WithExample(new[] {"eac", "plan", "qwdj4jr9smf", "-g", "myGrain"});
183+
.WithExample(new[] { "eac", "plan", "qwdj4jr9smf" })
184+
.WithExample(new[] { "eac", "plan", "qwdj4jr9smf", "-g", "myGrain" });
185185
});
186186
});
187-
187+
188188
return app.Run(args);
189189
}
190190
}

README.md

Lines changed: 38 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,22 @@ To learn more about Torque, visit [https://www.quali.com/torque/](https://www.qu
99

1010
## Installing
1111

12-
* If you have the previous version of torque-cli(from Pypi) installed on your system please remove it first with:
13-
14-
`pip uninstall torque-cli`
1512
* Right now there are two ways to use torque-cli:
1613
* Install torque-cli as a .NET tool. In this case you need to have **dotnet** (version 7.0 or higher) installed.
1714
To install dotnet, follow the link: https://dotnet.microsoft.com/en-us/download
1815

19-
```dotnet tool install -g torque --version ${VERSION} --add-source https://nuget.pkg.github.com/QualiNext/index.json```
20-
21-
For example:
22-
23-
```dotnet tool install -g torque --version 2.5.0 --add-source https://nuget.pkg.github.com/QualiNext/index.json```
16+
```dotnet tool install -g torque-cli```
2417

2518
* Run torque-cli as a docker container:
2619

27-
```docker run -it qtorque/torque-cli:latest```
20+
```docker run -it quali/torque-cli:latest```
2821

29-
```docker run -it qtorque/torque-cli:latest -v ~/.torque:/root/.torque/ # to mount your local torque config file```
30-
* The old configuration file will not work, so you will have to re-create it with command: ```torque config set```
22+
```docker run -it quali/torque-cli:latest -v ~/.torque:/root/.torque/ # to mount your local torque config file```
23+
* The old configuration file will not work, so you will have to re-create it with command: ```torque-cli config set```
3124

3225
## Configuration
3326

34-
To allow the torque-cli to authenticate with Torque, you must provide several parameters:
27+
To allow the `torque-cli` to authenticate with Torque, you must provide several parameters:
3528
* *Space*: The Torque space to use
3629
* *Repository*: (Optional) Represents the name of the git repository containing the bleprints and IaC files that will be used when calling Torque
3730
* *Token*: The easiest way to generate a token is via the Torque UI.
@@ -41,16 +34,16 @@ To allow the torque-cli to authenticate with Torque, you must provide several pa
4134

4235
The ```Token```, ```Space``` and ```Repository``` parameters can be provided via a special command line flags (```--token```, ```--space```, and ```--repo```, respectively). You can also conveniently place these parameters in a config file relative to your user folder, so they don't need to be provided each time.
4336

44-
The config file can be created and managed using the interactive `torque config` command.
37+
The config file can be created and managed using the interactive `torque-cli config` command.
4538
The CLI supports multiple profiles, and you can switch between them by setting the active profile for ease of use. To use a non-active profile, the ```--profile_``` command-line flag needs to be used to specify the profile name.
4639

47-
To add a new profile or update an existing one, run ```torque config set``` and follow the on-screen directions.
48-
To see all profiles, run ```torque config list``` and the command will output a table of all the profiles that are currently configured.
40+
To add a new profile or update an existing one, run ```torque-cli config set``` and follow the on-screen directions.
41+
To see all profiles, run ```torque-cli config list``` and the command will output a table of all the profiles that are currently configured.
4942

5043
Example output:
5144

5245
```bash
53-
$ torque config list
46+
$ torque-cli config list
5447
Torque user profiles
5548

5649
Active │ Profile Name │ Space │ Repository │ Token
@@ -59,9 +52,9 @@ $ torque config list
5952
test │ dev │ myrepo │ ******masd
6053
```
6154

62-
If a profile is no longer needed, you can remove it by running: ```torque config remove <profile-name>```
55+
If a profile is no longer needed, you can remove it by running: ```torque-cli config remove <profile-name>```
6356

64-
The ```torque config``` command saves the config file relative to your home user directory ('~/.torque/config.yml' on Mac and Linux or in the '%UserProfile%\\.torque\\config.yaml' file on Windows).
57+
The ```torque-cli config``` command saves the config file relative to your home user directory (`~/.torque/config.yml` on Mac and Linux or in the `%UserProfile%\\.torque\\config.yaml` file on Windows).
6558
To place the config file in a different location, specify that location via an environment variable:
6659

6760
```$ export TORQUE_CONFIG_PATH=/path/to/file```
@@ -87,56 +80,57 @@ export TORQUE_URL = "https://demo.qtorque.io"
8780

8881
There are some basic actions Torque CLI currently allows you to perform:
8982

90-
- Validate a blueprint (using the ```torque bp validate``` command)
91-
- Get a list of blueprints (via ```torque bp list```)
92-
- Start an environment (via ```torque env start```)
83+
- Validate a blueprint (using the ```torque-cli bp validate``` command)
84+
- Get a list of blueprints (via ```torque-cli bp list```)
85+
- Start an environment (via ```torque-cli env start```)
9386

9487
To see the help files, run:
9588

96-
```$ torque --help```
89+
```$ torque-cli --help```
9790

9891
It will give you detailed output with usage:
9992

10093
```shell
101-
$ torque -h
94+
$ torque-cli -h
10295
USAGE:
103-
torque [OPTIONS] <COMMAND>
96+
torque-cli [OPTIONS] <COMMAND>
10497

10598
EXAMPLES:
106-
torque bp get MyBp
107-
torque bp list
108-
torque env start demo --duration=100 --name=MyDemoEnv
109-
torque env get
110-
torque env end qwdj4jr9smf
99+
torque-cli bp get MyBp
100+
torque-cli bp list
101+
torque-cli env start demo --duration=100 --name=MyDemoEnv
102+
torque-cli env bulkstart <CSV file path>>
103+
torque-cli env get
111104

112105
OPTIONS:
113-
-h, --help Prints help information
114-
-v, --version Prints version information
106+
-h, --help Prints help information
107+
-v, --version Prints version information
115108

116109
COMMANDS:
117-
blueprint Get, List, Validate blueprints
118-
environment Start, End, View Torque environments
119-
config List, Add and Modify user profiles
120-
agent List, associate agents
121-
space Create, delete spaces, connect repo to space
110+
blueprint Get, List, Validate blueprints
111+
environment Start, End, View Torque environments
112+
config List, Add and Modify user profiles
113+
agent List, associate agents
114+
space Create, delete spaces, connect repo to space
115+
eac Handle environment-as-code actions
122116
```
123117

124118
You can get additional help information for a particular command by including the ```--help``` flag after the command name, like:
125119

126120
```shell
127-
$ torque env -h
121+
$ torque-cli env -h
128122
DESCRIPTION:
129123
Start, End, View Torque environments.
130124

131125
USAGE:
132-
torque environment [OPTIONS] <COMMAND>
126+
torque-cli environment [OPTIONS] <COMMAND>
133127

134128
EXAMPLES:
135-
torque env start demo --duration=100 --name=MyDemoEnv
136-
torque env get
137-
torque env end qwdj4jr9smf
138-
torque env list --show-ended
139-
torque env extend qwdj4jr9smf --duration 120
129+
torque-cli env start demo --duration=100 --name=MyDemoEnv
130+
torque-cli env get
131+
torque-cli env end qwdj4jr9smf
132+
torque-cli env list --show-ended
133+
torque-cli env extend qwdj4jr9smf --duration 120
140134

141135
OPTIONS:
142136
-h, --help Prints help information
@@ -154,7 +148,7 @@ COMMANDS:
154148
The CLI allows for deplying multiple environments defined in a CSV file.
155149

156150
```shell
157-
torque.exe env bulkstart <PATH-TO-CSV>
151+
torque-cli env bulkstart <PATH-TO-CSV>
158152
```
159153
The lines of the CSV are itterated, starting an environment for each line. If a line specifies multiple owners, a separate environment (with the same parameters) will be started for each owner.
160154
#### CSV format

0 commit comments

Comments
 (0)