Run prettier across the repo, exclude the lockfile from it
Prettier had never been run in --check mode here before, so this had drifted across most files (markdown tables, long option() chains, line wrapping). Purely formatting, no logic changes - needed so a CI format:check gate can actually pass. Adds .prettierignore for pnpm-lock.yaml specifically: prettier's YAML formatter rewrites every quoted key (single -> double quotes) producing an ~8700-line diff of pure noise on a file pnpm itself owns the formatting of. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+74
-18
@@ -3,7 +3,11 @@ import { doctorCommand } from "./commands/doctor";
|
||||
import { initCommand } from "./commands/init";
|
||||
import { runCommand } from "./commands/run";
|
||||
import { scriptsListCommand, scriptsShowCommand } from "./commands/scripts";
|
||||
import { serviceInstallCommand, serviceStatusCommand, serviceUninstallCommand } from "./commands/service";
|
||||
import {
|
||||
serviceInstallCommand,
|
||||
serviceStatusCommand,
|
||||
serviceUninstallCommand,
|
||||
} from "./commands/service";
|
||||
import { startCommand } from "./commands/start";
|
||||
import { usersAddCommand, usersAddTokenCommand } from "./commands/users";
|
||||
import { validateCommand } from "./commands/validate";
|
||||
@@ -15,12 +19,19 @@ function collect(value: string, previous: string[]): string[] {
|
||||
|
||||
const program = new Command("triggershell")
|
||||
.version(getVersion())
|
||||
.description("Launch the TriggerShell web app: run your configured shell scripts from a browser.");
|
||||
.description(
|
||||
"Launch the TriggerShell web app: run your configured shell scripts from a browser.",
|
||||
);
|
||||
|
||||
program
|
||||
.command("init [path]")
|
||||
.description("Scaffold a new triggershell.yml (and .env, if auth is enabled)")
|
||||
.option("--port <port>", "Port the web app will listen on.", (v) => Number(v), 4173)
|
||||
.option(
|
||||
"--port <port>",
|
||||
"Port the web app will listen on.",
|
||||
(v) => Number(v),
|
||||
4173,
|
||||
)
|
||||
.option("--no-auth", "Disable built-in login for the web app.")
|
||||
.option("--force", "Overwrite an existing config file.", false)
|
||||
.action(initCommand);
|
||||
@@ -35,7 +46,9 @@ program
|
||||
.command("start")
|
||||
.description("Run the web app in production mode.")
|
||||
.option("-c, --config <path>", "Path to the config file.")
|
||||
.option("--port <port>", "Override the port from the config file.", (v) => Number(v))
|
||||
.option("--port <port>", "Override the port from the config file.", (v) =>
|
||||
Number(v),
|
||||
)
|
||||
.option("--host <host>", "Override the host from the config file.")
|
||||
.option("--no-browser", "Don't open a browser automatically.")
|
||||
.action(startCommand);
|
||||
@@ -46,7 +59,9 @@ program
|
||||
.option("-c, --config <path>", "Path to the config file.")
|
||||
.action(doctorCommand);
|
||||
|
||||
const scripts = program.command("scripts").description("List and inspect configured scripts.");
|
||||
const scripts = program
|
||||
.command("scripts")
|
||||
.description("List and inspect configured scripts.");
|
||||
|
||||
scripts
|
||||
.command("list")
|
||||
@@ -71,57 +86,98 @@ program
|
||||
[],
|
||||
)
|
||||
.option("--host <host>", "Override the host from the config file.")
|
||||
.option("--port <port>", "Override the port from the config file.", (v) => Number(v))
|
||||
.option("--port <port>", "Override the port from the config file.", (v) =>
|
||||
Number(v),
|
||||
)
|
||||
.option(
|
||||
"--token <token>",
|
||||
"API token for an already-running server (or set TRIGGERSHELL_API_TOKEN).",
|
||||
)
|
||||
.option("--local", "Always run in this process, even if the web server is reachable.", false)
|
||||
.option(
|
||||
"--local",
|
||||
"Always run in this process, even if the web server is reachable.",
|
||||
false,
|
||||
)
|
||||
.option(
|
||||
"--remote",
|
||||
"Require a reachable web server; don't fall back to running locally.",
|
||||
false,
|
||||
)
|
||||
.option("--no-wait", "Print the run ID and exit immediately instead of streaming output.")
|
||||
.option(
|
||||
"--no-wait",
|
||||
"Print the run ID and exit immediately instead of streaming output.",
|
||||
)
|
||||
.action(runCommand);
|
||||
|
||||
const users = program.command("users").description("Manage auth users and API tokens defined in your config file.");
|
||||
const users = program
|
||||
.command("users")
|
||||
.description("Manage auth users and API tokens defined in your config file.");
|
||||
|
||||
users
|
||||
.command("add <username>")
|
||||
.description("Hash a password with argon2id and wire it up for auth.users.")
|
||||
.option("-c, --config <path>", "Path to the config file (used to locate .env).")
|
||||
.option("--inline", "Print the raw hash to paste into the config instead of storing it in .env.", false)
|
||||
.option(
|
||||
"-c, --config <path>",
|
||||
"Path to the config file (used to locate .env).",
|
||||
)
|
||||
.option(
|
||||
"--inline",
|
||||
"Print the raw hash to paste into the config instead of storing it in .env.",
|
||||
false,
|
||||
)
|
||||
.action(usersAddCommand);
|
||||
|
||||
users
|
||||
.command("add-token <name>")
|
||||
.description("Generate an API token and wire its hash up for auth.tokens.")
|
||||
.option("-c, --config <path>", "Path to the config file (used to locate .env).")
|
||||
.option("--inline", "Print the raw hash to paste into the config instead of storing it in .env.", false)
|
||||
.option(
|
||||
"-c, --config <path>",
|
||||
"Path to the config file (used to locate .env).",
|
||||
)
|
||||
.option(
|
||||
"--inline",
|
||||
"Print the raw hash to paste into the config instead of storing it in .env.",
|
||||
false,
|
||||
)
|
||||
.action(usersAddTokenCommand);
|
||||
|
||||
const service = program.command("service").description("Manage the systemd service (Linux only).");
|
||||
const service = program
|
||||
.command("service")
|
||||
.description("Manage the systemd service (Linux only).");
|
||||
|
||||
service
|
||||
.command("install")
|
||||
.description("Install a systemd unit that runs `triggershell start`.")
|
||||
.option("-c, --config <path>", "Path to the config file.")
|
||||
.option("--port <port>", "Override the port from the config file.", (v) => Number(v))
|
||||
.option("--port <port>", "Override the port from the config file.", (v) =>
|
||||
Number(v),
|
||||
)
|
||||
.option("--host <host>", "Override the host from the config file.")
|
||||
.option("--system", "Install a system-wide unit instead of a per-user one.", false)
|
||||
.option(
|
||||
"--system",
|
||||
"Install a system-wide unit instead of a per-user one.",
|
||||
false,
|
||||
)
|
||||
.action(serviceInstallCommand);
|
||||
|
||||
service
|
||||
.command("uninstall")
|
||||
.description("Stop, disable, and remove the systemd unit.")
|
||||
.option("--system", "Target the system-wide unit instead of the per-user one.", false)
|
||||
.option(
|
||||
"--system",
|
||||
"Target the system-wide unit instead of the per-user one.",
|
||||
false,
|
||||
)
|
||||
.action(serviceUninstallCommand);
|
||||
|
||||
service
|
||||
.command("status")
|
||||
.description("Show the systemd unit's status.")
|
||||
.option("--system", "Target the system-wide unit instead of the per-user one.", false)
|
||||
.option(
|
||||
"--system",
|
||||
"Target the system-wide unit instead of the per-user one.",
|
||||
false,
|
||||
)
|
||||
.action(serviceStatusCommand);
|
||||
|
||||
if (process.argv.length <= 2) {
|
||||
|
||||
Reference in New Issue
Block a user