feat(credentials): link directories to team secrets (#129)

This commit is contained in:
Anthony Ettinger 2026-08-04 17:17:04 -07:00 • committed by GitHub
parent e4723f31b1
commit 12a1d7f479
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 265 additions and 27 deletions

View file

@ -22,7 +22,10 @@ import {
teamsVaultsAction,
teamsGrantAction,
teamsPushAction,
teamsPullAction
teamsPullAction,
secretsTeamsLinkAction,
secretsUpAction,
secretsDownAction
} from "./teams.js";
import { credentialsRotateAction } from "./rotate.js";
import { boards, tasks } from "./fixtures.js";
@ -457,6 +460,36 @@ credentials
);
});
const secretsTeams = credentials
.command("teams")
.description("Link this directory to an end-to-end-encrypted team project/environment.");
secretsTeams
.command("link")
.argument("[team]", "Team slug (selected interactively when omitted)")
.argument("[project]", "Project name (selected interactively when omitted)")
.argument("[env]", "Default environment (selected interactively when omitted)")
.option("--format <format>", "table, json, or markdown", "table")
.description("Link the current directory to a team/project/environment.")
.action((team, project, env, options) =>
secretsTeamsLinkAction(team, project, env, { format: options.format as OutputFormat })
);
credentials
.command("up")
.option("--env <path>", "Source .env file", ".env")
.option("--format <format>", "table, json, or markdown", "table")
.description("Push .env to this directory's linked team environment.")
.action((options) => secretsUpAction({ env: options.env, format: options.format as OutputFormat }));
credentials
.command("down")
.argument("[env]", "Environment override within the linked project")
.option("--env <path>", "Destination .env file", ".env")
.option("--format <format>", "table, json, or markdown", "table")
.description("Pull the linked team environment into .env.")
.action((env, options) => secretsDownAction(env, { env: options.env, format: options.format as OutputFormat }));
withEndpointOptions(
credentials.command("inspect").requiredOption("--provider <provider>", "Provider id"),
"",