@agility/cli
Version:
Agility CLI for working with your content. (Public Beta)
157 lines • 6.7 kB
JavaScript
"use strict";
/**
* Standardized system arguments for Agility CLI commands
* Reusable argument definitions to eliminate duplication across commands
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.systemArgs = void 0;
/**
* Common system arguments that are repeated across multiple commands
* These should be spread into command builders: ...systemArgs
*/
exports.systemArgs = {
// Development/Environment args
dev: {
describe: "Enable developer mode",
type: "boolean",
default: false,
},
local: {
describe: "Enable local mode",
type: "boolean",
default: false,
},
preprod: {
describe: "Enable preprod mode",
type: "boolean",
default: false,
},
// UI/Output args
headless: {
describe: "Turn off the experimental Blessed UI for operations.",
type: "boolean",
default: false,
},
verbose: {
describe: "Run in verbose mode: all logs to console, no UI elements. Overridden by headless.",
type: "boolean",
default: true,
},
// File system args
rootPath: {
describe: "Specify the root path for the operation.",
demandOption: false,
default: "agility-files",
type: "string",
},
legacyFolders: {
describe: "Use legacy folder structure (all files in root agility-files folder).",
demandOption: false,
type: "boolean",
default: false,
},
// Instance/Connection args
locale: {
describe: "Provide locale(s) for the operation. Comma-separated for multiple locales (e.g., 'en-us,en-ca,fr-fr'). If not provided, all available locales will be auto-detected and used.",
demandOption: false,
type: "string",
alias: ["locales", "Locales", "LOCALES"],
// No default - auto-detection when not specified
},
channel: {
describe: "Provide the channel for the operation. If not provided, will use AGILITY_WEBSITE from .env file if available.",
demandOption: false,
type: "string",
default: "website"
},
preview: {
describe: "Whether to use preview or live environment data.",
demandOption: false,
type: "boolean",
default: true,
},
elements: {
describe: "Comma-separated list of elements to process (Models,Galleries,Assets,Containers,Content,Templates,Pages,Sitemaps)",
demandOption: false,
type: "string",
default: "Models,Galleries,Assets,Containers,Content,Templates,Pages,Sitemaps",
},
// Network/Security args
insecure: {
describe: "Disable SSL certificate verification",
type: "boolean",
default: false,
},
baseUrl: {
describe: "(Optional) Specify a base URL for the Agility API, if different from default.",
type: "string"
},
// **NEW: Selective Model-Based Sync Parameter (Task 103)**
models: {
describe: "Comma-separated list of model reference names to sync. Filters only specified models and their direct content.",
demandOption: false,
alias: ["model", "Model", "MODEL"],
type: "string",
default: "",
},
// **NEW: Model-Based Sync with Dependencies (Task 20.2)**
modelsWithDeps: {
describe: "Comma-separated list of model reference names to sync with full dependency tree. Automatically includes all dependent content, pages, assets, galleries, templates, and containers.",
demandOption: false,
alias: ["models-with-deps", "modelswithDeps", "ModelsWithDeps", "MODELSWITHSDEPS"],
type: "string",
default: "",
},
// Debug/Analysis args
test: {
describe: "Enable test mode: bypasses authentication checks for analysis-only operations. Shows detailed analysis and debugging information.",
demandOption: false,
type: "boolean",
default: false,
},
// Instance identification args
sourceGuid: {
describe: "Provide the source instance GUID(s). Comma-separated for multiple instances (e.g., 'guid1,guid2,guid3'). If not provided, will use AGILITY_GUID from .env file if available.",
alias: ["source-guid", "sourceguid", "source", "SourceGuid", "SourceGUID", "SOURCE", "SOURCEGUID", "sourceGuids", "source-guids", "SourceGuids", "SOURCEGUIDS"],
demandOption: false,
type: "string",
},
targetGuid: {
describe: "Provide the target instance GUID(s) for sync operations. Comma-separated for multiple instances (e.g., 'guid1,guid2,guid3').",
alias: ["target-guid", "targetguid", "target", "TargetGuid", "TargetGUID", "TARGET", "TARGETGUID", "targetGuids", "target-guids", "TargetGuids", "TARGETGUIDS"],
demandOption: false,
type: "string",
},
// Force operation args
overwrite: {
describe: "For sync commands only: force update existing items in target instance instead of creating new items with -1 IDs. Default: false (safer behavior to prevent overwriting existing content).",
type: "boolean",
alias: ["overwrite", "Overwrite", "OVERWRITE"],
default: false
},
force: {
describe: "Override target safety conflicts during sync operations. When target instance has changes AND change delta has updates, --force will apply sync changes anyway. Default: false (safer behavior to prevent data loss).",
type: "boolean",
alias: ["force", "Force", "FORCE"],
default: false
},
update: {
describe: "Controls file downloading behavior. --update=false (default): Skip existing files during download (normal efficient behavior). --update=true: Force download/overwrite existing files and clear sync tokens for complete refresh.",
type: "boolean",
alias: ["reset", "Reset", "RESET", "forceUpdate", "ForceUpdate", "FORCEUPDATE"],
default: false
},
reset: {
describe: "Nuclear reset option: completely delete instance GUID folder including sync tokens. Forces full fresh download for all SDKs. To reset only Content Sync SDK: manually delete agility-files/GUID/locale/preview/state folder. Default: false.",
type: "boolean",
default: false
},
// Publishing args
publish: {
describe: "For sync commands only: automatically publish synced content items and pages after successful sync operation. Enables batch publishing for streamlined deployment workflow. Default: false.",
type: "boolean",
alias: ["publish", "Publish", "PUBLISH"],
default: false
},
};
//# sourceMappingURL=system-args.js.map