Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2f3fe21
Reset processed page IDs
AaronAgility Nov 19, 2025
31970cf
Update package.json
AaronAgility Nov 19, 2025
b4d2225
Update orchestrate-pushers.ts
AaronAgility Nov 19, 2025
2e55dca
Fix gallery mapper and model pusher issues
5PK Dec 23, 2025
e623b23
Merge pull request #116 from agility/latest-beta-fix
5PK Dec 23, 2025
63f7571
version bump
5PK Dec 23, 2025
ddb9945
Merge pull request #117 from agility/latest-beta-fix
5PK Dec 23, 2025
01c79cf
Update package.json
AaronAgility Jan 6, 2026
9586a7a
Full workflow service, tests, integration with sync
AaronAgility Jan 15, 2026
5432680
Latest
AaronAgility Feb 18, 2026
b78318a
Refactor contentExistsInOtherLocale function to only consider API-kno…
AaronAgility Feb 18, 2026
ccea512
Update process-page.ts
AaronAgility Feb 18, 2026
1511815
Updates to page conflict detection logic
AaronAgility Feb 19, 2026
4ad5c49
Update package.json
AaronAgility Feb 19, 2026
39da89a
Better conflict messages
AaronAgility Feb 19, 2026
e4f99ca
Fixing page conflict detection logic
AaronAgility Feb 23, 2026
5b6019b
Adding docs, and additional debugging
AaronAgility Mar 10, 2026
3d77a67
Merge pull request #118 from agility/workflow-operations-auto-publish
AaronAgility Mar 10, 2026
fae36b9
Detect auth/GUID failures early instead of cascading into locale fall…
AaronAgility Mar 10, 2026
5a54431
correcting llm commands
AaronAgility Mar 10, 2026
8257873
fail fast if we fail ANY key retrieval
AaronAgility Mar 10, 2026
8a6105f
Cleaning up output
AaronAgility Mar 10, 2026
bbfb8ec
Merge pull request #119 from agility/PROD-89/early-auth-failure-detec…
AaronAgility Mar 16, 2026
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
58 changes: 54 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,11 @@ agility sync [options]

**Operation Control Options:**

| Option | Type | Default | Description |
| ------------- | ------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `--update` | boolean | `false` | Download fresh data from source instance before operations, if left false, incremental sync is performed to only get changed data. |
| `--overwrite` | boolean | `false` | Force update existing items in target instance instead of creating new items with -1 IDs. Default: false (Warning: may cause duplicate items in lists, overwriting existing content) |
| Option | Type | Default | Description |
| ---------------- | ------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `--update` | boolean | `false` | Download fresh data from source instance before operations, if left false, incremental sync is performed to only get changed data. |
| `--overwrite` | boolean | `false` | Force update existing items in target instance instead of creating new items with -1 IDs. Default: false (Warning: may cause duplicate items in lists, overwriting existing content) |
| `--autoPublish` | string | _(disabled)_ | Automatically publish synced items that were published in the source instance. Values: `content`, `pages`, `both`. If flag is provided without a value, defaults to `both`. Items that are only in staging (not published) in the source are skipped. |

**UI & Output Options:**

Expand Down Expand Up @@ -141,10 +142,59 @@ agility sync --sourceGuid="abc123" --targetGuid="def456" --models="BlogPost,Blog

# Sync models with dependencies (includes content, assets, galleries, containers, lists, but not pages)
agility sync --sourceGuid="abc123" --targetGuid="def456" --models-with-deps="BlogPost,BlogCategory"

# Sync and auto-publish everything that was published in source
agility sync --sourceGuid="abc123" --targetGuid="def456" --autoPublish

# Sync and auto-publish only content (not pages)
agility sync --sourceGuid="abc123" --targetGuid="def456" --autoPublish=content

# Sync and auto-publish only pages
agility sync --sourceGuid="abc123" --targetGuid="def456" --autoPublish=pages
```
---
## Advanced Topics

### Auto-Publish

The `--autoPublish` flag lets you automatically publish synced content and/or pages in the target instance immediately after a sync completes. Only items that are **published in the source instance** will be published in the target — staging-only items are skipped.

#### Modes

| Value | Behavior |
| --------- | --------------------------------------------- |
| `both` | Publish both content items and pages (default when flag is provided without a value) |
| `content` | Publish only content items |
| `pages` | Publish only pages |

#### How It Works

1. During sync, the CLI tracks which content items and pages were successfully pushed to the target instance
2. It also checks the publish state of each item in the source — only items with a published state are eligible
3. After all sync operations complete, the CLI publishes the eligible items in the target using the batch workflow API
4. Publishing is done per-locale to match the workflow API requirements
5. After publishing, reference mappings are updated to reflect the new published versions

#### Examples

```bash
# Auto-publish everything (content + pages) — flag without value defaults to 'both'
agility sync --sourceGuid="abc123" --targetGuid="def456" --autoPublish

# Explicitly publish both
agility sync --sourceGuid="abc123" --targetGuid="def456" --autoPublish=both

# Publish only content items (skip pages)
agility sync --sourceGuid="abc123" --targetGuid="def456" --autoPublish=content

# Publish only pages (skip content)
agility sync --sourceGuid="abc123" --targetGuid="def456" --autoPublish=pages
```

> **Note:** Auto-publish only works with `sync` operations (not `pull`). Items that fail to sync will not be published. Any publish errors are reported in the final summary alongside sync errors.

---

### Model-Specific Sync

The CLI provides two options for selective synchronization based on specific content models: `--models` and `--models-with-deps`. This is particularly useful for large instances where you only want to sync certain content types.
Expand Down
13 changes: 11 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/src/tests/**/*.ts'],
testPathIgnorePatterns: ['/node_modules/', '/dist/', '/src/index.ts'],
// Default: unit tests only (exclude integration tests)
testMatch: ['**/src/tests/**/*.test.ts'],
testPathIgnorePatterns: ['/node_modules/', '/dist/', '/src/index.ts', 'integration\\.test\\.ts'],
setupFilesAfterEnv: ['<rootDir>/src/tests/setup.ts'],
// Map TypeScript path aliases to actual paths
moduleNameMapper: {
'^core/(.*)$': '<rootDir>/src/core/$1',
'^core$': '<rootDir>/src/core',
'^lib/(.*)$': '<rootDir>/src/lib/$1',
'^types/(.*)$': '<rootDir>/src/types/$1',
},
};
19 changes: 10 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@agility/cli",
"version": "1.0.0",
"version": "1.0.0-beta.13.4",
"description": "Agility CLI for working with your content. (Public Beta)",
"repository": {
"type": "git",
Expand All @@ -17,6 +17,8 @@
"postbuild": "chmod +x dist/index.js",
"refresh": "rm -rf ./node_modules ./package-lock.json && npm install",
"test": "jest",
"test:unit": "jest",
"test:integration": "jest --testMatch=\"**/*.integration.test.ts\" --testPathIgnorePatterns=\"/node_modules/|/dist/|/src/index.ts\"",
"debug": "node --inspect-brk -r ts-node/register src/index.ts"
},
"keywords": [
Expand Down Expand Up @@ -45,12 +47,13 @@
"dependencies": {
"@agility/content-fetch": "^2.0.10",
"@agility/content-sync": "^1.2.0",
"@agility/management-sdk": "^0.1.35",
"@agility/management-sdk": "^0.1.38",
"ansi-colors": "^4.1.3",
"blessed": "^0.1.81",
"blessed-contrib": "^4.11.0",
"cli-progress": "^3.11.2",
"date-fns": "^4.1.0",
"form-data": "^4.0.5",
"fuzzy": "^0.1.3",
"inquirer": "^8.0.0",
"inquirer-checkbox-plus-prompt": "^1.4.2",
Expand Down
Loading