From 5a73556871ab532c7ad876973eb521ac9f704a72 Mon Sep 17 00:00:00 2001 From: dotta Date: Mon, 23 Mar 2026 06:34:24 -0500 Subject: [PATCH] Use positional source arg for company import Co-Authored-By: Paperclip --- cli/src/__tests__/company-import-export-e2e.test.ts | 3 --- cli/src/commands/client/company.ts | 8 ++++---- doc/AGENTCOMPANIES_SPEC_INVENTORY.md | 2 +- doc/plans/2026-03-13-company-import-export-v2.md | 4 ++-- docs/cli/control-plane-commands.md | 4 ++-- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/cli/src/__tests__/company-import-export-e2e.test.ts b/cli/src/__tests__/company-import-export-e2e.test.ts index 094f846b..a2074658 100644 --- a/cli/src/__tests__/company-import-export-e2e.test.ts +++ b/cli/src/__tests__/company-import-export-e2e.test.ts @@ -390,7 +390,6 @@ describe("paperclipai company import/export e2e", () => { [ "company", "import", - "--from", exportDir, "--target", "new", @@ -435,7 +434,6 @@ describe("paperclipai company import/export e2e", () => { [ "company", "import", - "--from", exportDir, "--target", "existing", @@ -463,7 +461,6 @@ describe("paperclipai company import/export e2e", () => { [ "company", "import", - "--from", exportDir, "--target", "existing", diff --git a/cli/src/commands/client/company.ts b/cli/src/commands/client/company.ts index 01de4548..96bfa835 100644 --- a/cli/src/commands/client/company.ts +++ b/cli/src/commands/client/company.ts @@ -390,7 +390,7 @@ export function registerCompanyCommands(program: Command): void { company .command("import") .description("Import a portable markdown company package from local path, URL, or GitHub") - .requiredOption("--from ", "Source path or URL") + .argument("", "Source path or URL") .option("--include ", "Comma-separated include set: company,agents,projects,issues,tasks,skills", "company,agents") .option("--target ", "Target mode: new | existing") .option("-C, --company-id ", "Existing target company ID") @@ -398,12 +398,12 @@ export function registerCompanyCommands(program: Command): void { .option("--agents ", "Comma-separated agent slugs to import, or all", "all") .option("--collision ", "Collision strategy: rename | skip | replace", "rename") .option("--dry-run", "Run preview only without applying", false) - .action(async (opts: CompanyImportOptions) => { + .action(async (fromPathOrUrl: string, opts: CompanyImportOptions) => { try { const ctx = resolveCommandContext(opts); - const from = (opts.from ?? "").trim(); + const from = fromPathOrUrl.trim(); if (!from) { - throw new Error("--from is required"); + throw new Error("Source path or URL is required."); } const include = parseInclude(opts.include); diff --git a/doc/AGENTCOMPANIES_SPEC_INVENTORY.md b/doc/AGENTCOMPANIES_SPEC_INVENTORY.md index 0d622890..91799bea 100644 --- a/doc/AGENTCOMPANIES_SPEC_INVENTORY.md +++ b/doc/AGENTCOMPANIES_SPEC_INVENTORY.md @@ -60,7 +60,7 @@ Route registration lives in `server/src/app.ts` via `companyRoutes(db, storage)` | File | Commands | |---|---| -| `cli/src/commands/client/company.ts` | `company export` — exports a company package to disk (flags: `--out`, `--include`, `--projects`, `--issues`, `--projectIssues`).
`company import` — imports a company package from a file or folder (flags: `--from`, `--include`, `--target`, `--companyId`, `--newCompanyName`, `--agents`, `--collision`, `--dryRun`).
Reads/writes portable file entries and handles `.paperclip.yaml` filtering. | +| `cli/src/commands/client/company.ts` | `company export` — exports a company package to disk (flags: `--out`, `--include`, `--projects`, `--issues`, `--projectIssues`).
`company import ` — imports a company package from a file or folder (flags: positional source path/URL, `--include`, `--target`, `--companyId`, `--newCompanyName`, `--agents`, `--collision`, `--dryRun`).
Reads/writes portable file entries and handles `.paperclip.yaml` filtering. | ## 7. UI — Pages diff --git a/doc/plans/2026-03-13-company-import-export-v2.md b/doc/plans/2026-03-13-company-import-export-v2.md index 89d39d81..bd26890c 100644 --- a/doc/plans/2026-03-13-company-import-export-v2.md +++ b/doc/plans/2026-03-13-company-import-export-v2.md @@ -484,8 +484,8 @@ The CLI should continue to support direct import/export without a registry. Target commands: - `paperclipai company export --out ` -- `paperclipai company import --from --dry-run` -- `paperclipai company import --from --target existing -C ` +- `paperclipai company import --dry-run` +- `paperclipai company import --target existing -C ` Planned additions: diff --git a/docs/cli/control-plane-commands.md b/docs/cli/control-plane-commands.md index c0d2664c..f6eb33d7 100644 --- a/docs/cli/control-plane-commands.md +++ b/docs/cli/control-plane-commands.md @@ -41,7 +41,7 @@ pnpm paperclipai company export --out ./exports/acme --include comp # Preview import (no writes) pnpm paperclipai company import \ - --from https://github.com///tree/main/ \ + https://github.com///tree/main/ \ --target existing \ --company-id \ --collision rename \ @@ -49,7 +49,7 @@ pnpm paperclipai company import \ # Apply import pnpm paperclipai company import \ - --from ./exports/acme \ + ./exports/acme \ --target new \ --new-company-name "Acme Imported" \ --include company,agents