Skip to content

Commit a34df1f

Browse files
tbiyssclaude
andcommitted
Auto-name sync output directory from org name + ID
Default output is now ./<org-name>-<org-id>/ instead of ./make-sync/. --output flag still overrides. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a2547f5 commit a34df1f

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

‎make_cli/commands/sync.py‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ def sync():
6363

6464
@sync.command("pull")
6565
@click.option("--org", "org_id", required=True, type=int, help="Organization ID to sync")
66-
@click.option("--output", "output_dir", default="./make-sync", show_default=True,
67-
help="Local output directory")
66+
@click.option("--output", "output_dir", default=None,
67+
help="Local output directory (default: ./<org-name>-<org-id>)")
6868
@click.option("--incremental", is_flag=True, default=False,
6969
help="Skip scenarios unchanged since last sync")
7070
@click.option("--team", "team_filter", default=None, type=int,
@@ -76,11 +76,6 @@ def sync_pull(ctx, org_id: int, output_dir: str, incremental: bool, team_filter)
7676
Downloads org → teams → folders → scenarios → blueprints.
7777
Preserves the full hierarchy on disk for offline analysis.
7878
"""
79-
out = Path(output_dir)
80-
out.mkdir(parents=True, exist_ok=True)
81-
82-
manifest = _load_manifest(out) if incremental else {"scenarios": {}}
83-
8479
stats = {"teams": 0, "folders": 0, "scenarios": 0, "blueprints": 0,
8580
"skipped": 0, "hooks": 0, "connections": 0, "datastores": 0,
8681
"functions": 0, "keys": 0, "datastructures": 0}
@@ -102,6 +97,16 @@ def sync_pull(ctx, org_id: int, output_dir: str, incremental: bool, team_filter)
10297
error(str(e))
10398
raise SystemExit(1)
10499
org = org_data.get("organization", org_data)
100+
101+
# Resolve output directory — default to <org-name>-<org-id>
102+
if output_dir:
103+
out = Path(output_dir)
104+
else:
105+
org_name = org.get("name", f"org-{org_id}")
106+
out = Path(_dir_name(org_name, org_id))
107+
out.mkdir(parents=True, exist_ok=True)
108+
109+
manifest = _load_manifest(out) if incremental else {"scenarios": {}}
105110
_write_json(out / "org.json", org)
106111

107112
# Switch client zone to match the org's actual zone

0 commit comments

Comments
 (0)