diff --git a/README.md b/README.md index 4f28be1..20380cf 100644 --- a/README.md +++ b/README.md @@ -572,7 +572,7 @@ cf push [OPTIONS] **Options:** - `--project-root`: Specify project directory - `--force-overwrite`: Overwrite existing files on SFTP (SFTP mode only) -- `--submit`: Submit the project for review after upload +- `--submit`: Submit the project for review after upload (shortcut for `cf push` + `cf submit`) - `--dry-run`: Preview what would be uploaded - `--sftp-username`: Override configured username (SFTP mode only) - `--sftp-key`: Override configured key path (SFTP mode only) @@ -633,6 +633,15 @@ What happens: 4. Staged S3 objects are deleted on success; any leftovers are expired by the bucket lifecycle after 7 days. 5. `--submit` submits for review on success. +### Submit a Project for Review (No Re-upload) + +```bash +cf submit [--project-root PATH] +``` + +Use this when your latest `cf push` already uploaded the files you want reviewed. +`cf submit` moves the platform project into review without requiring another upload. + > [!TIP] > Try modes in this order: `cf push` → `cf push --remote` → `cf push --https`. > The SFTP mode is fastest when unrestricted, `--remote` is the best HTTPS diff --git a/chipfoundry_cli/main.py b/chipfoundry_cli/main.py index 662c646..8d22cff 100644 --- a/chipfoundry_cli/main.py +++ b/chipfoundry_cli/main.py @@ -2860,6 +2860,45 @@ def view_tapeout_report(project_name, report_path): console.print(f"[red]Failed to open tapeout report in browser: {e}[/red]") raise click.Abort() +@main.command("submit") +@click.option( + "--project-root", + required=False, + type=click.Path(exists=True, file_okay=False), + help="Path to the local ChipFoundry project directory (defaults to current directory if .cf/project.json exists).", +) +def submit(project_root): + """Submit a project for admin review without uploading files again.""" + cwd_root, _ = get_project_json_from_cwd() + if not project_root and cwd_root: + project_root = cwd_root + if not project_root: + console.print( + "[red]No project root specified and no .cf/project.json found in current directory.[/red]" + ) + console.print("Provide --project-root or run from a linked project.") + raise click.Abort() + + project_root = str(Path(project_root).resolve()) + platform_id = _load_project_platform_id(project_root) + if not platform_id: + console.print("[red]Project is not linked to the platform.[/red]") + console.print( + "Run [bold]cf link[/bold] to connect this project, or [bold]cf init[/bold] to create a new one." + ) + raise click.Abort() + + config = load_user_config() + if not config.get("api_key"): + console.print("[red]Not logged in.[/red] Run [bold]cf login[/bold] before submitting.") + raise click.Abort() + + try: + _api_post(f"/projects/{platform_id}/submit", {}) + console.print("[green]✓ Project submitted for review[/green]") + except SystemExit: + raise click.Abort() + @main.command('confirm') @click.option('--project-root', required=False, type=click.Path(exists=True, file_okay=False), help='Path to the local ChipFoundry project directory (defaults to current directory if .cf/project.json exists).') @click.option('--sftp-host', default=DEFAULT_SFTP_HOST, show_default=True, help='SFTP server hostname.') diff --git a/pyproject.toml b/pyproject.toml index 988506d..df0b66f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "chipfoundry-cli" -version = "2.4.9" +version = "2.4.10" description = "CLI tool to automate ChipFoundry project submission to SFTP server" authors = ["ChipFoundry "] readme = "README.md"