From 60d8fe0c2180dd1d736e214594cee001a92ce3af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hanu=C5=A1?= Date: Mon, 30 Nov 2026 15:46:44 +0100 Subject: [PATCH] feat: add `apify create --into` to scaffold an Actor into an existing repository `--into ` creates the Actor in `/`, making missing folders. It's rejected with a Git `--source`, which creates a new repository. `create` no longer runs `git init` when the Actor's parent folder is inside a Git work tree, so it doesn't nest a repository in a monorepo. A template whose Dockerfile declares `ARG ACTOR_PATH_IN_DOCKER_CONTEXT` builds from the repository root, so `create` sets `dockerContextDir` in `.actor/actor.json` to the Git root, or to the current directory with `--into` outside Git. --- docs/reference.md | 8 +- src/commands/create.ts | 79 ++++++++-- src/lib/actor-paths.ts | 2 +- src/lib/create-utils.ts | 52 ++++++- src/lib/docker-context.ts | 10 +- test/local/commands/create-into.test.ts | 188 ++++++++++++++++++++++++ test/local/commands/create.test.ts | 41 +++--- 7 files changed, 344 insertions(+), 36 deletions(-) create mode 100644 test/local/commands/create-into.test.ts diff --git a/docs/reference.md b/docs/reference.md index c3d5a073b..6122e791b 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -335,11 +335,11 @@ These commands help you develop Actors locally. Use them to create new Actor pro DESCRIPTION Creates an Actor project from a template in a new directory. The command automatically initializes a git repository in the newly created Actor - directory. + directory, unless it's inside an existing Git repository. USAGE $ apify create [actorName] [--auto-build on|off] - [--git-repo ] [--json] + [--git-repo ] [--into ] [--json] [-l javascript|js|typescript|ts|python|py] [--omit-optional-deps] [--profile ] [--skip-dependency-install] [--skip-git-init] @@ -364,6 +364,10 @@ FLAGS is asked for when you have more than one. List yours with "apify api integrations/git". Only used when --source is a Git provider. + --into= Folder to create the + Actor directory in, instead of the current + directory. It's relative to the current directory + or absolute, and it's created if it doesn't exist. --json Format the command output as JSON. -l, --language=