@envpilot/cli 1.4.0 → 1.4.1

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.
Files changed (2) hide show
  1. package/dist/index.js +27 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ function initSentry() {
9
9
  Sentry.init({
10
10
  dsn,
11
11
  environment: "cli",
12
- release: true ? "1.4.0" : "0.0.0",
12
+ release: true ? "1.4.1" : "0.0.0",
13
13
  // Free tier: disable performance monitoring
14
14
  tracesSampleRate: 0,
15
15
  beforeSend(event) {
@@ -748,6 +748,11 @@ var projectSchema = z.object({
748
748
  userRole: z.string().nullable().optional(),
749
749
  projectRole: z.string().nullable().optional()
750
750
  });
751
+ var variableTagSchema = z.object({
752
+ _id: z.string(),
753
+ name: z.string(),
754
+ color: z.string()
755
+ });
751
756
  var variableSchema = z.object({
752
757
  _id: z.string(),
753
758
  key: z.string(),
@@ -756,7 +761,8 @@ var variableSchema = z.object({
756
761
  projectId: z.string(),
757
762
  description: z.string().optional(),
758
763
  isSensitive: z.boolean().optional(),
759
- version: z.number().optional()
764
+ version: z.number().optional(),
765
+ tags: z.array(variableTagSchema).optional()
760
766
  });
761
767
  var environmentSchema = z.enum([
762
768
  "development",
@@ -2605,7 +2611,7 @@ var listCommand = new Command6("list").description("List resources").argument(
2605
2611
  "[resource]",
2606
2612
  "Resource type: projects, organizations, variables, linked",
2607
2613
  "projects"
2608
- ).option("-o, --organization <id>", "Organization ID (for projects/variables)").option("-p, --project <id>", "Project ID (for variables)").option("-e, --env <environment>", "Environment filter (for variables)").option("--show-values", "Show actual variable values (masked by default)").option("--json", "Output as JSON").action(async (resource, options) => {
2614
+ ).option("-o, --organization <id>", "Organization ID (for projects/variables)").option("-p, --project <id>", "Project ID (for variables)").option("-e, --env <environment>", "Environment filter (for variables)").option("-t, --tag <name>", "Filter by tag name (for variables)").option("--show-values", "Show actual variable values (masked by default)").option("--json", "Output as JSON").action(async (resource, options) => {
2609
2615
  try {
2610
2616
  if (!isAuthenticated()) {
2611
2617
  throw notAuthenticated();
@@ -2789,36 +2795,47 @@ async function listVariables(api, projectConfig, options) {
2789
2795
  metaProjectRole = response.meta?.projectRole;
2790
2796
  return response.data || [];
2791
2797
  });
2792
- if (variables.length === 0) {
2793
- info(`No variables found${environment ? ` for ${environment}` : ""}.`);
2798
+ const tagFilter = options.tag?.toLowerCase();
2799
+ const filtered = tagFilter ? variables.filter(
2800
+ (v) => v.tags?.some((t) => t.name.toLowerCase() === tagFilter)
2801
+ ) : variables;
2802
+ if (filtered.length === 0) {
2803
+ info(
2804
+ `No variables found${environment ? ` for ${environment}` : ""}${tagFilter ? ` with tag "${options.tag}"` : ""}.`
2805
+ );
2794
2806
  return;
2795
2807
  }
2796
2808
  if (options.json) {
2797
- const output = variables.map((v) => ({
2809
+ const output = filtered.map((v) => ({
2798
2810
  ...v,
2799
2811
  value: options.showValues ? v.value : maskValue(v.value)
2800
2812
  }));
2801
2813
  console.log(JSON.stringify(output, null, 2));
2802
2814
  return;
2803
2815
  }
2804
- header(`Variables${environment ? ` (${environment})` : ""}`);
2816
+ header(
2817
+ `Variables${environment ? ` (${environment})` : ""}${tagFilter ? ` [tag: ${options.tag}]` : ""}`
2818
+ );
2805
2819
  console.log();
2820
+ const hasTags = filtered.some((v) => v.tags && v.tags.length > 0);
2806
2821
  table(
2807
- variables.map((variable) => ({
2822
+ filtered.map((variable) => ({
2808
2823
  key: variable.key,
2809
2824
  value: options.showValues ? variable.value : maskValue(variable.value),
2810
2825
  sensitive: variable.isSensitive ? chalk8.yellow("\u25CF") : "",
2826
+ tags: hasTags ? variable.tags?.map((t) => t.name).join(", ") || chalk8.dim("-") : "",
2811
2827
  version: `v${variable.version}`
2812
2828
  })),
2813
2829
  [
2814
2830
  { key: "key", header: "Key" },
2815
2831
  { key: "value", header: "Value", width: 40 },
2816
2832
  { key: "sensitive", header: "" },
2833
+ ...hasTags ? [{ key: "tags", header: "Tags", width: 25 }] : [],
2817
2834
  { key: "version", header: "Ver" }
2818
2835
  ]
2819
2836
  );
2820
2837
  console.log();
2821
- console.log(chalk8.dim(`Total: ${variables.length} variables`));
2838
+ console.log(chalk8.dim(`Total: ${filtered.length} variables`));
2822
2839
  const role = getRole();
2823
2840
  if (role) {
2824
2841
  console.log(chalk8.dim(`Your org role: ${formatRole(role)}`));
@@ -3522,7 +3539,7 @@ var usageCommand = new Command11("usage").description("Show plan usage and limit
3522
3539
  // src/lib/version-check.ts
3523
3540
  import chalk13 from "chalk";
3524
3541
  import Conf2 from "conf";
3525
- var CLI_VERSION = true ? "1.4.0" : "0.0.0";
3542
+ var CLI_VERSION = true ? "1.4.1" : "0.0.0";
3526
3543
  var CHECK_INTERVAL = 60 * 60 * 1e3;
3527
3544
  var _cache = null;
3528
3545
  function getCache() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@envpilot/cli",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Envpilot CLI — sync and manage environment variables from the terminal",
5
5
  "type": "module",
6
6
  "bin": {