@topolo/cli 0.12.32 → 0.12.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/index.js +24 -7
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -25,6 +25,23 @@ npx @topolo/cli whoami
|
|
|
25
25
|
|
|
26
26
|
## Configure
|
|
27
27
|
|
|
28
|
+
### Use it from your terminal
|
|
29
|
+
|
|
30
|
+
Every command starts with `topolo`. Running `topolo` prints help and returns to
|
|
31
|
+
your shell; it does not open an interactive prompt. Copy a complete command:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
topolo auth login # sign in with your browser
|
|
35
|
+
topolo whoami # see who you are signed in as
|
|
36
|
+
topolo apps --no-json # list your apps as a readable table
|
|
37
|
+
topolo auth --help # see sign-in commands
|
|
38
|
+
topolo help apps # see app commands and options
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
In help output, `[brackets]` mean an argument is optional and `<angle brackets>`
|
|
42
|
+
mark a value to replace. Do not type the brackets. For example, `help [command]`
|
|
43
|
+
means you can run `topolo help` or `topolo help apps`.
|
|
44
|
+
|
|
28
45
|
Credentials come from (in priority order):
|
|
29
46
|
|
|
30
47
|
1. Environment-specific credential variables
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
|
-
import { Command } from "commander";
|
|
4
|
+
import { Command, Help } from "commander";
|
|
5
5
|
|
|
6
6
|
// src/commands/auth.ts
|
|
7
7
|
import { spawn } from "child_process";
|
|
@@ -7694,8 +7694,8 @@ try {
|
|
|
7694
7694
|
}
|
|
7695
7695
|
var environmentWasStated = Boolean(inheritedEnvironment) || environmentArgSeen;
|
|
7696
7696
|
program.name("topolo").description(
|
|
7697
|
-
"
|
|
7698
|
-
).version(CLI_VERSION).option("--env <environment>", "Topolo environment: production, staging, development, or local");
|
|
7697
|
+
"Use Topolo from your terminal: sign in, find your apps, and run actions.\n\nQuick start (copy a command, then press Enter):\n topolo auth login # Sign in with your browser\n topolo whoami # See who you are signed in as\n topolo apps --no-json # List your apps as a readable table\n topolo auth --help # See sign-in commands\n topolo help apps # See app commands and options"
|
|
7698
|
+
).version(CLI_VERSION).option("--env <environment>", "Topolo environment: production, staging, development, or local").addHelpText("beforeAll", '\nEvery command starts with "topolo". Running "topolo" alone prints help; it does not open an interactive prompt.\n').addHelpText("afterAll", "\nHelp notation: [brackets] mean optional; <angle brackets> mark a value to replace. Do not type the brackets.");
|
|
7699
7699
|
program.hook("preAction", async (thisCommand, actionCommand) => {
|
|
7700
7700
|
const opts = thisCommand.opts();
|
|
7701
7701
|
if (opts.env) process.env.TOPOLO_ENV = normalizeEnvironment(opts.env);
|
|
@@ -7733,11 +7733,28 @@ registerContextCommand(program);
|
|
|
7733
7733
|
registerResourcesCommand(program);
|
|
7734
7734
|
registerWorkspacesCommand(program);
|
|
7735
7735
|
registerInstallationsCommand(program);
|
|
7736
|
-
|
|
7737
|
-
|
|
7736
|
+
var helpCommands = [program];
|
|
7737
|
+
for (const command of helpCommands) {
|
|
7738
|
+
command.configureHelp({
|
|
7739
|
+
subcommandTerm(subcommand) {
|
|
7740
|
+
const parents = [];
|
|
7741
|
+
for (let parent = subcommand.parent ?? command; parent; parent = parent.parent) {
|
|
7742
|
+
parents.unshift(parent.name());
|
|
7743
|
+
}
|
|
7744
|
+
return [...parents, new Help().subcommandTerm(subcommand)].join(" ");
|
|
7745
|
+
}
|
|
7746
|
+
});
|
|
7747
|
+
helpCommands.push(...command.commands);
|
|
7748
|
+
}
|
|
7749
|
+
if (argv.length === 2) {
|
|
7750
|
+
program.outputHelp();
|
|
7751
|
+
} else {
|
|
7752
|
+
program.parseAsync(argv).catch((err) => {
|
|
7753
|
+
process.stderr.write(`Unexpected error: ${err instanceof Error ? err.message : String(err)}
|
|
7738
7754
|
`);
|
|
7739
|
-
|
|
7740
|
-
});
|
|
7755
|
+
process.exit(1);
|
|
7756
|
+
});
|
|
7757
|
+
}
|
|
7741
7758
|
function consumeEnvironmentArg(argv2) {
|
|
7742
7759
|
const next = argv2.slice(0, 2);
|
|
7743
7760
|
for (let i = 2; i < argv2.length; i += 1) {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topolo/cli",
|
|
3
3
|
"packageManager": "pnpm@10.17.1",
|
|
4
|
-
"version": "0.12.
|
|
5
|
-
"topoloPublishedVersion": "0.12.
|
|
4
|
+
"version": "0.12.33",
|
|
5
|
+
"topoloPublishedVersion": "0.12.33",
|
|
6
6
|
"description": "Public command-line interface for Topolo customer organizations, developers, and agents.",
|
|
7
7
|
"license": "UNLICENSED",
|
|
8
8
|
"author": "Topolo",
|