Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
496 changes: 225 additions & 271 deletions .talismanrc

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 Contentstack
Copyright (c) 2026 Contentstack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2,200 changes: 1,129 additions & 1,071 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/contentstack-audit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"dependencies": {
"@contentstack/cli-command": "~1.7.1",
"@contentstack/cli-utilities": "~1.16.0",
"@contentstack/cli-utilities": "~1.17.0",
Comment thread
sunil-lakshman marked this conversation as resolved.
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"@oclif/plugin-plugins": "^5.4.54",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"dependencies": {
"@contentstack/cli-command": "~1.7.1",
"@contentstack/cli-utilities": "~1.16.0",
"@contentstack/cli-utilities": "~1.17.0",
Comment thread
sunil-lakshman marked this conversation as resolved.
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"otplib": "^12.0.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"dependencies": {
"@contentstack/cli-cm-seed": "~1.13.2",
"@contentstack/cli-command": "~1.7.1",
"@contentstack/cli-utilities": "~1.16.0",
"@contentstack/cli-utilities": "~1.17.0",
Comment thread
sunil-lakshman marked this conversation as resolved.
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"inquirer": "8.2.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-branches/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@contentstack/cli-command": "~1.7.1",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"@contentstack/cli-utilities": "~1.16.0",
"@contentstack/cli-utilities": "~1.17.0",
Comment thread
sunil-lakshman marked this conversation as resolved.
"chalk": "^4.1.2",
"just-diff": "^6.0.2",
"lodash": "^4.17.21"
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-bulk-publish/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.7.1",
"@contentstack/cli-config": "~1.16.2",
"@contentstack/cli-utilities": "~1.16.0",
"@contentstack/cli-config": "~1.17.0",
"@contentstack/cli-utilities": "~1.17.0",
Comment thread
sunil-lakshman marked this conversation as resolved.
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"chalk": "^4.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"@contentstack/cli-cm-export": "~1.22.2",
"@contentstack/cli-cm-import": "~1.30.2",
"@contentstack/cli-command": "~1.7.1",
"@contentstack/cli-utilities": "~1.16.0",
"@contentstack/cli-utilities": "~1.17.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"chalk": "^4.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-command/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"test:unit": "mocha --timeout 10000 --forbid-only \"test/unit/**/*.test.ts\""
},
"dependencies": {
"@contentstack/cli-utilities": "~1.16.0",
"@contentstack/cli-utilities": "~1.17.0",
Comment thread
sunil-lakshman marked this conversation as resolved.
"contentstack": "^3.25.3",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28"
Expand Down
67 changes: 66 additions & 1 deletion packages/contentstack-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-config
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-config/1.16.2 darwin-arm64 node-v22.14.0
@contentstack/cli-config/1.17.0 darwin-arm64 node-v22.14.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand All @@ -33,16 +33,19 @@ USAGE
* [`csdx config:get:ea-header`](#csdx-configgetea-header)
* [`csdx config:get:early-access-header`](#csdx-configgetearly-access-header)
* [`csdx config:get:log`](#csdx-configgetlog)
* [`csdx config:get:proxy`](#csdx-configgetproxy)
* [`csdx config:get:rate-limit`](#csdx-configgetrate-limit)
* [`csdx config:get:region`](#csdx-configgetregion)
* [`csdx config:remove:base-branch`](#csdx-configremovebase-branch)
* [`csdx config:remove:ea-header`](#csdx-configremoveea-header)
* [`csdx config:remove:early-access-header`](#csdx-configremoveearly-access-header)
* [`csdx config:remove:proxy`](#csdx-configremoveproxy)
* [`csdx config:remove:rate-limit`](#csdx-configremoverate-limit)
* [`csdx config:set:base-branch`](#csdx-configsetbase-branch)
* [`csdx config:set:ea-header`](#csdx-configsetea-header)
* [`csdx config:set:early-access-header`](#csdx-configsetearly-access-header)
* [`csdx config:set:log`](#csdx-configsetlog)
* [`csdx config:set:proxy`](#csdx-configsetproxy)
* [`csdx config:set:rate-limit`](#csdx-configsetrate-limit)
* [`csdx config:set:region [REGION]`](#csdx-configsetregion-region)

Expand Down Expand Up @@ -118,6 +121,23 @@ EXAMPLES

_See code: [src/commands/config/get/log.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/get/log.ts)_

## `csdx config:get:proxy`

Get proxy configuration for CLI

```
USAGE
$ csdx config:get:proxy

DESCRIPTION
Get proxy configuration for CLI

EXAMPLES
$ csdx config:get:proxy
```

_See code: [src/commands/config/get/proxy.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/get/proxy.ts)_

## `csdx config:get:rate-limit`

Get rate-limit of organizations
Expand Down Expand Up @@ -227,6 +247,23 @@ EXAMPLES

_See code: [src/commands/config/remove/early-access-header.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/remove/early-access-header.ts)_

## `csdx config:remove:proxy`

Remove proxy configuration from global config

```
USAGE
$ csdx config:remove:proxy

DESCRIPTION
Remove proxy configuration from global config

EXAMPLES
$ csdx config:remove:proxy
```

_See code: [src/commands/config/remove/proxy.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/remove/proxy.ts)_

## `csdx config:remove:rate-limit`

Remove rate-limit of the organization
Expand Down Expand Up @@ -358,6 +395,34 @@ EXAMPLES

_See code: [src/commands/config/set/log.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/set/log.ts)_

## `csdx config:set:proxy`

Set proxy configuration for CLI

```
USAGE
$ csdx config:set:proxy [--host <value>] [--port <value>] [--protocol http|https] [--username <value>]

FLAGS
--host=<value> Proxy host address
--port=<value> Proxy port number
--protocol=<option> [default: http] Proxy protocol (http or https)
<options: http|https>
--username=<value> Proxy username (optional)

DESCRIPTION
Set proxy configuration for CLI

EXAMPLES
$ csdx config:set:proxy --host 127.0.0.1 --port 3128

$ csdx config:set:proxy --host proxy.example.com --port 8080 --protocol https

$ csdx config:set:proxy --host proxy.example.com --port 8080 --username user
```

_See code: [src/commands/config/set/proxy.ts](https://github.com/contentstack/cli/blob/main/packages/contentstack-config/src/commands/config/set/proxy.ts)_

## `csdx config:set:rate-limit`

Set rate-limit for CLI
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-config/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-config",
"description": "Contentstack CLI plugin for configuration",
"version": "1.16.2",
"version": "1.17.0",
"author": "Contentstack",
"scripts": {
"build": "npm run clean && npm run compile",
Expand All @@ -22,7 +22,7 @@
},
"dependencies": {
"@contentstack/cli-command": "~1.7.1",
"@contentstack/cli-utilities": "~1.16.0",
"@contentstack/cli-utilities": "~1.17.0",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"lodash": "^4.17.21"
Expand Down
94 changes: 94 additions & 0 deletions packages/contentstack-config/src/commands/config/get/proxy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import { Command } from '@contentstack/cli-command';
Comment thread
sunil-lakshman marked this conversation as resolved.
Outdated
import { cliux, configHandler, TableHeader } from '@contentstack/cli-utilities';

export default class ProxyGetCommand extends Command {
static description = 'Get proxy configuration for CLI';

static examples = ['csdx config:get:proxy'];

async run() {
try {
// Check all sources
const globalProxyConfig = configHandler.get('proxy');
const envHttpsProxy = process.env.HTTPS_PROXY;
const envHttpProxy = process.env.HTTP_PROXY;
Comment thread
sunil-lakshman marked this conversation as resolved.
Outdated

// Determine which source is being used (priority order: Environment variables > Global config)
let activeSource = 'None';
let proxyConfig: any = null;

if (envHttpsProxy || envHttpProxy) {
activeSource = 'Environment variables';
const proxyUrl = envHttpsProxy || envHttpProxy;
try {
const url = new URL(proxyUrl);
proxyConfig = {
host: url.hostname,
port: url.port || (url.protocol === 'https:' ? '443' : '80'),
protocol: url.protocol.replace(':', ''),
username: url.username || undefined,
password: url.password ? '***' : undefined,
};
} catch {
// Invalid URL, skip
}
} else if (globalProxyConfig) {
activeSource = 'Global config';
proxyConfig = {
host: globalProxyConfig.host,
port: globalProxyConfig.port,
protocol: globalProxyConfig.protocol,
username: globalProxyConfig.auth?.username || undefined,
password: globalProxyConfig.auth?.password ? '***' : undefined,
};
}

if (proxyConfig) {
const proxyConfigList = [
{
Setting: 'Source',
Value: activeSource,
},
{
Setting: 'Host',
Value: proxyConfig.host || 'Not set',
},
{
Setting: 'Port',
Value: proxyConfig.port ? String(proxyConfig.port) : 'Not set',
},
{
Setting: 'Protocol',
Value: proxyConfig.protocol || 'Not set',
},
{
Setting: 'Username',
Value: proxyConfig.username ? (proxyConfig.username === '***' ? '***' : proxyConfig.username) : 'Not set',
},
{
Setting: 'Password',
Value: proxyConfig.password ? '***' : 'Not set',
},
];

const headers: TableHeader[] = [{ value: 'Setting' }, { value: 'Value' }];

cliux.table(headers, proxyConfigList);
cliux.print('\nNote: Proxy configuration priority: Environment variables > Global config', {
color: 'dim',
});
} else {
cliux.print('No proxy configuration found.', { color: 'yellow' });
cliux.print('\nProxy can be configured via:');
cliux.print(' 1. Global config: csdx config:set:proxy --host <host> --port <port>');
cliux.print(' 2. Environment variables: HTTPS_PROXY or HTTP_PROXY');
cliux.print(' - macOS/Linux: Set in ~/.zshrc, ~/.bashrc, or ~/.profile');
cliux.print(' - Windows: Set via System Properties or PowerShell: $env:HTTPS_PROXY="..."');
}
} catch (error) {
cliux.error('Error retrieving proxy configuration', error);
}
}
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Command } from '@contentstack/cli-command';
Comment thread
sunil-lakshman marked this conversation as resolved.
Outdated
import { cliux, configHandler } from '@contentstack/cli-utilities';

export default class ProxyRemoveCommand extends Command {
static description = 'Remove proxy configuration from global config';

static examples = ['csdx config:remove:proxy'];

async run() {
try {
const currentProxy = configHandler.get('proxy');
if (!currentProxy) {
cliux.print('No proxy configuration found in global config.', { color: 'yellow' });
return;
}

configHandler.delete('proxy');
cliux.success('Proxy configuration removed from global config successfully.');
cliux.print('\nNote: This only removes the global config. Proxy settings from environment variables (HTTPS_PROXY, HTTP_PROXY) will still be used if present.', {
color: 'dim',
});
} catch (error) {
cliux.error('Failed to remove proxy configuration', error);
}
}
}

Loading
Loading