{"id":330,"date":"2025-06-19T22:36:38","date_gmt":"2025-06-19T22:36:38","guid":{"rendered":"https:\/\/cptdcli.com\/?p=330"},"modified":"2025-06-19T22:36:39","modified_gmt":"2025-06-19T22:36:39","slug":"added-new-command-pack","status":"publish","type":"post","link":"https:\/\/www.cptdcli.org\/?p=330","title":{"rendered":"Added NEW command : PACK"},"content":{"rendered":"\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">The pack command in CPTD CLI enables seamless export and import of CLI commands as ZIP archives. Ideal for backups, sharing tools, or migrating setups across machines.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The pack command is a core utility of CPTD CLI designed to manage the export and import of command modules in .zip format. It simplifies sharing commands between users, creating backups, and migrating CLI configurations across systems. Users can export all installed commands to a directory or import them back with options like &#8211;replace and &#8211;skip-existing. The tool enforces structural validation and excludes unnecessary files to ensure security. Whether you&#8217;re managing multiple environments or distributing tools to a team, pack provides a structured and safe way to handle command portability in CPTD.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udce6 New Command: <code>pack<\/code><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/asbjornrasen\/cptd-plugin-pack\/blob\/main\/README.md#-new-command-pack\"><\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Purpose:<\/strong> Exports installed commands into individual <code>.zip<\/code> archives or imports them from a directory. Supports batch transfer of CLI commands between machines and users.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 Arguments<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/asbjornrasen\/cptd-plugin-pack\/blob\/main\/README.md#-arguments\"><\/a><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Argument<\/th><th>Purpose<\/th><\/tr><\/thead><tbody><tr><td><code>--export<\/code><\/td><td>Export all installed commands as <code>.zip<\/code> files to the specified folder<\/td><\/tr><tr><td><code>--import<\/code><\/td><td>Import <code>.zip<\/code> files from the specified folder<\/td><\/tr><tr><td><code>--output<\/code><\/td><td>(with <code>--export<\/code>) path to the folder where ZIPs will be saved<\/td><\/tr><tr><td><code>--from<\/code><\/td><td>(with <code>--import<\/code>) path to the folder to read ZIPs from<\/td><\/tr><tr><td><code>--replace<\/code><\/td><td>Remove all current commands before importing<\/td><\/tr><tr><td><code>--skip-existing<\/code><\/td><td>Skip commands that are already installed<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udce6 <code>pack<\/code> Command \u2014 Export and Import CLI Commands in CPTD<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/asbjornrasen\/cptd-plugin-pack\/blob\/main\/README.md#-pack-command--export-and-import-cli-commands-in-cptd\"><\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>pack<\/code> command allows you to export installed commands into <code>.zip<\/code> archives and import them back. It is ideal for backup, command sharing, creating themed bundles, and migrating CLI setups.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\uddf0 Use Cases<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/asbjornrasen\/cptd-plugin-pack\/blob\/main\/README.md#-use-cases\"><\/a><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Export each installed command into an individual <code>.zip<\/code> file<\/li>\n\n\n\n<li>Import <code>.zip<\/code> files from a specified directory<\/li>\n\n\n\n<li>Supports flags: <code>--replace<\/code>, <code>--skip-existing<\/code><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 Syntax<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/asbjornrasen\/cptd-plugin-pack\/blob\/main\/README.md#-syntax\"><\/a><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cptd pack --export --output &lt;folder&gt;\ncptd pack --import --from &lt;folder&gt; [--replace] [--skip-existing]<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udce4 Exporting Commands<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/asbjornrasen\/cptd-plugin-pack\/blob\/main\/README.md#-exporting-commands\"><\/a><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cptd pack --export --output .\/my_exports<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Creates a ZIP archive for each installed command<\/li>\n\n\n\n<li>Excludes internal folders like <code>__pycache__\/<\/code> and <code>__pycache__.zip<\/code><\/li>\n\n\n\n<li>Archive names match command names: <code>about.zip<\/code>, <code>cpdsl.zip<\/code>, etc.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udce5 Importing Commands<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/asbjornrasen\/cptd-plugin-pack\/blob\/main\/README.md#-importing-commands\"><\/a><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cptd pack --import --from .\/my_exports<\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Installs all <code>.zip<\/code> files from the specified folder as CPTD commands<\/li>\n\n\n\n<li>Validates structure before installation<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Additional flags:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>--replace<\/code> \u2014 removes all current commands before installing new ones<\/li>\n\n\n\n<li><code>--skip-existing<\/code> \u2014 skips already installed commands<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd10 Security<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/asbjornrasen\/cptd-plugin-pack\/blob\/main\/README.md#-security\"><\/a><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Excludes unnecessary files: <code>__pycache__\/<\/code>, <code>.pyc<\/code>, <code>.pyo<\/code><\/li>\n\n\n\n<li>Rejects improperly structured commands<\/li>\n\n\n\n<li>Fully compatible with CPTD CLI\u2019s security policy<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\uddea Examples<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/asbjornrasen\/cptd-plugin-pack\/blob\/main\/README.md#-examples\"><\/a><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># Export all commands to ZIP\ncptd pack --export --output .\/backup\n\n# Import with removal of existing commands\ncptd pack --import --from .\/backup --replace\n\n# Import only new commands\ncptd pack --import --from .\/shared --skip-existing<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udcc1 Example Export Structure<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/asbjornrasen\/cptd-plugin-pack\/blob\/main\/README.md#-example-export-structure\"><\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>my_exports\/\n\u251c\u2500\u2500 about.zip\n\u251c\u2500\u2500 command.zip\n\u251c\u2500\u2500 pack.zip\n\u251c\u2500\u2500 cpdsl.zip\n\u2514\u2500\u2500 ...\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udccc Compatibility<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/asbjornrasen\/cptd-plugin-pack\/blob\/main\/README.md#-compatibility\"><\/a><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u2714 Windows<\/li>\n\n\n\n<li>\u2714 Linux<\/li>\n\n\n\n<li>\u2714 macOS<\/li>\n\n\n\n<li>\u2714 Offline mode<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The pack command in CPTD CLI enables seamless export and import of CLI commands as ZIP archives. Ideal for backups, sharing tools, or migrating setups across machines. The pack command is a core utility of CPTD CLI designed to manage the export and import of command modules in .zip format. It simplifies sharing commands between [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":332,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-330","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-new-commands"],"_links":{"self":[{"href":"https:\/\/www.cptdcli.org\/index.php?rest_route=\/wp\/v2\/posts\/330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cptdcli.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cptdcli.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cptdcli.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cptdcli.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=330"}],"version-history":[{"count":1,"href":"https:\/\/www.cptdcli.org\/index.php?rest_route=\/wp\/v2\/posts\/330\/revisions"}],"predecessor-version":[{"id":331,"href":"https:\/\/www.cptdcli.org\/index.php?rest_route=\/wp\/v2\/posts\/330\/revisions\/331"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cptdcli.org\/index.php?rest_route=\/wp\/v2\/media\/332"}],"wp:attachment":[{"href":"https:\/\/www.cptdcli.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cptdcli.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cptdcli.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}